summaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-14 09:51:41 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-14 09:51:41 +0100
commitb3ad3ad85eb5a910c191a3966e5c01f2fb88a4d3 (patch)
treef4595f230baa2eaa7dff6f49c0d197b931fee673 /admin
parent7a21da41db5ab3bdb5777b6ff501fc210fbb02ad (diff)
downloadnewsletters-b3ad3ad85eb5a910c191a3966e5c01f2fb88a4d3.tar.gz
newsletters-b3ad3ad85eb5a910c191a3966e5c01f2fb88a4d3.tar.bz2
newsletters-b3ad3ad85eb5a910c191a3966e5c01f2fb88a4d3.zip
php-cs-fixer tidies to php8.5 standards
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'admin')
-rw-r--r--admin/admin_newsletter_subscriptions.php22
-rwxr-xr-xadmin/admin_newsletters.php10
-rw-r--r--admin/admin_newsletters_inc.php34
-rwxr-xr-xadmin/mail_queue.php6
-rw-r--r--admin/schema_inc.php54
-rwxr-xr-xadmin/send.php8
-rw-r--r--admin/upgrade_inc.php135
-rw-r--r--admin/upgrades/1.0.1.php22
-rw-r--r--admin/upgrades/1.0.2.php22
9 files changed, 156 insertions, 157 deletions
diff --git a/admin/admin_newsletter_subscriptions.php b/admin/admin_newsletter_subscriptions.php
index b39293a..b25682d 100644
--- a/admin/admin_newsletter_subscriptions.php
+++ b/admin/admin_newsletter_subscriptions.php
@@ -35,11 +35,11 @@ if( $gContent->isValid() ) {
foreach( $_REQUEST["checked"] as $del ) {
$formHash['input'][] = '<input type="hidden" name="checked[]" value="'.$del.'"/>';
}
- $gBitSystem->confirmDialog( $formHash,
- array(
+ $gBitSystem->confirmDialog( $formHash,
+ [
'warning' => tra('Are you sure you want to delete these subscriptions?') . ' (' . tra('Count: ') . count( $_REQUEST["checked"] ) . ')',
'error' => tra('This cannot be undone!'),
- )
+ ],
);
} else {
foreach ($_REQUEST["checked"] as $delete) {
@@ -56,11 +56,11 @@ if( $gContent->isValid() ) {
foreach( $_REQUEST["checked"] as $del ) {
$formHash['input'][] = '<input type="hidden" name="checked[]" value="'.$del.'"/>';
}
- $gBitSystem->confirmDialog( $formHash,
- array(
+ $gBitSystem->confirmDialog( $formHash,
+ [
'warning' => tra('Are you sure you want to unsubcsribe these subscriptions?') . ' (' . tra('Count: ') . count( $_REQUEST["checked"] ) . ')',
'error' => tra('This cannot be undone!'),
- )
+ ],
);
} else {
foreach ($_REQUEST["checked"] as $delete) {
@@ -77,11 +77,11 @@ if( $gContent->isValid() ) {
foreach( $_REQUEST["checked"] as $del ) {
$formHash['input'][] = '<input type="hidden" name="checked[]" value="'.$del.'"/>';
}
- $gBitSystem->confirmDialog( $formHash,
- array(
- 'warning' => tra('Are you sure you want to resubscribe these subscriptions?') . ' (' . tra('Count: ') . count( $_REQUEST["checked"] ) . ')',
+ $gBitSystem->confirmDialog( $formHash,
+ [
+ 'warning' => tra('Are you sure you want to resubscribe these subscriptions?') . ' (' . tra('Count: ') . count( $_REQUEST["checked"] ) . ')',
'error' => tra('This cannot be undone!'),
- )
+ ],
);
} else {
foreach ($_REQUEST["checked"] as $delete) {
@@ -108,6 +108,6 @@ include_once( CATEGORIES_PKG_INCLUDE_PATH.'categorize_list_inc.php' );
*/
// Display the template
-$gBitSystem->display( 'bitpackage:newsletters/admin_newsletter_subscriptions.tpl' , NULL, array( 'display_mode' => 'admin' ));
+$gBitSystem->display( 'bitpackage:newsletters/admin_newsletter_subscriptions.tpl' , NULL, [ 'display_mode' => 'admin' ]);
?>
diff --git a/admin/admin_newsletters.php b/admin/admin_newsletters.php
index 05dbd9d..05812ab 100755
--- a/admin/admin_newsletters.php
+++ b/admin/admin_newsletters.php
@@ -19,10 +19,10 @@ if( isset( $_REQUEST["remove"] ) && $gContent->isValid() ) {
} elseif( empty( $_REQUEST['confirm'] ) ) {
$formHash['remove'] = TRUE;
$formHash['nl_id'] = $gContent->mNewsletterId;
- $gBitSystem->confirmDialog( $formHash,
- array(
- 'warning' => tra('Are you sure you want to delete this newsletter?') . ' ' . $gContent->getTitle()
- )
+ $gBitSystem->confirmDialog( $formHash,
+ [
+ 'warning' => tra('Are you sure you want to delete this newsletter?') . ' ' . $gContent->getTitle(),
+ ],
);
} else {
if( $gContent->expunge() ) {
@@ -62,5 +62,5 @@ include_once( CATEGORIES_PKG_INCLUDE_PATH.'categorize_list_inc.php' );
*/
// Display the template
-$gBitSystem->display( 'bitpackage:newsletters/list_newsletters.tpl', NULL, array( 'display_mode' => 'admin' ));
+$gBitSystem->display( 'bitpackage:newsletters/list_newsletters.tpl', NULL, [ 'display_mode' => 'admin' ]);
diff --git a/admin/admin_newsletters_inc.php b/admin/admin_newsletters_inc.php
index ca0801b..f8824f8 100644
--- a/admin/admin_newsletters_inc.php
+++ b/admin/admin_newsletters_inc.php
@@ -1,50 +1,50 @@
<?php
// $Header$
-$formNewsletterFeatures = array(
- "bitmailer_sender_email" => array(
+$formNewsletterFeatures = [
+ "bitmailer_sender_email" => [
'label' => 'From Email',
'note' => 'If empty, it will default to the site Sender Email',
'default' => $gBitSystem->getConfig( 'site_sender_email', $_SERVER['SERVER_ADMIN'] ),
- ),
- "bitmailer_from" => array(
+ ],
+ "bitmailer_from" => [
'label' => 'From Name',
'note' => '',
'default' => $gBitSystem->getConfig( 'siteTitle' ),
- ),
- "bitmailer_servers" => array(
+ ],
+ "bitmailer_servers" => [
'label' => 'Mail Servers',
'note' => '',
'default' => $gBitSystem->getConfig( 'kernel_server_name', '127.0.0.1' ),
- ),
- "bitmailer_smtp_username" => array(
+ ],
+ "bitmailer_smtp_username" => [
'label' => 'SMTP Username',
'note' => 'Only required for authenticated outbound mail servers.',
'default' => $gBitSystem->getConfig( 'bitmailer_smtp_username' ),
- ),
- "bitmailer_smtp_password" => array(
+ ],
+ "bitmailer_smtp_password" => [
'label' => 'SMTP Password',
'note' => 'Password for the above SMTP Username',
'default' => $gBitSystem->getConfig( 'bitmailer_smtp_password' ),
- ),
- "bitmailer_protocol" => array(
+ ],
+ "bitmailer_protocol" => [
'label' => 'Protocol',
'note' => '',
'default' => 'smtp',
- ),
- "bitmailer_word_wrap" => array(
+ ],
+ "bitmailer_word_wrap" => [
'label' => 'Word wrap',
'note' => '',
'default' => '75',
- ),
-);
+ ],
+];
$gBitSmarty->assign( 'formNewsletterFeatures',$formNewsletterFeatures );
if( !empty( $_POST ) ) {
foreach( array_keys( $formNewsletterFeatures ) as $key ) {
if( empty( $_REQUEST[$key] ) || $_REQUEST[$key] != $formNewsletterFeatures[$key]['default'] ) {
- $gBitSystem->storeConfig( $key, isset( $_REQUEST[$key] ) ? $_REQUEST[$key] : NULL );
+ $gBitSystem->storeConfig( $key, $_REQUEST[$key] ?? NULL );
}
}
}
diff --git a/admin/mail_queue.php b/admin/mail_queue.php
index 0d79434..05f5eac 100755
--- a/admin/mail_queue.php
+++ b/admin/mail_queue.php
@@ -15,7 +15,7 @@ $gBitNewsletterMailer = new BitNewsletterMailer();
if( !empty( $_REQUEST['batch_command'] ) && !empty( $_REQUEST['queue_id'] ) ) {
if( $_REQUEST['batch_command'] == 'delete' ) {
- foreach( $_REQUEST['queue_id'] as $qId ) {
+ foreach( $_REQUEST['queue_id'] as $qId ) {
$gBitNewsletterMailer->expungeQueueRow( $qId );
}
} elseif( $_REQUEST['batch_command'] == 'send' && !empty( $_REQUEST['queue_id'] ) ) {
@@ -26,9 +26,9 @@ if( !empty( $_REQUEST['batch_command'] ) && !empty( $_REQUEST['queue_id'] ) ) {
}
if( empty( $_REQUEST['batch_command'] ) || $_REQUEST['batch_command'] != 'send' ) {
- $listHash = array();
+ $listHash = [];
$queue = $gBitNewsletterMailer->getQueue( $listHash );
$gBitSmarty->assign( 'queue', $queue );
- $gBitSystem->display( 'bitpackage:newsletters/mail_queue.tpl' , NULL, array( 'display_mode' => 'admin' ));
+ $gBitSystem->display( 'bitpackage:newsletters/mail_queue.tpl' , NULL, [ 'display_mode' => 'admin' ]);
}
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index 9f7c05d..08f199a 100644
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -1,6 +1,6 @@
<?php
-$tables = array(
+$tables = [
'newsletters' => "
nl_id I4 AUTO PRIMARY,
@@ -81,9 +81,9 @@ $tables = array(
clicks I4
CONSTRAINT ', CONSTRAINT `mail_clickthrough_user_ref` FOREIGN KEY (`user_id`) REFERENCES `".BIT_DB_PREFIX."users_users` (`user_id`),
CONSTRAINT `mail_clickthrough_content_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content` (`content_id`)'
-"
+",
-);
+];
global $gBitInstaller;
@@ -91,36 +91,36 @@ foreach( array_keys( $tables ) AS $tableName ) {
$gBitInstaller->registerSchemaTable( NEWSLETTERS_PKG_DIR, $tableName, $tables[$tableName] );
}
-$gBitInstaller->registerPackageInfo( NEWSLETTERS_PKG_NAME, array(
+$gBitInstaller->registerPackageInfo( NEWSLETTERS_PKG_NAME, [
'description' => "Newsletters is for emailing users updates about your site.",
'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>',
-) );
+] );
// ### Indexes
-$indices = array (
- 'mail_sub_nl_idx' => array( 'table' => 'mail_subscriptions', 'cols' => 'content_id', 'opts' => NULL ),
- 'mail_sub_user_idx' => array( 'table' => 'mail_subscriptions', 'cols' => 'user_id', 'opts' => NULL ),
- 'mail_sub_email_idx' => array( 'table' => 'mail_subscriptions', 'cols' => 'email', 'opts' => NULL ),
- 'nl_ed_nl_idx' => array( 'table' => 'newsletters_editions', 'cols' => 'nl_content_id', 'opts' => NULL ),
- 'nl_ed_content_idx' => array( 'table' => 'newsletters_editions', 'cols' => 'content_id', 'opts' => NULL ),
- 'mailq_email_idx' => array( 'table' => 'mail_queue', 'cols' => 'email', 'opts' => NULL ),
- 'mailq_user_idx' => array( 'table' => 'mail_queue', 'cols' => 'user_id', 'opts' => NULL ),
- 'mailq_content_idx' => array( 'table' => 'mail_queue', 'cols' => 'content_id', 'opts' => NULL ),
- 'mailq_user_content_idx' => array( 'table' => 'mail_queue', 'cols' => array('content_id','user_id'), 'opts' => array( 'UNIQUE' ) ),
- 'mailq_sent_idx' => array( 'table' => 'mail_queue', 'cols' => 'sent_date', 'opts' => NULL ),
-);
+$indices = [
+ 'mail_sub_nl_idx' => [ 'table' => 'mail_subscriptions', 'cols' => 'content_id', 'opts' => NULL ],
+ 'mail_sub_user_idx' => [ 'table' => 'mail_subscriptions', 'cols' => 'user_id', 'opts' => NULL ],
+ 'mail_sub_email_idx' => [ 'table' => 'mail_subscriptions', 'cols' => 'email', 'opts' => NULL ],
+ 'nl_ed_nl_idx' => [ 'table' => 'newsletters_editions', 'cols' => 'nl_content_id', 'opts' => NULL ],
+ 'nl_ed_content_idx' => [ 'table' => 'newsletters_editions', 'cols' => 'content_id', 'opts' => NULL ],
+ 'mailq_email_idx' => [ 'table' => 'mail_queue', 'cols' => 'email', 'opts' => NULL ],
+ 'mailq_user_idx' => [ 'table' => 'mail_queue', 'cols' => 'user_id', 'opts' => NULL ],
+ 'mailq_content_idx' => [ 'table' => 'mail_queue', 'cols' => 'content_id', 'opts' => NULL ],
+ 'mailq_user_content_idx' => [ 'table' => 'mail_queue', 'cols' => ['content_id','user_id'], 'opts' => [ 'UNIQUE' ] ],
+ 'mailq_sent_idx' => [ 'table' => 'mail_queue', 'cols' => 'sent_date', 'opts' => NULL ],
+];
$gBitInstaller->registerSchemaIndexes( NEWSLETTERS_PKG_NAME, $indices );
// ### Default UserPermissions
-$gBitInstaller->registerUserPermissions( NEWSLETTERS_PKG_NAME, array(
- array('p_newsletters_admin', 'Can admin and send newsletters', 'editors', 'newsletters'),
- array('p_newsletters_create', 'Can create newsletters', 'editors', 'newsletters'),
- array('p_newsletters_create_editions', 'Can create editions', 'editors', 'newsletters'),
- array('p_newsletters_subscribe', 'Can subscribe to newsletters', 'registered', 'newsletters'),
- array('p_newsletters_subscribe_email', 'Can subscribe any email to newsletters', 'editors', 'newsletters'),
-) );
+$gBitInstaller->registerUserPermissions( NEWSLETTERS_PKG_NAME, [
+ ['p_newsletters_admin', 'Can admin and send newsletters', 'editors', 'newsletters'],
+ ['p_newsletters_create', 'Can create newsletters', 'editors', 'newsletters'],
+ ['p_newsletters_create_editions', 'Can create editions', 'editors', 'newsletters'],
+ ['p_newsletters_subscribe', 'Can subscribe to newsletters', 'registered', 'newsletters'],
+ ['p_newsletters_subscribe_email', 'Can subscribe any email to newsletters', 'editors', 'newsletters'],
+] );
// Requirements
-$gBitInstaller->registerRequirements( NEWSLETTERS_PKG_NAME, array(
- 'liberty' => array( 'min' => '2.1.4' ),
-));
+$gBitInstaller->registerRequirements( NEWSLETTERS_PKG_NAME, [
+ 'liberty' => [ 'min' => '2.1.4' ],
+]);
diff --git a/admin/send.php b/admin/send.php
index 77f46ae..f2d13cd 100755
--- a/admin/send.php
+++ b/admin/send.php
@@ -16,7 +16,7 @@ $gBitSystem->verifyPermission( 'p_send_newsletters' );
require_once( NEWSLETTERS_PKG_INCLUDE_PATH.'lookup_newsletter_edition_inc.php' );
-$feedback = array();
+$feedback = [];
if( @BitBase::verifyId( $_REQUEST["edition_id"] ) ) {
$gContent->mEditionId = $_REQUEST["edition_id"];
@@ -49,12 +49,12 @@ if( $gContent->isValid() && isset( $_REQUEST['preview'] ) && isset( $_REQUEST['s
}
if( $gContent->isValid() ) {
- $groupListHash = array();
+ $groupListHash = [];
$groups = $gBitUser->getAllGroups( $groupListHash );
$groups['send_subs']['group_name'] = 'Send to subscribers';
$gBitSmarty->assign( 'groupList', $groups );
} else {
- $listHash = array();
+ $listHash = [];
$editions = $gContent->getList( $listHash );
$gBitSmarty->assign( 'editionList', $editions );
@@ -66,5 +66,5 @@ if( $gContent->isValid() ) {
$gBitSmarty->assign( 'feedback', $feedback );
// Display the template
-$gBitSystem->display( 'bitpackage:newsletters/send_newsletters.tpl' , tra( "Send Newsletter" ).': '.$gContent->getTitle() , array( 'display_mode' => 'admin' ));
+$gBitSystem->display( 'bitpackage:newsletters/send_newsletters.tpl' , tra( "Send Newsletter" ).': '.$gContent->getTitle() , [ 'display_mode' => 'admin' ]);
diff --git a/admin/upgrade_inc.php b/admin/upgrade_inc.php
index 5581855..243723b 100644
--- a/admin/upgrade_inc.php
+++ b/admin/upgrade_inc.php
@@ -1,78 +1,78 @@
<?php
global $gBitSystem, $gUpgradeFrom, $gUpgradeTo;
-$upgrades = array(
+$upgrades = [
-'BONNIE' => array(
- 'CLYDE' => array(
-array( 'RENAMETABLE' => array(
- 'tiki_sent_newsletters' => 'tiki_newsletters_editions',
- 'tiki_newsletter_subscriptions' => 'tiki_mail_subscriptions',
-)),
+'BONNIE' => [
+ 'CLYDE' => [
+[ 'RENAMETABLE' => [
+ 'tiki_sent_newsletters' => 'tiki_newsletters_editions',
+ 'tiki_newsletter_subscriptions' => 'tiki_mail_subscriptions',
+]],
// STEP 1
-array( 'DATADICT' => array(
- array( 'RENAMECOLUMN' => array(
- 'tiki_newsletters' => array( '`nlId`' => '`nl_id` I4 AUTO' ),
- 'tiki_newsletters' => array( '`allowUserSub`' => "`allow_user_sub` C(1) default 'y'" ),
- 'tiki_newsletters' => array( '`allowAnySub`' => '`allow_any_sub` C(1)' ),
- 'tiki_newsletters' => array( '`unsubMsg`' => "`unsub_msg` C(1) default 'y'" ),
- 'tiki_newsletters' => array( '`validateAddr`' => "`validate_addr` C(1) default 'y'" ),
- 'tiki_newsletters' => array( '`lastSent`' => '`last_sent` I8' ),
- 'tiki_newsletters_editions' => array( '`editionId`' => '`edition_id` I4 AUTO' ),
- 'tiki_newsletter_subscriptions' => array( '`code`' => "`sub_code` C(36)" ),
- 'tiki_newsletter_subscriptions' => array( '`valid`' => "`is_valid` C(1)" ),
- 'tiki_newsletter_subscriptions' => array( '`subscribed`' => "`subscribed_date` I8" ),
- )),
+[ 'DATADICT' => [
+ [ 'RENAMECOLUMN' => [
+ 'tiki_newsletters' => [ '`nlId`' => '`nl_id` I4 AUTO' ],
+ 'tiki_newsletters' => [ '`allowUserSub`' => "`allow_user_sub` C(1) default 'y'" ],
+ 'tiki_newsletters' => [ '`allowAnySub`' => '`allow_any_sub` C(1)' ],
+ 'tiki_newsletters' => [ '`unsubMsg`' => "`unsub_msg` C(1) default 'y'" ],
+ 'tiki_newsletters' => [ '`validateAddr`' => "`validate_addr` C(1) default 'y'" ],
+ 'tiki_newsletters' => [ '`lastSent`' => '`last_sent` I8' ],
+ 'tiki_newsletters_editions' => [ '`editionId`' => '`edition_id` I4 AUTO' ],
+ 'tiki_newsletter_subscriptions' => [ '`code`' => "`sub_code` C(36)" ],
+ 'tiki_newsletter_subscriptions' => [ '`valid`' => "`is_valid` C(1)" ],
+ 'tiki_newsletter_subscriptions' => [ '`subscribed`' => "`subscribed_date` I8" ],
+ ]],
// ALTER
- array( 'ALTER' => array(
- 'tiki_newsletters' => array(
- 'content_id' => array( '`content_id`', 'I4' ),
- ),
- 'tiki_newsletters_editions' => array(
- 'content_id' => array( '`content_id`', 'I4' ),
- 'nl_content_id' => array( '`nl_content_id`', 'I4' ),
- 'is_draft' => array( '`is_draft`', 'C(1)' ),
- ),
- 'tiki_newsletter_subscriptions' => array(
- 'nl_content_id' => array( '`nl_content_id`', 'I4' ),
- 'response_content_id' => array( '`response_content_id`', 'I4' ),
- 'unsubscribe_all' => array( '`unsubscribe_all`', 'C(1)' ),
- 'unsubscribe_date' => array( '`unsubscribe_date`', 'I8' ),
- ),
- )),
+ [ 'ALTER' => [
+ 'tiki_newsletters' => [
+ 'content_id' => [ '`content_id`', 'I4' ],
+ ],
+ 'tiki_newsletters_editions' => [
+ 'content_id' => [ '`content_id`', 'I4' ],
+ 'nl_content_id' => [ '`nl_content_id`', 'I4' ],
+ 'is_draft' => [ '`is_draft`', 'C(1)' ],
+ ],
+ 'tiki_newsletter_subscriptions' => [
+ 'nl_content_id' => [ '`nl_content_id`', 'I4' ],
+ 'response_content_id' => [ '`response_content_id`', 'I4' ],
+ 'unsubscribe_all' => [ '`unsubscribe_all`', 'C(1)' ],
+ 'unsubscribe_date' => [ '`unsubscribe_date`', 'I8' ],
+ ],
+ ]],
// CREATE
- array( 'CREATE' => array (
- )),
-)),
+ [ 'CREATE' => [
+ ]],
+]],
// STEP 3
-array( 'QUERY' =>
- array( 'SQL92' => array(
- ),
-)),
+[ 'QUERY' =>
+ [ 'SQL92' => [
+ ],
+], ],
// STEP 6
-array( 'DATADICT' => array(
- array( 'DROPCOLUMN' => array(
- 'tiki_newsletters' => array( '`name`', '`description`', '`created`', '`users`', '`editions`' ),
- )),
-)),
- )
-),
+[ 'DATADICT' => [
+ [ 'DROPCOLUMN' => [
+ 'tiki_newsletters' => [ '`name`', '`description`', '`created`', '`users`', '`editions`' ],
+ ]],
+]],
+ ],
+],
- 'BWR1' => array(
- 'BWR2' => array(
+ 'BWR1' => [
+ 'BWR2' => [
// de-tikify tables
-array( 'DATADICT' => array(
- array( 'RENAMETABLE' => array(
+[ 'DATADICT' => [
+ [ 'RENAMETABLE' => [
'tiki_newsletters' => 'newsletters',
'tiki_newsletters_editions' => 'newsletters_editions',
'tiki_mail_subscriptions' => 'mail_subscriptions',
'tiki_mail_errors' => 'mail_errors',
'tiki_mail_mailings' => 'mail_mailings',
'tiki_mail_queue' => 'mail_queue',
- )),
- array( 'CREATE' => array (
+ ]],
+ [ 'CREATE' => [
'mail_clickthrough' => "
user_id I4 NOTNULL,
content_id I4 NOTNULL,
@@ -80,21 +80,20 @@ array( 'DATADICT' => array(
clicks I4
CONSTRAINT ', CONSTRAINT `mail_clickthrough_user_ref` FOREIGN KEY (`user_id`) REFERENCES `".BIT_DB_PREFIX."users_users` (`user_id`),
CONSTRAINT `mail_clickthrough_content_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content` (`content_id`)'
- "
- )),
- array( 'ALTER' => array(
- 'mail_queue' => array(
- 'last_read_ip' => array( '`last_read_ip`', 'VARCHAR(40)' ),
- ),
- )),
-)),
- )
- ),
-);
+ ",
+ ]],
+ [ 'ALTER' => [
+ 'mail_queue' => [
+ 'last_read_ip' => [ '`last_read_ip`', 'VARCHAR(40)' ],
+ ],
+ ]],
+]],
+ ],
+ ],
+];
if( isset( $upgrades[$gUpgradeFrom][$gUpgradeTo] ) ) {
$gBitSystem->registerUpgrade( NEWSLETTERS_PKG_NAME, $upgrades[$gUpgradeFrom][$gUpgradeTo] );
}
-
?>
diff --git a/admin/upgrades/1.0.1.php b/admin/upgrades/1.0.1.php
index 11428d6..cb0c1be 100644
--- a/admin/upgrades/1.0.1.php
+++ b/admin/upgrades/1.0.1.php
@@ -4,23 +4,23 @@
*/
global $gBitInstaller;
-$infoHash = array(
+$infoHash = [
'package' => NEWSLETTERS_PKG_NAME,
'version' => str_replace( '.php', '', basename( __FILE__ )),
'description' => "Minor fix to ip columns to support IPv6",
'post_upgrade' => NULL,
-);
+];
// Increase the size of the IP column to cope with IPv6
-$gBitInstaller->registerPackageUpgrade( $infoHash, array(
+$gBitInstaller->registerPackageUpgrade( $infoHash, [
-array( 'QUERY' =>
- array(
- 'PGSQL' => array( "ALTER TABLE `".BIT_DB_PREFIX."mail_queue` ALTER `last_read_ip` TYPE VARCHAR(39)" ,),
- 'OCI' => array( "ALTER TABLE `".BIT_DB_PREFIX."mail_queue` MODIFY (`last_read_ip` TYPE VARCHAR2(39))" ,),
- 'MYSQL' => array( "ALTER TABLE `".BIT_DB_PREFIX."mail_queue` MODIFY `last_read_ip` VARCHAR(39)" ,),
- ),
-),
+[ 'QUERY' =>
+ [
+ 'PGSQL' => [ "ALTER TABLE `".BIT_DB_PREFIX."mail_queue` ALTER `last_read_ip` TYPE VARCHAR(39)" ,],
+ 'OCI' => [ "ALTER TABLE `".BIT_DB_PREFIX."mail_queue` MODIFY (`last_read_ip` TYPE VARCHAR2(39))" ,],
+ 'MYSQL' => [ "ALTER TABLE `".BIT_DB_PREFIX."mail_queue` MODIFY `last_read_ip` VARCHAR(39)" ,],
+ ],
+],
-));
+]);
?>
diff --git a/admin/upgrades/1.0.2.php b/admin/upgrades/1.0.2.php
index 28eea19..5a0f36d 100644
--- a/admin/upgrades/1.0.2.php
+++ b/admin/upgrades/1.0.2.php
@@ -4,23 +4,23 @@
*/
global $gBitInstaller;
-$infoHash = array(
+$infoHash = [
'package' => NEWSLETTERS_PKG_NAME,
'version' => str_replace( '.php', '', basename( __FILE__ )),
'description' => "Replace reserved name reads with hits",
'post_upgrade' => NULL,
-);
+];
// Increase the size of the IP column to cope with IPv6
-$gBitInstaller->registerPackageUpgrade( $infoHash, array(
+$gBitInstaller->registerPackageUpgrade( $infoHash, [
-array( 'DATADICT' => array(
- array( 'RENAMECOLUMN' => array(
- 'mail_queue' => array(
- '`reads`' => '`hits` I2 NOTNULL DEFAULT 0'
- ),
- )),
-)),
+[ 'DATADICT' => [
+ [ 'RENAMECOLUMN' => [
+ 'mail_queue' => [
+ '`reads`' => '`hits` I2 NOTNULL DEFAULT 0',
+ ],
+ ]],
+]],
-));
+]);
?>