Version 4.0.13.1

This commit is contained in:
Neo committed 2025-12-19 04:57:54 -08:00
1 parent f9e857d255
commit c6a86f0d9b
7517 files changed
+597400 -668041

No files matched your search

View File
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,29 @@
{
"1": {
"method": "addColumn",
"params": [
"core_theme_settings_fields",
{
"name": "sc_title",
"type": "VARCHAR",
"length": 255,
"decimals": null,
"values": [],
"allow_null": false,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "update",
"params": [
"core_theme_settings_fields",
"sc_title=CONCAT( 'themesetting_', sc_key )"
]
}
}
Whitespace-only changes.
@@ -0,0 +1,107 @@
<?php
/**
* @brief 4.0.0 Alpha 1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 25 Mar 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100002;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Alpha 1 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Fix languages
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
if( !\IPS\Db::i()->checkForColumn( 'core_sys_lang', 'lang_enabled' ) )
{
\IPS\Db::i()->addColumn( 'core_sys_lang', array(
'name' => 'lang_enabled',
'type' => 'BIT',
'length' => 1,
'allow_null' => false,
'binary' => false,
'comment' => "Indicates if the language is enabled",
'default' => 1,
) );
}
if( !\IPS\Db::i()->checkForColumn( 'core_members', 'members_cache' ) )
{
\IPS\Db::i()->addColumn( 'core_members', array(
'name' => 'members_cache',
'type' => 'MEDIUMTEXT',
'length' => 0,
'allow_null' => true,
'binary' => false,
'default' => null,
) );
}
return true;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Checking languages";
}
/**
* Step 2
* Fix seo titles
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
\IPS\Db::i()->update( 'core_announcements', array( 'announce_seo_title' => '' ) );
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array( array(
'table' => 'core_members',
'query' => "UPDATE " . \IPS\Db::i()->prefix . "core_members SET members_seo_name=''"
) ) );
if ( count( $toRun ) )
{
$mr = \IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 3 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => $mr ) ) ) );
}
return true;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Resetting friendly URL titles";
}
}
Whitespace-only changes.
@@ -0,0 +1,15 @@
<?php
/**
* @brief Upgrader: Custom Upgrade Options
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 4 Dec 2014
* @version SVN_VERSION_NUMBER
*/
/* Should friends be converted to followers ? */
$options = array(
new \IPS\Helpers\Form\Radio( '100003_follow_options', 'no_convert', TRUE, array( 'options' => array( 'no_convert' => '100003_no_convert', 'convert' => '100003_convert' ) ) )
);
@@ -0,0 +1,268 @@
{
"1": {
"method": "changeColumn",
"params": [
"core_emoticons",
"image",
{
"name": "image",
"type": "TEXT",
"length": 128,
"decimals": null,
"values": [],
"allow_null": false,
"default": "",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "dropTable",
"params": [
"core_plugin_hooks",
true
]
},
"3": {
"method": "addIndex",
"params": [
"core_follow",
{
"type": "key",
"name": "followers",
"columns": [
"follow_app",
"follow_area",
"follow_rel_id",
"follow_notify_freq"
],
"length": [
null,
null,
null,
null
]
}
]
},
"4": {
"method": "addIndex",
"params": [
"core_search_index",
{
"type": "key",
"name": "author_lookup",
"columns": [
"index_author",
"index_hidden",
"index_date_updated"
],
"length": [
null,
null,
null
]
}
]
},
"5": {
"method": "changeIndex",
"params": [
"core_sessions",
"running_time",
{
"type": "key",
"name": "running_time",
"columns": [
"running_time",
"member_id",
"uagent_type"
],
"length": [
null,
null,
null
]
}
]
},
"6": {
"method": "dropIndex",
"params": [
"core_login_handlers",
"login_order"
]
},
"7": {
"method": "changeIndex",
"params": [
"core_login_handlers",
"login_enabled",
{
"type": "key",
"name": "login_enabled",
"columns": [
"login_enabled",
"login_order"
],
"length": [
null,
null
]
}
]
},
"8": {
"method": "changeIndex",
"params": [
"core_tags",
"tag_app",
{
"type": "key",
"name": "tag_app",
"columns": [
"tag_meta_app",
"tag_meta_area",
"tag_meta_id"
],
"length": [
null,
null,
null
]
}
]
},
"9": {
"method": "addIndex",
"params": [
"core_rc_index",
{
"type": "key",
"name": "report_count",
"columns": [
"perm_id",
"status"
],
"length": [
null,
null
]
}
]
},
"10": {
"method": "changeIndex",
"params": [
"core_member_status_replies",
"reply_status_id",
{
"type": "key",
"name": "reply_status_id",
"columns": [
"reply_status_id",
"reply_date"
],
"length": [
null,
null
]
}
]
},
"11": {
"method": "dropIndex",
"params": [
"core_sessions",
"running_time"
]
},
"12": {
"method": "addIndex",
"params": [
"core_sessions",
{
"type": "key",
"name": "login_type",
"columns": [
"login_type",
"running_time"
],
"length": [
null,
null
]
}
]
},
"13": {
"method": "changeColumn",
"params": [
"core_sessions",
"member_id",
{
"name": "member_id",
"type": "MEDIUMINT",
"length": 8,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"14": {
"method": "changeIndex",
"params": [
"core_sessions",
"member_id",
{
"type": "unique",
"name": "member_id",
"columns": [
"member_id"
],
"length": [
null
]
}
]
},
"15": {
"method": "changeColumn",
"params": [
"core_attachments_map",
"temp",
{
"name": "temp",
"type": "VARCHAR",
"length": 32,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "Temporary key for content claiming attachment",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"16": {
"method": "dropTable",
"params": [
"core_spider_logs",
true
]
}
}
@@ -0,0 +1,441 @@
<?php
/**
* @brief 4.0.0 Alpha 1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 25 Mar 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100003;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Alpha 1 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Fix languages
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\Db::i()->delete( 'core_sys_lang_words', "word_app IN('members','ccs','ipseo','ipchat')" );
return true;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Cleaning up languages";
}
/**
* Step 2
* Fix followers from a 3.x upgrade
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
$perCycle = 250;
$did = 0;
$limit = intval( \IPS\Request::i()->extra );
/* Try to prevent timeouts to the extent possible */
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
foreach( \IPS\Db::i()->select( '*', 'core_follow', null, 'follow_id ASC', array( $limit, $perCycle ) ) as $follow )
{
if( $cutOff !== null AND time() >= $cutOff )
{
return ( $limit + $did );
}
$did++;
/* We of course don't need to update current 4.0 data */
if( !in_array( $follow['follow_area'], array( 'topics', 'forums', 'files', 'images', 'entries', 'calendars', 'categories', 'albums', 'events' ) ) AND mb_strpos( $follow['follow_area'], 'ccs_custom_database' ) !== 0 )
{
continue;
}
/* Figure out what to update */
$update = $follow;
switch( $follow['follow_area'] )
{
case 'topics':
$update['follow_area'] = 'topic';
$update['follow_id'] = md5( 'forums;topic;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
break;
case 'forums':
$update['follow_area'] = 'forum';
$update['follow_id'] = md5( 'forums;forum;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
break;
case 'files':
$update['follow_area'] = 'file';
$update['follow_id'] = md5( 'downloads;file;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
break;
case 'images':
$update['follow_area'] = 'image';
$update['follow_id'] = md5( 'gallery;image;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
break;
case 'entries':
$update['follow_area'] = 'entry';
$update['follow_id'] = md5( 'blog;entry;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
break;
case 'calendars':
$update['follow_area'] = 'calendar';
$update['follow_id'] = md5( 'calendar;calendar;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
break;
case 'categories':
$update['follow_area'] = 'category';
$update['follow_id'] = md5( $follow['follow_app'] . ';category;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
break;
case 'albums':
$update['follow_area'] = 'album';
$update['follow_id'] = md5( 'gallery;album;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
break;
case 'events':
$update['follow_area'] = 'event';
$update['follow_id'] = md5( 'calendar;event;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
break;
default:
$data = explode( '_', str_replace( 'ccs_custom_database_', '', $follow['follow_area'] ) );
$update['follow_app'] = 'cms';
$update['follow_area'] = $data[1] . $data[0];
$update['follow_id'] = md5( 'cms;' . $update['follow_area'] . ';' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
break;
}
\IPS\Db::i()->delete( 'core_follow', array( 'follow_id=?', $follow['follow_id'] ) );
\IPS\Db::i()->replace( 'core_follow', $update );
}
if( $did )
{
return ( $limit + $did );
}
else
{
unset( $_SESSION['_step2Count'] );
return TRUE;
}
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
if( !isset( $_SESSION['_step2Count'] ) )
{
$_SESSION['_step2Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'core_follow' )->first();
}
return "Fixing existing follows (Fixed so far: " . ( ( $limit > $_SESSION['_step2Count'] ) ? $_SESSION['_step2Count'] : $limit ) . ' out of ' . $_SESSION['_step2Count'] . ')';
}
/**
* Step 3
* Convert old friends to followers
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step3()
{
/* If we aren't upgrading from 3.x the table won't be present */
if( !\IPS\Db::i()->checkForTable('profile_friends') )
{
return true;
}
/* Did we skip? */
if ( $_SESSION['upgrade_options']['core']['100003']['follow_options'] == 'no_convert' )
{
\IPS\Db::i()->dropTable( 'profile_friends' );
return true;
}
$perCycle = 250;
$did = 0;
$limit = intval( \IPS\Request::i()->extra );
/* Try to prevent timeouts to the extent possible */
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
foreach( \IPS\Db::i()->select( '*', 'profile_friends', null, 'friends_id ASC', array( $limit, $perCycle ) ) as $friend )
{
if( $cutOff !== null AND time() >= $cutOff )
{
return ( $limit + $did );
}
$did++;
/* Follower */
$follower = array(
'follow_id' => md5( 'core;member;' . $friend['friends_friend_id'] . ';' . $friend['friends_member_id'] ),
'follow_app' => 'core',
'follow_area' => 'member',
'follow_rel_id' => $friend['friends_friend_id'],
'follow_member_id' => $friend['friends_member_id'],
'follow_is_anon' => 0,
'follow_added' => $friend['friends_added'],
'follow_notify_sent' => time(),
'follow_notify_do' => 1,
'follow_notify_meta' => '',
'follow_notify_freq' => 'immediate',
'follow_visible' => 1
);
\IPS\Db::i()->replace( 'core_follow', $follower );
}
if( $did )
{
return ( $limit + $did );
}
else
{
unset( $_SESSION['_step3Count'] );
\IPS\Db::i()->dropTable( 'profile_friends' );
return TRUE;
}
}
/**
* Custom title for this step
*
* @return string
*/
public function step3CustomTitle()
{
if ( $_SESSION['upgrade_options']['core']['100003']['follow_options'] == 'no_convert' )
{
return "Skipping friends to followers conversion";
}
if( \IPS\Db::i()->checkForTable('profile_friends') )
{
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
if( !isset( $_SESSION['_step3Count'] ) )
{
$_SESSION['_step3Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'profile_friends' )->first();
}
return "Converting friends to followers (Converted so far: " . ( ( $limit > $_SESSION['_step3Count'] ) ? $_SESSION['_step3Count'] : $limit ) . ' out of ' . $_SESSION['_step3Count'] . ')';
}
else
{
return "No friends to convert";
}
}
/**
* Step 4
* Fix advertisements
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step4()
{
if ( \IPS\Db::i()->select( 'COUNT(*)', 'core_advertisements', 'ad_active=1' )->first() )
{
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => 1 ), array( 'conf_key=?', 'ads_exist' ) );
unset( \IPS\Data\Store::i()->settings );
}
return true;
}
/**
* Custom title for this step
*
* @return string
*/
public function step4CustomTitle()
{
return "Setting advertisement statuses";
}
/**
* Step 5
* Clean up some misc stuff
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step5()
{
if( !\IPS\Db::i()->checkForColumn( 'core_member_ranks', 'icon' ) )
{
\IPS\Db::i()->addColumn( 'core_member_ranks', array(
"name" => "icon",
"type" => "TEXT",
"length" => 0,
'allow_null' => false,
"null" => false,
"default" => '',
) );
}
if( !\IPS\Db::i()->checkForColumn( 'core_member_ranks', 'use_icon' ) )
{
\IPS\Db::i()->addColumn( 'core_member_ranks', array(
"name" => "use_icon",
"type" => "TINYINT",
"length" => 1,
'allow_null' => false,
"null" => false,
"default" => 0,
) );
}
\IPS\Db::i()->update( 'core_member_ranks', "icon=pips, use_icon=1", "pips REGEXP('[A-Za-z]')" );
\IPS\Db::i()->update( 'core_member_ranks', array( 'pips' => null ), "use_icon=1" );
$memberCleanup = array();
if( \IPS\Db::i()->checkForColumn( 'core_members', 'fb_lastsync' ) )
{
$memberCleanup[] = "DROP COLUMN fb_lastsync";
}
if( \IPS\Db::i()->checkForColumn( 'core_members', 'title' ) )
{
$memberCleanup[] = "CHANGE COLUMN title member_title VARCHAR(64) null DEFAULT null";
}
if( \IPS\Db::i()->checkForColumn( 'core_members', 'posts' ) )
{
$memberCleanup[] = "CHANGE COLUMN posts member_posts MEDIUMINT(7) not null DEFAULT 0";
}
if( \IPS\Db::i()->checkForColumn( 'core_members', 'last_post' ) )
{
$memberCleanup[] = "CHANGE COLUMN last_post member_last_post INT(10) null DEFAULT null";
}
if( !\IPS\Db::i()->checkForIndex( 'core_members', 'ipsconnect_id' ) )
{
$memberCleanup[] = "ADD INDEX ipsconnect_id (ipsconnect_id)";
}
if( count( $memberCleanup ) )
{
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array( array(
'table' => 'core_members',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "core_members " . implode( ', ', $memberCleanup )
) ) );
if ( count( $toRun ) )
{
$mr = \IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 6 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => $mr ) ) ) );
}
}
return true;
}
/**
* Custom title for this step
*
* @return string
*/
public function step5CustomTitle()
{
return "Cleaning up member and member rank tables";
}
/* ! Conversation Participants */
/**
* Step 6
* Conversation Participants
*
* @return mixed If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step6()
{
$perCycle = 1000;
$did = 0;
$limit = intval( \IPS\Request::i()->extra );
/* Try to prevent timeouts to the extent possible */
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
foreach( \IPS\Db::i()->select( '*', 'core_message_topics', null, 'mt_id ASC', array( $limit, $perCycle ) ) as $row )
{
if( $cutOff !== null AND time() >= $cutOff )
{
return ( $limit + $did );
}
$did++;
try
{
$conversation = \IPS\core\Messenger\Conversation::constructFromData( $row );
$conversation->rebuildParticipants();
}
catch( \Exception $e ) {}
}
if( $did )
{
return ( $limit + $did );
}
else
{
unset( $_SESSION['_step6Count'] );
return TRUE;
}
}
/**
* Custom title for this step
*
* @return string
*/
public function step6CustomTitle()
{
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
if( !isset( $_SESSION['_step6Count'] ) )
{
$_SESSION['_step6Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'core_message_topics' )->first();
}
return "Rebuilding conversation participant data (Updated so far: " . ( ( $limit > $_SESSION['_step6Count'] ) ? $_SESSION['_step6Count'] : $limit ) . ' out of ' . $_SESSION['_step6Count'] . ')';
}
}
Whitespace-only changes.
@@ -0,0 +1,49 @@
<?php
/**
* @brief 4.0.0 Alpha 1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 25 Mar 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100004;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Alpha 1 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Fix stuff
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\Db::i()->delete( 'core_theme_templates', "template_added_to=0" );
\IPS\Db::i()->delete( 'core_theme_css', "css_added_to=0" );
return true;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Cleaning up templates";
}
}
Whitespace-only changes.
@@ -0,0 +1,91 @@
{
"1": {
"method": "addIndex",
"params": [
"core_theme_templates",
{
"type": "key",
"name": "template_app",
"columns": [
"template_app"
],
"length": [
null
]
}
]
},
"2": {
"method": "addIndex",
"params": [
"core_theme_css",
{
"type": "key",
"name": "css_app",
"columns": [
"css_app"
],
"length": [
null
]
}
]
},
"3": {
"method": "addIndex",
"params": [
"core_theme_images",
{
"type": "key",
"name": "image_app",
"columns": [
"image_app"
],
"length": [
null
]
}
]
},
"4": {
"method": "changeIndex",
"params": [
"core_theme_settings_fields",
"sc_set_id",
{
"type": "key",
"name": "sc_lookup",
"columns": [
"sc_set_id",
"sc_app"
],
"length": [
null,
null
]
}
]
},
"5": {
"method": "addIndex",
"params": [
"core_javascript",
{
"type": "key",
"name": "javascript_lookup",
"columns": [
"javascript_app",
"javascript_location",
"javascript_path",
"javascript_name"
],
"length": [
null,
null,
null,
null
]
}
]
}
}
@@ -0,0 +1,103 @@
<?php
/**
* @brief 4.0.0 Alpha 1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 25 Mar 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100005;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Alpha 1 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Fix stuff
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
if( !\IPS\Db::i()->checkForColumn( 'core_widgets', 'embeddable' ) )
{
\IPS\Db::i()->addColumn( 'core_widgets', array(
'name' => 'embeddable',
'type' => 'TINYINT',
'length' => 1,
'allow_null' => false,
'default' => '0',
'comment' => "Determines if Pages can embed this widget in a custom block.",
'unsigned' => true,
) );
}
if( !\IPS\Db::i()->checkForColumn( 'core_members', 'timezone' ) )
{
\IPS\Db::i()->addColumn( 'core_members', array(
'name' => 'timezone',
'type' => 'VARCHAR',
'length' => 64,
'allow_null' => true,
'default' => NULL,
) );
}
if( \IPS\Db::i()->checkForColumn( 'core_members', 'pp_profile_update' ) )
{
\IPS\Db::i()->dropColumn( 'core_members', 'pp_profile_update' );
}
if( !\IPS\Db::i()->checkForColumn( 'core_applications', 'app_hide_tab' ) )
{
\IPS\Db::i()->addColumn( 'core_applications', array(
'name' => 'app_hide_tab',
'type' => 'TINYINT',
'length' => 1,
'allow_null' => FALSE,
'default' => 0,
) );
}
return true;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Checking for missing columns";
}
/**
* Finish - This is run after all apps have been upgraded
*
* @return mixed If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
* @note We opted not to let users run this immediately during the upgrade because of potential issues (it taking a long time and users stopping it or getting frustrated) but we can revisit later
*/
public function finish()
{
if( !\IPS\Settings::i()->search_engine )
{
\IPS\Settings::i()->search_engine = 'mysql';
}
\IPS\Content\Search\Index::i()->rebuild();
return true;
}
}
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,38 @@
{
"1": {
"method": "addColumn",
"params": [
"core_queue",
{
"name": "priority",
"type": "TINYINT",
"length": "1",
"allow_null": false,
"default": "5",
"comment": "Order to run. Values 1 to 5 are allowed, 1 being highest priority.",
"unsigned": true,
"zerofill": null,
"auto_increment": null,
"binary": null
}
]
},
"2": {
"method": "addColumn",
"params": [
"core_tasks",
{
"name": "lock_count",
"type": "TINYINT",
"length": "1",
"allow_null": false,
"default": "0",
"comment": "How many times the task has been in a locked state without a successful run. A count of 3 will trigger a dashboard warning.",
"unsigned": true,
"zerofill": null,
"auto_increment": null,
"binary": null
}
]
}
}
@@ -0,0 +1,53 @@
<?php
/**
* @brief 4.0.0 Beta 5 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 08 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100008;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Beta 5 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Build Search index
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
if( !\IPS\Settings::i()->search_engine )
{
\IPS\Settings::i()->search_engine = 'mysql';
}
\IPS\Content\Search\Index::i()->rebuild();
return true;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Building Search index";
}
}
Whitespace-only changes.
@@ -0,0 +1,23 @@
{
"1": {
"method": "changeColumn",
"params": [
"core_javascript",
"javascript_plugin",
{
"name": "javascript_plugin",
"type": "VARCHAR",
"length": 100,
"decimals": null,
"values": [],
"allow_null": true,
"default": "",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
Whitespace-only changes.
@@ -0,0 +1,374 @@
{
"1": {
"method": "addColumn",
"params": [
"core_theme_settings_fields",
{
"name": "sc_order",
"type": "INT",
"length": 10,
"decimals": null,
"values": [],
"allow_null": false,
"default": null,
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "addColumn",
"params": [
"core_sys_lang_words",
{
"name": "word_theme",
"type": "INT",
"length": 10,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "The theme ID, if the language string belongs to a theme.",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"3": {
"method": "changeColumn",
"params": [
"core_themes",
"set_image_map",
{
"name": "set_resource_map",
"type": "MEDIUMTEXT",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"4": {
"method": "addColumn",
"params": [
"core_rc_reports",
{
"name": "ip_address",
"type": "VARCHAR",
"length": 46,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "The IP address of the user reporting the content",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"5": {
"method": "createTable",
"params": [
{
"name": "core_file_logs",
"columns": {
"log_id": {
"allow_null": false,
"auto_increment": true,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 20,
"name": "log_id",
"type": "BIGINT",
"unsigned": false,
"values": [],
"zerofill": false
},
"log_type": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 0,
"name": "log_type",
"type": "ENUM",
"unsigned": false,
"values": [
"log",
"copy",
"error",
"move"
],
"zerofill": false
},
"log_action": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 0,
"name": "log_action",
"type": "ENUM",
"unsigned": false,
"values": [
"move",
"copy",
"delete",
"save"
],
"zerofill": false
},
"log_configuration_id": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "log_configuration_id",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"log_method": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "",
"length": 255,
"name": "log_method",
"type": "VARCHAR",
"unsigned": false,
"values": [],
"zerofill": false
},
"log_filename": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 0,
"name": "log_filename",
"type": "TEXT",
"unsigned": false,
"values": [],
"zerofill": false
},
"log_msg": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 0,
"name": "log_msg",
"type": "TEXT",
"unsigned": false,
"values": [],
"zerofill": false
},
"log_date": {
"allow_null": false,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": "0",
"length": 10,
"name": "log_date",
"type": "INT",
"unsigned": false,
"values": [],
"zerofill": false
},
"log_data": {
"allow_null": true,
"auto_increment": false,
"binary": false,
"comment": "",
"decimals": null,
"default": null,
"length": 0,
"name": "log_data",
"type": "TEXT",
"unsigned": false,
"values": [],
"zerofill": false
},
"log_container": {
"name": "log_container",
"type": "VARCHAR",
"length": 255,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"log_url": {
"name": "log_url",
"type": "TEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
},
"indexes": {
"PRIMARY": {
"type": "primary",
"name": "PRIMARY",
"length": [
null
],
"columns": [
"log_id"
]
},
"log_date": {
"type": "key",
"name": "log_date",
"length": [
null
],
"columns": [
"log_date"
]
},
"log_type": {
"type": "key",
"name": "log_type",
"length": [
null
],
"columns": [
"log_type"
]
},
"log_action": {
"type": "key",
"name": "log_action",
"length": [
null
],
"columns": [
"log_action"
]
},
"log_method": {
"type": "key",
"name": "log_method",
"length": [
null
],
"columns": [
"log_method"
]
}
},
"collation": "utf8_unicode_ci",
"engine": "InnoDB"
}
]
},
"6": {
"method": "changeColumn",
"params": [
"core_mail_error_logs",
"mlog_msg",
{
"name": "mlog_msg",
"type": "MEDIUMTEXT",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"7": {
"method": "changeColumn",
"params": [
"core_mail_error_logs",
"mlog_smtp_log",
{
"name": "mlog_smtp_log",
"type": "MEDIUMTEXT",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"8": {
"method": "changeColumn",
"params": [
"core_search_index",
"index_permissions",
{
"name": "index_permissions",
"type": "VARCHAR",
"length": 255,
"decimals": null,
"values": [],
"allow_null": false,
"default": "*",
"comment": "A comma-delimited list of groups which have permission to view",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,180 @@
<?php
/**
* @brief 4.0.0 Beta 6 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 15 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100010;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Beta 6 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Convert core_theme_images into core_theme_resources
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
$columns = array ( 'resource_id' => array ( 'allow_null' => false, 'auto_increment' => true, 'binary' => false, 'comment' => '', 'decimals' => NULL, 'default' => NULL, 'length' => 10, 'name' => 'resource_id', 'type' => 'INT', 'unsigned' => false, 'values' => array ( ), 'zerofill' => false, ), 'resource_set_id' => array ( 'allow_null' => false, 'auto_increment' => false, 'binary' => false, 'comment' => '', 'decimals' => NULL, 'default' => '0', 'length' => 10, 'name' => 'resource_set_id', 'type' => 'INT', 'unsigned' => false, 'values' => array ( ), 'zerofill' => false, ), 'resource_app' => array ( 'allow_null' => false, 'auto_increment' => false, 'binary' => false, 'comment' => '', 'decimals' => NULL, 'default' => '', 'length' => 32, 'name' => 'resource_app', 'type' => 'VARCHAR', 'unsigned' => false, 'values' => array ( ), 'zerofill' => false, ), 'resource_location' => array ( 'allow_null' => false, 'auto_increment' => false, 'binary' => false, 'comment' => '', 'decimals' => NULL, 'default' => '', 'length' => 32, 'name' => 'resource_location', 'type' => 'VARCHAR', 'unsigned' => false, 'values' => array ( ), 'zerofill' => false, ), 'resource_path' => array ( 'allow_null' => false, 'auto_increment' => false, 'binary' => false, 'comment' => '', 'decimals' => NULL, 'default' => '', 'length' => 255, 'name' => 'resource_path', 'type' => 'VARCHAR', 'unsigned' => false, 'values' => array ( ), 'zerofill' => false, ), 'resource_name' => array ( 'allow_null' => false, 'auto_increment' => false, 'binary' => false, 'comment' => '', 'decimals' => NULL, 'default' => '', 'length' => 255, 'name' => 'resource_name', 'type' => 'VARCHAR', 'unsigned' => false, 'values' => array ( ), 'zerofill' => false, ), 'resource_added' => array ( 'allow_null' => false, 'auto_increment' => false, 'binary' => false, 'comment' => '', 'decimals' => NULL, 'default' => '0', 'length' => 10, 'name' => 'resource_added', 'type' => 'INT', 'unsigned' => false, 'values' => array ( ), 'zerofill' => false, ), 'resource_filename' => array ( 'allow_null' => true, 'auto_increment' => false, 'binary' => false, 'comment' => 'File object URI', 'decimals' => NULL, 'default' => NULL, 'length' => 255, 'name' => 'resource_filename', 'type' => 'VARCHAR', 'unsigned' => false, 'values' => array ( ), 'zerofill' => false, ), 'resource_plugin' => array ( 'allow_null' => true, 'auto_increment' => false, 'binary' => false, 'comment' => 'The plugin ID, if created by a plugin', 'decimals' => NULL, 'default' => NULL, 'length' => 20, 'name' => 'resource_plugin', 'type' => 'BIGINT', 'unsigned' => true, 'values' => array ( ), 'zerofill' => false, ), 'resource_data' => array ( 'allow_null' => true, 'auto_increment' => false, 'binary' => false, 'comment' => 'Stores the resource data so the resources can be re-written if the file object is lost', 'decimals' => NULL, 'default' => NULL, 'length' => 0, 'name' => 'resource_data', 'type' => 'MEDIUMBLOB', 'unsigned' => false, 'values' => array ( ), 'zerofill' => false, ), );
$mappedColumns = array();
foreach ( $columns as $columnName => $data )
{
$mappedColumns[] = '`image_' . mb_substr( $columnName, 9 ) . '` AS `' . $columnName . '`';
}
/* @link http://community.invisionpower.com/4bugtrack/beta7-upgrade-failure-core_theme_resources-r2361/ */
if( !\IPS\Db::i()->checkForTable( 'core_theme_resources' ) )
{
\IPS\Db::i()->createTable( array ( 'name' => 'core_theme_resources', 'columns' => $columns, 'indexes' => array ( 'PRIMARY' => array ( 'type' => 'primary', 'name' => 'PRIMARY', 'length' => array ( 0 => NULL, ), 'columns' => array ( 0 => 'resource_id', ), ), 'resource_set_id' => array ( 'type' => 'key', 'name' => 'resource_set_id', 'length' => array ( 0 => NULL, ), 'columns' => array ( 0 => 'resource_set_id', ), ), 'resource_app' => array ( 'type' => 'key', 'name' => 'resource_app', 'length' => array ( 0 => NULL, ), 'columns' => array ( 0 => 'resource_app', ), ), ), 'collation' => 'utf8mb4_unicode_ci', 'engine' => 'InnoDB', ) );
}
else
{
\IPS\Db::i()->delete( 'core_theme_resources' );
}
\IPS\Db::i()->insert( 'core_theme_resources', \IPS\Db::i()->select( $mappedColumns, 'core_theme_images' ) );
\IPS\Db::i()->dropTable( 'core_theme_images' );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Fixing images table";
}
/**
* Step 2
* Fix references to {image=...} in templates (including emails)
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
\IPS\Db::i()->update( 'core_theme_templates', "template_content=REPLACE(template_content, '{image=', '{resource=' )" );
\IPS\Db::i()->update( 'core_theme_css', "css_content=REPLACE(css_content, '{image=', '{resource=' )" );
\IPS\Db::i()->update( 'core_email_templates', "template_content_html=REPLACE(template_content_html, '{image=', '{resource=' ), template_content_plaintext=REPLACE(template_content_plaintext, '{image=', '{resource=' )" );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Converting image plugin to resource plugin";
}
/**
* Step 3
* Upgrade tags... if we haven't already done so in upg_40000.
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step3()
{
if ( isset( $_SESSION['_tagsUpgraded'] ) )
{
return TRUE;
}
$did = 0;
$perCycle = 500;
$limit = 0;
if ( isset( \IPS\Request::i()->extra ) )
{
$limit = (int) \IPS\Request::i()->extra;
}
/* We need to loop through all tags and fix up tag_aai_lookup as the area has changed. Normally we could just use MySQL MD5, but we need to update core_tags_perms too... */
foreach( \IPS\Db::i()->select( '*', 'core_tags', NULL, 'tag_id ASC', array( $limit, $perCycle ) ) AS $row )
{
$did++;
switch( $row['tag_meta_area'] )
{
case 'topics':
$row['tag_meta_area'] = 'forums';
break;
case 'files':
$row['tag_meta_area'] = 'downloads';
break;
case 'images':
$row['tag_meta_area'] = 'gallery';
break;
case 'entries':
$row['tag_meta_area'] = 'blogs';
break;
}
$oldAaiLookup = $row['tag_aai_lookup'];
$row['tag_aai_lookup'] = md5( $row['tag_meta_app'] . ';' . $row['tag_meta_area'] . ';' . $row['tag_meta_id'] );
\IPS\Db::i()->update( 'core_tags_perms', array( 'tag_perm_aai_lookup' => $row['tag_aai_lookup'] ), array( 'tag_perm_aai_lookup=?', $oldAaiLookup ) );
\IPS\Db::i()->update( 'core_tags', $row, array( 'tag_id=?', $row['tag_id'] ) );
\IPS\Db::i()->update( 'core_tags_cache', array( 'tag_cache_key' => $row['tag_aai_lookup'] ), array( 'tag_cache_key=?', $oldAaiLookup ) );
}
if ( $did )
{
return ( $limit + $did );
}
else
{
/* Unset the count, and set a flag in the session so we do not do this again in Beta 6. */
unset( $_SESSION['_step4Count'] );
$_SESSION['_tagsUpgraded'] = TRUE;
return TRUE;
}
}
/**
* Custom title for this step
* @return string
*/
public function step3CustomTitle()
{
if ( isset( $_SESSION['_tagsUpgraded'] ) )
{
return "Tags already upgraded - skipping this step.";
}
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
if( !isset( $_SESSION['_step4Count'] ) )
{
$_SESSION['_step4Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'core_tags' )->first();
}
return "Upgrading tags (Upgraded so far: " . ( ( $limit > $_SESSION['_step4Count'] ) ? $_SESSION['_step4Count'] : $limit ) . ' out of ' . $_SESSION['_step4Count'] . ')';
}
}
Whitespace-only changes.
@@ -0,0 +1,41 @@
{
"1": {
"method": "changeIndex",
"params": [
"core_theme_settings_fields",
"replace_key",
{
"type": "unique",
"name": "replace_key",
"columns": [
"sc_set_id",
"sc_key",
"sc_app"
],
"length": [
null,
null,
null
]
}
]
},
"2": {
"method": "addIndex",
"params": [
"core_notifications",
{
"type": "key",
"name": "member_sort",
"columns": [
"member",
"updated_time"
],
"length": [
null,
null
]
}
]
}
}
@@ -0,0 +1,66 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 15 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100011;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Beta 6 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Fix IPS Connect Slave Count
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => \IPS\Db::i()->select( 'COUNT(*)', 'core_ipsconnect_slaves' )->first() ), array( 'conf_key=?', 'connect_slaves' ) );
unset( \IPS\Data\Store::i()->settings );
return TRUE;
}
/**
* Step 2
* Fix the imported ipb3 words ( http://community.invisionpower.com/4bugtrack/beta-6-still-deleting-inactive-members-r2074/ )
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
$existingApplications = array_keys( \IPS\Application::applications() );
\IPS\Db::i()->delete( 'core_sys_lang_words', 'word_plugin <> NULL AND ' . \IPS\Db::i()->in( 'word_app', $existingApplications, TRUE ) );
return TRUE;
}
/**
* Step 3
* Remove search cleanup task
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step3()
{
\IPS\Db::i()->delete('core_tasks', array('`key`=? and app=?', 'searchcleanup', 'core' ) );
return TRUE;
}
}
Whitespace-only changes.
@@ -0,0 +1,36 @@
{
"1": {
"method": "addColumn",
"params": [
"core_theme_resources",
{
"name": "resource_user_edited",
"type": "TINYINT",
"length": 1,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "dropColumn",
"params": [
"core_modules",
"sys_module_version"
]
},
"3": {
"method": "dropColumn",
"params": [
"core_modules",
"sys_module_description"
]
}
}
Whitespace-only changes.
@@ -0,0 +1,41 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 15 Jan 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100015;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 RC 2 Upgrade Code
*/
class _Upgrade
{
/**
* Finish - This is run after all apps have been upgraded
*
* @return mixed If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
* @note We opted not to let users run this immediately during the upgrade because of potential issues (it taking a long time and users stopping it or getting frustrated) but we can revisit later
*/
public function finish()
{
/* Unprotect Forums app, otherwise it cannot be turned offline post-upgrade */
\IPS\Db::i()->update( 'core_applications', array( 'app_protected' => 0 ), array( 'app_directory=?', 'forums' ) );
/* Rebuild content to update counts */
\IPS\Task::queue( 'core', 'RebuildItems', array( 'class' => 'IPS\core\Statuses\Status' ), 3, array( 'class' ) );
\IPS\Task::queue( 'core', 'RebuildItemCounts', array( 'class' => 'IPS\core\Statuses\Status', 'count' => 0 ), 4, array( 'class' ) );
}
}
Whitespace-only changes.
@@ -0,0 +1,45 @@
{
"1": {
"method": "dropIndex",
"params": [
"core_members_warn_logs",
"content"
]
},
"2": {
"method": "addIndex",
"params": [
"core_members_warn_logs",
{
"type": "key",
"name": "content",
"columns": [
"wl_content_app",
"wl_content_module",
"wl_content_id1",
"wl_content_id2"
],
"length": [
null,
null,
null,
null
]
}
]
},
"3": {
"method": "dropColumn",
"params": [
"core_pfields_data",
"pf_icon"
]
},
"4": {
"method": "dropColumn",
"params": [
"core_pfields_data",
"pf_key"
]
}
}
@@ -0,0 +1,57 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 24 Feb 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100016;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 RC 3 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Convert question & answer
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
foreach( \IPS\Db::i()->select( 'qa_id, qa_answers', 'core_question_and_answer' ) as $qa )
{
if ( is_array( json_decode( $qa['qa_answers'], TRUE ) ) )
{
continue;
}
$answers = explode( "\n", \str_replace( "\r", "", $qa['qa_answers'] ) );
\IPS\Db::i()->update( 'core_question_and_answer', array( 'qa_answers' => json_encode( $answers ) ), array( 'qa_id=?', $qa['qa_id'] ) );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Updating Question & Answer";
}
}
Whitespace-only changes.
@@ -0,0 +1,70 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 25 Feb 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100017;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 RC 4 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Fix furl definitions while retaining custom ones
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
/* We want to retain customizations, but ONLY customizations in the "Settings" furl configuration */
$furlDefinitions = json_decode( \IPS\Settings::i()->furl_configuration, TRUE );
$defaultConfig = \IPS\Http\Url::furlDefinition( TRUE );
$customDefinitions = array();
if( is_array( $furlDefinitions ) AND count( $furlDefinitions ) )
{
foreach( $furlDefinitions as $k => $v )
{
if( $v['friendly'] != $defaultConfig[ $k ]['friendly'] )
{
$customDefinitions[ $k ] = array(
'friendly' => $v['friendly'],
'real' => $v['real'],
'custom' => true
);
}
}
}
$customDefinitions = count( $customDefinitions ) ? json_encode( $customDefinitions ) : NULL;
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => $customDefinitions ), array( 'conf_key=?', 'furl_configuration' ) );
unset( \IPS\Data\Store::i()->settings );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Updating FURL definitions";
}
}
Whitespace-only changes.
@@ -0,0 +1,364 @@
{
"1": {
"method": "addIndex",
"params": [
"core_search_index",
{
"type": "key",
"name": "item",
"columns": [
"index_class",
"index_item_id"
],
"length": [
250,
null
]
}
]
},
"2": {
"method": "changeIndex",
"params": [
"core_message_topic_user_map",
"map_user",
{
"type": "key",
"name": "map_user",
"columns": [
"map_user_id",
"map_user_active",
"map_folder_id",
"map_last_topic_reply"
],
"length": [
null,
null,
null,
null
]
}
]
},
"3": {
"method": "addIndex",
"params": [
"core_widgets",
{
"type": "key",
"name": "widget_app",
"columns": [
"app"
],
"length": [
250
]
}
]
},
"4": {
"method": "addIndex",
"params": [
"core_widgets",
{
"type": "key",
"name": "widget_plugin",
"columns": [
"plugin"
],
"length": [
250
]
}
]
},
"5": {
"method": "addIndex",
"params": [
"core_attachments_map",
{
"type": "key",
"name": "map_lookup",
"columns": [
"location_key",
"id1"
],
"length": [
250,
null
]
}
]
},
"6": {
"method": "addIndex",
"params": [
"core_attachments_map",
{
"type": "key",
"name": "attachment_id",
"columns": [
"attachment_id"
],
"length": [
null
]
}
]
},
"7": {
"method": "addIndex",
"params": [
"core_notifications",
{
"type": "key",
"name": "item_lookup",
"columns": [
"item_class",
"item_id"
],
"length": [
null,
null
]
}
]
},
"8": {
"method": "addIndex",
"params": [
"core_search_index",
{
"type": "key",
"name": "container",
"columns": [
"index_class",
"index_container_id"
],
"length": [
250,
null
]
}
]
},
"9": {
"method": "addIndex",
"params": [
"core_notification_defaults",
{
"type": "key",
"name": "notification_key",
"columns": [
"notification_key"
],
"length": [
null
]
}
]
},
"10": {
"method": "dropIndex",
"params": [
"core_notification_defaults",
"notification_key"
]
},
"11": {
"method": "addIndex",
"params": [
"core_notifications",
{
"type": "key",
"name": "member_read",
"columns": [
"member",
"read_time"
],
"length": [
null,
null
]
}
]
},
"12": {
"method": "addIndex",
"params": [
"core_theme_settings_values",
{
"type": "key",
"name": "sv_id",
"columns": [
"sv_id"
],
"length": [
null
]
}
]
},
"13": {
"method": "addIndex",
"params": [
"core_hooks",
{
"type": "key",
"name": "plugin",
"columns": [
"plugin"
],
"length": [
null
]
}
]
},
"14": {
"method": "addIndex",
"params": [
"core_hooks",
{
"type": "key",
"name": "app",
"columns": [
"app"
],
"length": [
250
]
}
]
},
"15": {
"method": "addIndex",
"params": [
"core_acp_search_index",
{
"type": "key",
"name": "app",
"columns": [
"app"
],
"length": [
250
]
}
]
},
"16": {
"method": "addIndex",
"params": [
"core_admin_permission_rows",
{
"type": "key",
"name": "row_id_type",
"columns": [
"row_id_type"
],
"length": [
null
]
}
]
},
"17": {
"method": "addIndex",
"params": [
"core_tasks",
{
"type": "key",
"name": "lock_count",
"columns": [
"lock_count"
],
"length": [
null
]
}
]
},
"18": {
"method": "addIndex",
"params": [
"core_files_temp",
{
"type": "key",
"name": "upload_key",
"columns": [
"upload_key"
],
"length": [
null
]
}
]
},
"19": {
"method": "addIndex",
"params": [
"core_leaders",
{
"type": "key",
"name": "leader_group_id",
"columns": [
"leader_group_id"
],
"length": [
null
]
}
]
},
"20": {
"method": "addIndex",
"params": [
"core_profanity_filters",
{
"type": "key",
"name": "m_exact",
"columns": [
"m_exact"
],
"length": [
null
]
}
]
},
"21": {
"method": "addIndex",
"params": [
"core_attachments_map",
{
"type": "key",
"name": "temp_key",
"columns": [
"temp"
],
"length": [
null
]
}
]
},
"22": {
"method": "addIndex",
"params": [
"core_queue",
{
"type": "key",
"name": "task_lookup",
"columns": [
"app",
"key"
],
"length": [
null,
null
]
}
]
}
}
@@ -0,0 +1,135 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 5 Mar 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100018;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 RC 5 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Rebuild reputation received
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\Task::queue( 'core', 'RebuildReputationIndex', array( 'class' => 'IPS\core\Statuses\Status' ), 4 );
\IPS\Task::queue( 'core', 'RebuildReputationIndex', array( 'class' => 'IPS\core\Statuses\Reply' ), 4 );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Updating reputation received";
}
/**
* Step 2
* Rebuild search index
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
if( !\IPS\Settings::i()->search_engine )
{
\IPS\Settings::i()->search_engine = 'mysql';
}
\IPS\Content\Search\Index::i()->rebuild();
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Building Search index";
}
/**
* Step 3
* Clean up guest followers
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step3()
{
\IPS\Db::i()->delete( 'core_follow', array( 'follow_member_id=?', 0 ) );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step3CustomTitle()
{
return "Clean up guest followers";
}
/**
* Step 4
* Fix broken attachments map
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step4()
{
if( \IPS\Db::i()->select( 'count(*)', 'core_attachments_map', "location_key=1" ) )
{
foreach ( \IPS\Content::routedClasses( FALSE, TRUE ) as $class )
{
try
{
\IPS\Task::queue( 'core', 'RestoreBrokenAttachments', array( 'class' => $class ), 3 );
}
catch( \OutOfRangeException $ex ) { }
}
\IPS\Db::i()->delete( 'core_attachments_map', "location_key=1" );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step4CustomTitle()
{
return "Fixing broken attachment maps";
}
}
Whitespace-only changes.
@@ -0,0 +1,155 @@
{
"1": {
"method": "addIndex",
"params": [
"core_tasks",
{
"type": "key",
"name": "app",
"columns": [
"app"
],
"length": [
250
]
}
]
},
"2": {
"method": "addIndex",
"params": [
"core_email_templates",
{
"type": "key",
"name": "template_app",
"columns": [
"template_app"
],
"length": [
250
]
}
]
},
"3": {
"method": "addIndex",
"params": [
"core_pfields_data",
{
"type": "key",
"name": "public_fields",
"columns": [
"pf_admin_only"
],
"length": [
null
]
}
]
},
"4": {
"method": "addIndex",
"params": [
"core_search_index",
{
"type": "key",
"name": "member_activity",
"columns": [
"index_author",
"index_class",
"index_permissions",
"index_date_created"
],
"length": [
null,
250,
250,
null
]
}
]
},
"5": {
"method": "dropIndex",
"params": [
"core_search_index",
"member_activity"
]
},
"6": {
"method": "addIndex",
"params": [
"core_member_status_updates",
{
"type": "key",
"name": "ip_lookup",
"columns": [
"status_author_ip"
],
"length": [
null
]
}
]
},
"7": {
"method": "addIndex",
"params": [
"core_member_status_replies",
{
"type": "key",
"name": "ip_lookup",
"columns": [
"reply_ip_address"
],
"length": [
null
]
}
]
},
"8": {
"method": "update",
"params": [
"core_login_handlers",
"login_key=CONCAT( UPPER( SUBSTRING( login_key, 1, 1 ) ), SUBSTR( login_key, 2 ) )"
]
},
"9": {
"method": "addIndex",
"params": [
"core_queue",
{
"type": "key",
"name": "queue_key",
"columns": [
"key"
],
"length": [
null
]
}
]
},
"10": {
"method": "changeColumn",
"params": [
"core_moderator_logs",
"lang_key",
{
"name": "lang_key",
"type": "TEXT",
"length": 255,
"decimals": null,
"values": [],
"allow_null": false,
"default": "",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,70 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 17 Mar 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100020;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 RC 6 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Db Cleanup
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\Db::i()->dropTable( 'search_sessions', TRUE );
\IPS\Db::i()->dropTable( 'inline_notifications', TRUE );
\IPS\Db::i()->dropTable( 'api_log', TRUE );
\IPS\Db::i()->dropTable( 'api_users', TRUE );
/* We try to drop core_spider_logs in 100003 but otherwise missed this table */
\IPS\Db::i()->dropTable( 'spider_logs', TRUE );
/* This looks odd, but we handled members_warn_logs in 4.0 already - this is an old old table */
\IPS\Db::i()->dropTable( 'warn_logs', TRUE );
/* This wasn't dropped in the 4.0 routine */
\IPS\Db::i()->dropTable( 'moderators', TRUE );
\IPS\Db::i()->dropTable( 'skin_cache', TRUE );
\IPS\Db::i()->dropTable( 'skin_generator_sessions', TRUE );
\IPS\Db::i()->dropTable( 'skin_merge_changes', TRUE );
\IPS\Db::i()->dropTable( 'skin_merge_session', TRUE );
\IPS\Db::i()->dropTable( 'skin_replacements', TRUE );
\IPS\Db::i()->dropTable( 'skin_templates_cache', TRUE );
\IPS\Db::i()->dropTable( 'skin_templates_previous', TRUE );
\IPS\Db::i()->dropTable( 'skin_url_mapping', TRUE );
\IPS\Db::i()->dropTable( 'skin_css_previous', TRUE );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Cleaning up database";
}
}
Whitespace-only changes.
@@ -0,0 +1,128 @@
{
"1": {
"method": "changeColumn",
"params": [
"core_sys_cp_sessions",
"session_app_data",
{
"name": "session_app_data",
"type": "BLOB",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "changeColumn",
"params": [
"core_sessions",
"data",
{
"name": "data",
"type": "BLOB",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"3": {
"method": "createTable",
"params": [
{
"name": "core_sitemap",
"columns": {
"data": {
"name": "data",
"type": "MEDIUMTEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": false,
"default": null,
"comment": "The sitemap XML",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"updated": {
"name": "updated",
"type": "INT",
"length": 10,
"decimals": null,
"values": [],
"allow_null": false,
"default": null,
"comment": "Unix timestamp of last update",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"sitemap": {
"name": "sitemap",
"type": "VARCHAR",
"length": 255,
"decimals": null,
"values": [],
"allow_null": false,
"default": null,
"comment": "The sitemap key",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
},
"indexes": {
"PRIMARY": {
"type": "primary",
"name": "PRIMARY",
"columns": [
"sitemap"
],
"length": [
250
]
}
}
}
]
},
"4": {
"method": "addColumn",
"params": [
"core_notifications",
{
"name": "extra",
"type": "TEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "JSON-encoded additional data",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,86 @@
<?php
/**
* @brief 4.0.0 RC7 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 20 Mar 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100021;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 RC7 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Conversation Notifications
*
* @return mixed If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
$perCycle = 1000;
$did = 0;
$limit = intval( \IPS\Request::i()->extra );
/* Try to prevent timeouts to the extent possible */
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
foreach( \IPS\Db::i()->select( '*', 'core_notifications', array( 'notification_key = ?', 'new_private_message' ), 'id ASC', array( $limit, $perCycle ) ) as $row )
{
if( $cutOff !== null AND time() >= $cutOff )
{
return ( $limit + $did );
}
$did++;
try
{
$message = \IPS\core\Messenger\Message::load( $row['item_sub_id'] );
$conversation = $message->item();
\IPS\Db::i()->update( 'core_notifications', array( 'item_class' => 'IPS\core\Messenger\Conversation', 'item_id' => $conversation->id ), array( 'id=?', $row['id'] ) );
}
catch( \Exception $e ) {}
}
if( $did )
{
return ( $limit + $did );
}
else
{
unset( $_SESSION['_step1Count'] );
return TRUE;
}
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
if( !isset( $_SESSION['_step1Count'] ) )
{
$_SESSION['_step1Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'core_notifications', array( 'notification_key = ?', 'new_private_message' ) )->first();
}
return "Rebuilding message notifications (Updated so far: " . ( ( $limit > $_SESSION['_step1Count'] ) ? $_SESSION['_step1Count'] : $limit ) . ' out of ' . $_SESSION['_step1Count'] . ')';
}
}
Whitespace-only changes.
@@ -0,0 +1,51 @@
<?php
/**
* @brief 4.0.0 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 3 Apr 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100023;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.0 Upgrade Code
*/
class _Upgrade
{
/**
* Step 1
* Fix emoticon codes
*
* @return mixed If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
foreach( \IPS\Db::i()->select( '*', 'core_emoticons' ) as $emoticon )
{
\IPS\Db::i()->update( 'core_emoticons', array( 'typed' => html_entity_decode( $emoticon['typed'], ENT_QUOTES, 'UTF-8' ) ), array( 'id=?', $emoticon['id'] ) );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Fixing emoticons";
}
}
Whitespace-only changes.
@@ -0,0 +1,129 @@
{
"1": {
"method": "changeColumn",
"params": [
"core_theme_settings_values",
"sv_value",
{
"name": "sv_value",
"type": "TEXT",
"length": 255,
"decimals": null,
"values": [],
"allow_null": true,
"default": "",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "changeColumn",
"params": [
"core_theme_settings_fields",
"sc_default",
{
"name": "sc_default",
"type": "TEXT",
"length": 255,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"3": {
"method": "addIndex",
"params": [
"core_search_index",
{
"type": "key",
"name": "index_date_updated",
"columns": [
"index_date_updated"
],
"length": [
null
]
}
]
},
"4": {
"method": "createTable",
"params": [
{
"name": "core_acp_tab_order",
"columns": {
"id": {
"name": "id",
"type": "BIGINT",
"length": "20",
"unsigned": true,
"zerofill": false,
"binary": false,
"allow_null": false,
"default": null,
"auto_increment": true,
"comment": "ID Number"
},
"data": {
"name": "data",
"type": "MEDIUMTEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
},
"indexes": {
"PRIMARY": {
"type": "primary",
"name": "PRIMARY",
"columns": [
"id"
],
"length": [
null
]
}
}
}
]
},
"5": {
"method": "changeColumn",
"params": [
"core_sessions",
"browser",
{
"name": "browser",
"type": "VARCHAR",
"length": 255,
"decimals": null,
"values": [],
"allow_null": false,
"default": "",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,49 @@
<?php
/**
* @brief 4.0.1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 10 Apr 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100024;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.1 Upgrade Code
*/
class _Upgrade
{
/**
* Fix {blank} settings
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
* @see http://community.invisionpower.com/4bugtrack/settings-value-blank-r4972/
*/
public function step1()
{
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => '' ), array( 'conf_value=?', '{blank}' ) );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Fixing old settings";
}
}
@@ -0,0 +1,43 @@
{
"1": {
"method": "changeColumn",
"params": [
"core_advertisements",
"ad_location",
{
"name": "ad_location",
"type": "TEXT",
"length": 255,
"decimals": null,
"values": [],
"allow_null": false,
"default": "",
"comment": "Stores the location for the advertisement to display",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "addColumn",
"params": [
"core_emoticons",
{
"name": "emo_set_position",
"type": "INT",
"length": 10,
"decimals": null,
"values": [],
"allow_null": false,
"default": "1",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,23 @@
{
"1": {
"method": "changeColumn",
"params": [
"core_sessions",
"browser",
{
"name": "browser",
"type": "TEXT",
"length": 255,
"decimals": null,
"values": [],
"allow_null": false,
"default": "",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,89 @@
<?php
/**
* @brief 4.0.5 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 27 Apr 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100028;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.5 Upgrade Code
*/
class _Upgrade
{
/**
* Make sure all theme settings are applied to every theme.
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function finish()
{
/* We need to kick off some upgrade changes if we're upgrading from the first release of 4.0.0 */
if ( \IPS\Application::load('core')->long_version >= 40000 )
{
/* Update all FileSystem configs */
foreach ( \IPS\Db::i()->select( '*', 'core_file_storage', array( 'method=?', 'FileSystem' ) ) as $row )
{
$config = json_decode( $row['configuration'], TRUE );
$configProtocolRelative = preg_replace( '#^http(s)?://#', '//', $config['url'] );
$baseProtocolRelative = preg_replace( '#^http(s)?://#', '//', \IPS\Settings::i()->base_url );
$url = NULL;
$customUrl = NULL;
if ( mb_stristr( $configProtocolRelative, $baseProtocolRelative ) )
{
$url = trim( str_replace( $baseProtocolRelative, '', $configProtocolRelative ), '/' );
}
else if ( mb_substr( $config['url'], 0, 2 ) === '//' OR mb_substr( $config['url'], 0, 4 ) === 'http' )
{
$customUrl = $config['url'];
}
$save = array(
'configuration' => array(
'dir' => str_replace( \IPS\ROOT_PATH, '{root}', $config['dir'] ),
'url' => $url,
'custom_url' => $customUrl
) );
$save['configuration'] = json_encode( $save['configuration'] );
\IPS\Db::i()->update( 'core_file_storage', $save, array( 'id=?', $row['id'] ) );
}
unset( \IPS\Data\Store::i()->storageConfigurations );
}
/* Unset emoticons cache */
if ( isset( \IPS\Data\Store::i()->emoticons ) )
{
unset( \IPS\Data\Store::i()->emoticons );
}
/* Kick off the tasks */
\IPS\core\Setup\Upgrade::repairFileUrls('core');
\IPS\Task::queue( 'core', 'RebuildContentImages', array( 'class' => 'IPS\core\Statuses\Status' ), 3, array( 'class' ) );
\IPS\Task::queue( 'core', 'RebuildContentImages', array( 'class' => 'IPS\core\Statuses\Reply' ), 3, array( 'class' ) );
\IPS\Task::queue( 'core', 'RebuildNonContentImages', array( 'extension' => 'core_Admin' ), 3, array( 'extension' ) );
\IPS\Task::queue( 'core', 'RebuildNonContentImages', array( 'extension' => 'core_Announcement' ), 3, array( 'extension' ) );
\IPS\Task::queue( 'core', 'RebuildNonContentImages', array( 'extension' => 'core_CustomField' ), 3, array( 'extension' ) );
\IPS\Task::queue( 'core', 'RebuildNonContentImages', array( 'extension' => 'core_Signatures' ), 3, array( 'extension' ) );
\IPS\Task::queue( 'core', 'RebuildNonContentImages', array( 'extension' => 'core_Staffdirectory' ), 3, array( 'extension' ) );
return TRUE;
}
}
@@ -0,0 +1,23 @@
{
"1": {
"method": "changeColumn",
"params": [
"core_theme_css",
"css_user_edited",
{
"name": "css_user_edited",
"type": "INT",
"length": 10,
"decimals": null,
"values": [],
"allow_null": true,
"default": "0",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,190 @@
{
"1": {
"method": "changeColumn",
"params": [
"core_widgets",
"caches",
{
"name": "caches",
"type": "MEDIUMTEXT",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "JSON encoded array of cache keys to be referenced when deleting caches",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "changeColumn",
"params": [
"core_banfilters",
"ban_type",
{
"name": "ban_type",
"type": "VARCHAR",
"length": 10,
"decimals": null,
"values": [],
"allow_null": false,
"default": "ip",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"3": {
"method": "changeColumn",
"params": [
"core_admin_permission_rows",
"row_id_type",
{
"name": "row_id_type",
"type": "VARCHAR",
"length": 13,
"decimals": null,
"values": [],
"allow_null": false,
"default": "member",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"4": {
"method": "changeColumn",
"params": [
"core_theme_css",
"css_location",
{
"name": "css_location",
"type": "VARCHAR",
"length": 80,
"decimals": null,
"values": [],
"allow_null": false,
"default": "",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"5": {
"method": "changeColumn",
"params": [
"core_theme_templates",
"template_group",
{
"name": "template_group",
"type": "VARCHAR",
"length": 80,
"decimals": null,
"values": [],
"allow_null": false,
"default": "",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"6": {
"method": "update",
"params": [
"core_ipsconnect_slaves",
"slave_url=CONCAT(slave_url,'\/applications\/core\/interface\/ipsconnect\/ipsconnect.php')"
]
},
"7": {
"method": "createTable",
"params": [
{
"name": "core_cache",
"columns": {
"cache_key": {
"name": "cache_key",
"type": "VARCHAR",
"length": 100,
"decimals": null,
"values": [],
"allow_null": false,
"default": null,
"comment": "The key",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"cache_value": {
"name": "cache_value",
"type": "LONGTEXT",
"length": null,
"decimals": null,
"values": [],
"allow_null": false,
"default": null,
"comment": "The value",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"cache_expire": {
"name": "cache_expire",
"type": "INT",
"length": 10,
"decimals": null,
"values": [],
"allow_null": false,
"default": null,
"comment": "Unix timestamp of when the cache expires",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
},
"indexes": {
"cache_key": {
"type": "unique",
"name": "cache_key",
"columns": [
"cache_key"
],
"length": [
null
]
},
"keyexpire": {
"type": "key",
"name": "keyexpire",
"columns": [
"cache_key",
"cache_expire"
],
"length": [
null,
null
]
}
}
}
]
}
}
@@ -0,0 +1,36 @@
<?php
/**
* @brief 4.0.7 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 28 May 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100032;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.7 Upgrade Code
*/
class _Upgrade
{
/**
* Rebuild warning content
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function finish()
{
\IPS\Task::queue( 'core', 'RebuildNonContentPosts', array( 'extension' => 'core_Modcp' ), 2 );
return TRUE;
}
}
@@ -0,0 +1,22 @@
{
"1": {
"method": "update",
"params": [
"core_members",
{
"pp_photo_type": "custom"
},
"pp_photo_type='url' and pp_main_photo!='' and pp_main_photo is not null"
]
},
"2": {
"method": "update",
"params": [
"core_members",
{
"pp_photo_type": "none"
},
"pp_photo_type='url'"
]
}
}
@@ -0,0 +1,80 @@
<?php
/**
* @brief 4.0.8 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 17 Jun 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100033;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.8 Upgrade Code
*/
class _Upgrade
{
/**
* Fix the column
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
$indexTitle = array(
'name' => 'index_title',
'type' => 'VARCHAR',
'length' => 255,
'allow_null' => true,
'default' => null,
'comment' => "Content title",
);
$indexContent = array(
'name' => 'index_content',
'type' => 'MEDIUMTEXT',
'allow_null' => false,
'default' => '',
'comment' => "The plain-text content to search",
);
$indexTitle = \IPS\Db::i()->compileColumnDefinition( $indexTitle );
$indexContent = \IPS\Db::i()->compileColumnDefinition( $indexContent );
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array(
array(
'table' => 'core_search_index',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "core_search_index CHANGE COLUMN `index_title` {$indexTitle}, CHANGE COLUMN index_content {$indexContent}"
)
) );
if ( count( $toRun ) )
{
$mr = \IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 2 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => $mr ) ) ) );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Adjusting search index";
}
}
@@ -0,0 +1,47 @@
<?php
/**
* @brief 4.0.8.1 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 18 Jun 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100034;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.8.1 Upgrade Code
*/
class _Upgrade
{
/**
* Wipe logs since we no longer use .cgi and don't want them to exist any more
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\Log::pruneLogs( 1 );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Pruning old logs";
}
}
@@ -0,0 +1,135 @@
{
"1": {
"method": "changeColumn",
"params": [
"core_sys_conf_settings",
"conf_value",
{
"name": "conf_value",
"type": "MEDIUMTEXT",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "changeColumn",
"params": [
"core_file_logs",
"log_type",
{
"name": "log_type",
"type": "ENUM",
"length": 0,
"decimals": null,
"values": [
"log",
"copy",
"error",
"move",
"orphaned"
],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"3": {
"method": "changeColumn",
"params": [
"core_file_logs",
"log_action",
{
"name": "log_action",
"type": "ENUM",
"length": 0,
"decimals": null,
"values": [
"move",
"copy",
"delete",
"save",
"orphaned"
],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"4": {
"method": "changeColumn",
"params": [
"core_message_posts",
"msg_post",
{
"name": "msg_post",
"type": "MEDIUMTEXT",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"5": {
"method": "update",
"params": [
"core_attachments",
"attach_thumb_location=attach_location",
"attach_is_image=1 AND (attach_thumb_location='' OR attach_thumb_location IS NULL )"
]
},
"6": {
"method": "update",
"params": [
"core_groups",
"g_signature_limits=REPLACE(g_signature_limits,'-1','0')"
]
},
"7": {
"method": "update",
"params": [
"core_widgets",
{
"default_area": ""
}
]
},
"8": {
"method": "update",
"params": [
"core_applications",
{
"app_disabled_groups": null
},
[
"app_enabled=?",
1
]
]
}
}
@@ -0,0 +1,128 @@
<?php
/**
* @brief 4.0.9 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 11 Jun 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100035;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.9 Upgrade Code
*/
class _Upgrade
{
/**
* In 4.x, attach_post_key is only filled in when you upload an attachment but haven't submitted the post yet. Once the attachment is "saved" on a post, attach_post_key is blank.
* The system uses this to know which attachments can be deleted - when something is deleted, it will remove the rows from core_attachments_map and then delete all attachments which have no rows there *and* have no attach_post_key.
* In 3.x, attach_post_key was always filled in, even when an attachment had been saved. This meant that if you upgraded from 3.x, then deleted a post with an attachment on it, that attachment would never be deleted.
* This query wipes the attach_post_key for all attachments. It is done here so that the fix is retroactive. Thoeretically, anyome who started making an attachment before the upgrade here started may lose it, but this would be a rare occurance, and since
* we're performing an upgrade anyway, that's okay - it's better that old attachments are able to be deleted correctly.
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\Db::i()->update( 'core_attachments', array( 'attach_post_key' => '' ) );
/* Make sure the max_video_width_css is populated correctly */
if ( \IPS\Settings::i()->max_video_width )
{
try
{
\IPS\Db::i()->select( 'conf_value', 'core_sys_conf_settings', array( 'conf_key=?', 'max_video_width_css' ) )->first();
}
catch( \UnderflowException $ex )
{
$insert = array(
'conf_key' => 'max_video_width_css',
'conf_value' => '',
'conf_default' => 'none',
'conf_keywords' => '',
'conf_app' => 'core'
);
/* This key was added in 4.0.9 so it will not exist */
\IPS\Db::i()->insert( 'core_sys_conf_settings', $insert );
}
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => \IPS\Settings::i()->max_video_width . 'px' ), array( 'conf_key=?', 'max_video_width_css' ) );
unset( \IPS\Data\Store::i()->settings );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Adjusting old attachments";
}
/**
* A 3.x legacy bug can cause some members to have an invalid group set. Previous versions would silently ignore this but 4.x is not as forgiving.
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
/* Make sure groups are valid */
$groups = \IPS\Db::i()->select( 'member_group_id', 'core_members', NULL, NULL, NULL, NULL, NULL, \IPS\Db::SELECT_DISTINCT );
$invalidGroups = array();
foreach( $groups as $group )
{
try
{
\IPS\Member\Group::load( $group );
}
catch ( \OutOfRangeException $e )
{
$invalidGroups[] = $group;
}
}
if( !empty( $invalidGroups ) )
{
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array( array(
'table' => 'core_members',
'query' => "UPDATE " . \IPS\Db::i()->prefix . "core_members SET member_group_id=" . \IPS\Settings::i()->member_group . " WHERE member_group_id IN( " . implode( ',', $invalidGroups ) . " );"
) ) );
if ( count( $toRun ) )
{
$mr = \IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 2 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => $mr ) ) ) );
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Correcting invalid group mappings";
}
}
@@ -0,0 +1,56 @@
{
"1": {
"method": "addIndex",
"params": [
"core_cache",
{
"type": "key",
"name": "cache_expire",
"columns": [
"cache_expire"
],
"length": [
null
]
}
]
},
"2": {
"method": "dropColumn",
"params": [
"core_member_status_updates",
"status_creator"
]
},
"3": {
"method": "update",
"params": [
"core_admin_permission_rows",
{
"row_perm_cache": "[]"
},
"row_perm_cache='null'"
]
},
"4": {
"method": "changeColumn",
"params": [
"core_sys_lang_words",
"word_custom",
{
"name": "word_custom",
"type": "MEDIUMTEXT",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "The current value",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,82 @@
<?php
/**
* @brief 4.0.10 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 06 Jul 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100038;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.10 Upgrade Code
*/
class _Upgrade
{
/**
* Fix polls
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
$perCycle = 250;
$did = 0;
$limit = intval( \IPS\Request::i()->extra );
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
foreach( \IPS\Db::i()->select( '*', 'core_polls', NULL, 'pid ASC', array( $limit, $perCycle ) ) as $poll )
{
if( $cutOff !== null AND time() >= $cutOff )
{
return ( $limit + $did );
}
$did++;
$poll = \IPS\Poll::constructFromData( $poll );
if( is_array( $poll->choices ) )
{
$poll->votes = 0;
foreach ( $poll->choices as $key => $data )
{
$numberOfVotes = ( is_array( $data['votes'] ) ) ? array_sum( $data['votes'] ) : 0;
if ( $numberOfVotes > $poll->votes )
{
$poll->votes = $numberOfVotes;
}
}
$poll->save();
}
}
if( $did )
{
return ( $limit + $did );
}
else
{
return TRUE;
}
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Fixing polls";
}
}
@@ -0,0 +1,51 @@
{
"1": {
"method": "changeColumn",
"params": [
"core_sys_cp_sessions",
"session_id",
{
"name": "session_id",
"type": "VARCHAR",
"length": 128,
"decimals": null,
"values": [],
"allow_null": false,
"default": "",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "changeColumn",
"params": [
"core_sessions",
"id",
{
"name": "id",
"type": "VARCHAR",
"length": 128,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"3": {
"method": "dropColumn",
"params": [
"core_groups",
"g_max_notifications"
]
}
}
@@ -0,0 +1,75 @@
<?php
/**
* @brief 4.0.11 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 14 Jul 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100041;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.11 Upgrade Code
*/
class _Upgrade
{
/**
* Clean out old notifications that are no longer valid
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
$prefix = \IPS\Db::i()->prefix;
$query = "DELETE {$prefix}core_notifications.* FROM {$prefix}core_notifications LEFT JOIN {$prefix}core_member_status_replies ON({$prefix}core_member_status_replies.reply_id={$prefix}core_notifications.item_id AND {$prefix}core_notifications.item_class='IPS\\core\\Statuses\\Reply') WHERE {$prefix}core_notifications.notification_key='profile_reply' and {$prefix}core_member_status_replies.reply_id IS NULL";
\IPS\Db::i()->query( $query );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Deleting old invalid notifications";
}
/**
* Ensure any user added CSS is set to the correct set_id
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
$prefix = \IPS\Db::i()->prefix;
$query = "UPDATE {$prefix}core_theme_css SET css_set_id=css_added_to WHERE css_added_to > 0 AND css_set_id=0";
\IPS\Db::i()->query( $query );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Fixing incorrect CSS mappings";
}
}
@@ -0,0 +1,41 @@
{
"1": {
"method": "addIndex",
"params": [
"core_notifications",
{
"type": "key",
"name": "subitem_lookup",
"columns": [
"item_sub_class",
"item_sub_id"
],
"length": [
null,
null
]
}
]
},
"2": {
"method": "changeColumn",
"params": [
"core_sys_lang_words",
"word_default",
{
"name": "word_default",
"type": "MEDIUMTEXT",
"length": 0,
"decimals": null,
"values": [],
"allow_null": true,
"default": null,
"comment": "The default value",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
}
}
@@ -0,0 +1,133 @@
<?php
/**
* @brief 4.0.12 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 14 Jul 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100042;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.12 Upgrade Code
*/
class _Upgrade
{
/**
* CSS can get confused because of previusly fixed issues.
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
$prefix = \IPS\Db::i()->prefix;
$dupes = array();
/* Find and clear out duplicate CSS rows, saving the most recently edited */
foreach( \IPS\Db::i()->query("SELECT *, COUNT( CONCAT_WS(';', css_set_id, css_app, css_location, css_path, css_name) ) as count FROM {$prefix}core_theme_css GROUP BY css_set_id, css_app, css_location, css_path, css_name ORDER BY count DESC" ) as $row )
{
if ( $row['count'] < 2 )
{
break;
}
$dupes[] = md5( $row['css_set_id'] . ';' . $row['css_app'] . ';' . $row['css_location'] . ';' . $row['css_path'] . ';' . $row['css_name'] );
}
foreach( $dupes as $key )
{
$keep = \IPS\Db::i()->select( '*', 'core_theme_css', array( "MD5( CONCAT_WS(';', css_set_id, css_app, css_location, css_path, css_name) )=?", $key ), 'css_updated DESC' )->first();
\IPS\Db::i()->delete( 'core_theme_css', array( "MD5( CONCAT_WS(';', css_set_id, css_app, css_location, css_path, css_name) ) =? AND css_id !=?", $key, $keep['css_id'] ) );
}
\IPS\Db::i()->query( "UPDATE {$prefix}core_theme_css SET css_unique_key=MD5( CONCAT_WS( ';', css_set_id, css_app, css_location, css_path, css_name ) )" );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Fixing old incorrect CSS mappings";
}
/**
* In an older 4.0.x release a primary key was set incorrectly on this column, which often results in the database checker flagging the column for repair but being unable to repair it (with no errors)
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
if( \IPS\Db::i()->checkForIndex( 'core_sys_social_group_members', 'PRIMARY KEY' ) )
{
\IPS\Db::i()->dropIndex( 'core_sys_social_group_members', 'PRIMARY KEY' );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Adjusting database indexes";
}
/**
* 3.x allowed website url to be saved as just "http://", but this causes an error when trying to edit the member if you don't spot it
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step3()
{
$queries = array();
foreach( \IPS\Db::i()->select( '*', 'core_pfields_data', array( 'pf_type=?', 'Url' ) ) as $field )
{
$queries[] = array( 'table' => 'core_pfields_content', 'query' => "UPDATE " . \IPS\Db::i()->prefix . "core_pfields_content SET field_" . $field['pf_id'] . "='' WHERE field_" . $field['pf_id'] . "='http://';" );
}
if( count( $queries ) )
{
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $queries );
if ( count( $toRun ) )
{
$mr = \IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 4 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => $mr ) ) ) );
}
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step3CustomTitle()
{
return "Fixing incorrect custom field URLs";
}
}
@@ -0,0 +1,145 @@
{
"1": {
"method": "addColumn",
"params": [
"core_sessions",
{
"name": "theme_id",
"type": "INT",
"length": 10,
"decimals": null,
"values": [],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": true,
"zerofill": false,
"auto_increment": false,
"binary": false
}
]
},
"2": {
"method": "update",
"params": [
"core_groups",
"g_dname_date=1",
"g_dname_changes=0 AND g_dname_date=0"
]
},
"3": {
"method": "changeIndex",
"params": [
"core_validating",
"lost_pass",
{
"type": "key",
"name": "lost_pass",
"columns": [
"lost_pass",
"entry_date"
],
"length": [
null,
null
]
}
]
},
"4": {
"method": "addIndex",
"params": [
"core_edit_history",
{
"type": "key",
"name": "time",
"columns": [
"time"
],
"length": [
null
]
}
]
},
"5": {
"method": "addIndex",
"params": [
"core_tasks_log",
{
"type": "key",
"name": "time",
"columns": [
"time"
],
"length": [
null
]
}
]
},
"6": {
"method": "addIndex",
"params": [
"core_spam_service_log",
{
"type": "key",
"name": "log_date",
"columns": [
"log_date"
],
"length": [
null
]
}
]
},
"7": {
"method": "addIndex",
"params": [
"core_notifications",
{
"type": "key",
"name": "sent_time",
"columns": [
"sent_time"
],
"length": [
null
]
}
]
},
"8": {
"method": "addIndex",
"params": [
"core_widget_trash",
{
"type": "key",
"name": "date",
"columns": [
"date"
],
"length": [
null
]
}
]
},
"9": {
"method": "addIndex",
"params": [
"core_members",
{
"type": "key",
"name": "mod_posts",
"columns": [
"mod_posts"
],
"length": [
null
]
}
]
}
}
@@ -0,0 +1,188 @@
<?php
/**
* @brief 4.0.13 Upgrade Code
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 31 Jul 2015
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_100044;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.0.13 Upgrade Code
*/
class _Upgrade
{
/**
* Some users have bad warn log data due to a past bug
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\Db::i()->update( 'core_members_warn_logs', "wl_mq=REPLACE(wl_mq,'P-','P')" );
\IPS\Db::i()->update( 'core_members_warn_logs', "wl_rpa=REPLACE(wl_rpa,'P-','P')" );
\IPS\Db::i()->update( 'core_members_warn_logs', "wl_suspend=REPLACE(wl_suspend,'P-','P')" );
\IPS\Db::i()->update( 'core_members_warn_logs', "wl_mq=REPLACE(wl_mq,'P','PT')", "wl_mq regexp 'P[0-9]+H' and wl_mq not regexp 'PT[0-9]+H'" );
\IPS\Db::i()->update( 'core_members_warn_logs', "wl_rpa=REPLACE(wl_rpa,'P','PT')", "wl_rpa regexp 'P[0-9]+H' and wl_rpa not regexp 'PT[0-9]+H'" );
\IPS\Db::i()->update( 'core_members_warn_logs', "wl_suspend=REPLACE(wl_suspend,'P','PT')", "wl_suspend regexp 'P[0-9]+H' and wl_suspend not regexp 'PT[0-9]+H'" );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step1CustomTitle()
{
return "Fixing incorrectly formatted warn logs";
}
/**
* Notifications for status updates and replies were not previously properly removed
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
$toRunQueries = array(
array(
'table' => 'core_notifications',
'query' => "DELETE FROM " . \IPS\Db::i()->prefix . "core_notifications WHERE item_class='IPS\\core\\Statuses\\Status' AND item_id NOT IN (SELECT status_id FROM " . \IPS\Db::i()->prefix . "core_member_status_updates)",
),
array(
'table' => 'core_notifications',
'query' => "DELETE FROM " . \IPS\Db::i()->prefix . "core_notifications WHERE item_class='IPS\\core\\Statuses\\Reply' AND item_id NOT IN (SELECT reply_id FROM " . \IPS\Db::i()->prefix . "core_member_status_replies)",
)
);
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $toRunQueries );
if ( count( $toRun ) )
{
$mr = \IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 'extra' => array( '_upgradeStep' => 3 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => $mr ) ) ) );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step2CustomTitle()
{
return "Removing invalid notifications";
}
/**
* Fix mixed charset/collations for union query
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step3()
{
\IPS\Db::i()->query( "ALTER TABLE " . \IPS\Db::i()->prefix . "core_applications CHARACTER SET " . \IPS\Db::i()->charset . " COLLATE " . \IPS\Db::i()->collation );
\IPS\Db::i()->query( "ALTER TABLE " . \IPS\Db::i()->prefix . "core_applications CHANGE app_directory app_directory VARCHAR(250) CHARACTER SET " . \IPS\Db::i()->charset . " COLLATE " . \IPS\Db::i()->collation . " NOT NULL,
CHANGE app_update_check app_update_check VARCHAR(255) CHARACTER SET " . \IPS\Db::i()->charset . " COLLATE " . \IPS\Db::i()->collation . " NULL DEFAULT NULL" );
\IPS\Db::i()->query( "ALTER TABLE " . \IPS\Db::i()->prefix . "core_plugins CHARACTER SET " . \IPS\Db::i()->charset . " COLLATE " . \IPS\Db::i()->collation );
\IPS\Db::i()->query( "ALTER TABLE " . \IPS\Db::i()->prefix . "core_plugins CHANGE plugin_update_check plugin_update_check TEXT CHARACTER SET " . \IPS\Db::i()->charset . " COLLATE " . \IPS\Db::i()->collation . " NULL DEFAULT NULL COMMENT 'URL to check for updates'" );
\IPS\Db::i()->query( "ALTER TABLE " . \IPS\Db::i()->prefix . "core_themes CHARACTER SET " . \IPS\Db::i()->charset . " COLLATE " . \IPS\Db::i()->collation );
\IPS\Db::i()->query( "ALTER TABLE " . \IPS\Db::i()->prefix . "core_themes CHANGE set_update_check set_update_check VARCHAR(255) CHARACTER SET " . \IPS\Db::i()->charset . " COLLATE " . \IPS\Db::i()->collation . " NULL DEFAULT NULL COMMENT 'Remote URL to retrieve update data'" );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step3CustomTitle()
{
return "Fixing mixed character sets";
}
/**
* Fix url dofollow if needed
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step4()
{
if( \IPS\Settings::i()->posts_add_nofollow_exclude )
{
$nofollow = json_decode( \IPS\Settings::i()->posts_add_nofollow_exclude, TRUE );
$domains = array();
foreach( $nofollow as $domain )
{
/* We only want to compare against the domain, not the full URL */
$domain = str_replace( array( 'http://', 'https://' ), '', $domain );
/* And we are comparing against the non-www. version during parsing */
$domain = preg_replace( '/^www\./', '', $domain );
/* Use the domain as the key as well to prevent duplicates for efficiency purposes */
$domains[ $domain ] = $domain;
}
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => json_encode( array_values( $domains ) ) ), array( 'conf_key=?', 'posts_add_nofollow_exclude' ) );
unset( \IPS\Data\Store::i()->settings );
}
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step4CustomTitle()
{
return "Fixing URL nofollow filters";
}
/**
* Enable the cache cleanup task
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step5()
{
\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), "`key`='clearcache'" );
return TRUE;
}
/**
* Custom title for this step
*
* @return string
*/
public function step5CustomTitle()
{
return "Re-enable cache cleanup task";
}
}
Whitespace-only changes.
File diff suppressed because it is too large. Load diff
Whitespace-only changes.
@@ -0,0 +1,144 @@
{
"0": {
"method": "createTable",
"params": [
{
"name": "content_cache_sigs",
"columns": {
"cache_content_id": {
"name": "cache_content_id",
"type": "INT",
"length": "10",
"unsigned": true,
"zerofill": false,
"binary": false,
"allow_null": false,
"default": "0",
"auto_increment": false,
"comment": ""
},
"cache_content": {
"name": "cache_content",
"type": "MEDIUMTEXT",
"length": 0,
"decimals": null,
"values": [
],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"cache_updated": {
"name": "cache_updated",
"type": "INT",
"length": "10",
"decimals": null,
"values": [
],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
},
"indexes": {
"0": {
"type": "unique",
"name": "cache_content_id",
"columns": [
"cache_content_id"
]
},
"1": {
"type": "key",
"name": "date_index",
"columns": [
"cache_updated"
]
}
},
"comment": ""
}
]
},
"1": {
"method": "createTable",
"params": [
{
"name": "content_cache_posts",
"columns": {
"cache_content_id": {
"name": "cache_content_id",
"type": "INT",
"length": "10",
"unsigned": true,
"zerofill": false,
"binary": false,
"allow_null": false,
"default": "0",
"auto_increment": false,
"comment": ""
},
"cache_content": {
"name": "cache_content",
"type": "MEDIUMTEXT",
"length": 0,
"decimals": null,
"values": [
],
"allow_null": true,
"default": null,
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
},
"cache_updated": {
"name": "cache_updated",
"type": "INT",
"length": "10",
"decimals": null,
"values": [
],
"allow_null": false,
"default": "0",
"comment": "",
"unsigned": false,
"zerofill": false,
"auto_increment": false,
"binary": false
}
},
"indexes": {
"0": {
"type": "unique",
"name": "cache_content_id",
"columns": [
"cache_content_id"
]
},
"1": {
"type": "key",
"name": "date_index",
"columns": [
"cache_updated"
]
}
},
"comment": ""
}
]
}
}
Whitespace-only changes.
@@ -0,0 +1,147 @@
<?php
/**
* @brief Upgrade steps
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 27 May 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_30004;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Upgrade steps
*/
class _Upgrade
{
/**
* Step 1
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\Db::i()->addColumn( 'groups', array(
'name' => 'g_mod_post_unit',
'type' => 'int',
'length' => 5,
'unsigned' => true,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addColumn( 'groups', array(
'name' => 'g_ppd_limit',
'type' => 'int',
'length' => 5,
'unsigned' => true,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addColumn( 'groups', array(
'name' => 'g_ppd_unit',
'type' => 'int',
'length' => 5,
'unsigned' => true,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addColumn( 'groups', array(
'name' => 'g_displayname_unit',
'type' => 'int',
'length' => 5,
'unsigned' => true,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addColumn( 'groups', array(
'name' => 'g_sig_unit',
'type' => 'int',
'length' => 5,
'unsigned' => true,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addColumn( 'groups', array(
'name' => 'g_pm_flood_mins',
'type' => 'int',
'length' => 5,
'unsigned' => true,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addColumn( 'banfilters', array(
'name' => 'ban_nocache',
'type' => 'int',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addIndex( 'banfilters', array(
'type' => 'key',
'name' => 'ban_content',
'columns' => array( 'ban_content' ),
'length' => array( 200 )
) );
\IPS\Db::i()->addIndex( 'banfilters', array(
'type' => 'key',
'name' => 'ban_nocache',
'columns' => array( 'ban_nocache' )
) );
\IPS\Db::i()->update( 'groups', array( 'g_promotion' => '-1&-1' ), array( 'g_access_cp=?', 1 ) );
\IPS\Db::i()->addColumn( 'faq', array(
'name' => 'app',
'type' => 'varchar',
'length' => 32,
'allow_null' => false,
'default' => 'core'
) );
\IPS\Db::i()->changeColumn( 'core_sys_lang', 'lang_short', array(
'name' => 'lang_short',
'type' => 'varchar',
'length' => 18,
'allow_null' => false
) );
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array( array(
'table' => 'members',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "members ADD COLUMN members_day_posts VARCHAR(32) NOT NULL DEFAULT '0,0',
ADD INDEX members_bitoptions (members_bitoptions);"
),
array(
'table' => 'message_topics',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "message_topics ADD INDEX mt_date (mt_date);"
)
) );
if ( count( $toRun ) )
{
$mr = \IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 2 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => $mr ) ) ) );
}
/* Finish */
return TRUE;
}
}
Whitespace-only changes.
@@ -0,0 +1,104 @@
<?php
/**
* @brief Upgrade steps
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 27 May 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_30005;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Upgrade steps
*/
class _Upgrade
{
/**
* Step 1
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\Db::i()->addColumn( 'skin_css', array(
'name' => 'css_modules',
'type' => 'varchar',
'length' => 250,
'allow_null' => false,
'default' => ''
) );
\IPS\Db::i()->addColumn( 'skin_cache', array(
'name' => 'cache_key_6',
'type' => 'varchar',
'length' => 200,
'allow_null' => false,
'default' => ''
) );
\IPS\Db::i()->addColumn( 'skin_cache', array(
'name' => 'cache_value_6',
'type' => 'varchar',
'length' => 200,
'allow_null' => false,
'default' => ''
) );
if( !\IPS\Db::i()->checkForColumn( 'custom_bbcode', 'bbcode_app' ) )
{
\IPS\Db::i()->addColumn( 'custom_bbcode', array(
'name' => 'bbcode_app',
'type' => 'varchar',
'length' => 50,
'allow_null' => false,
'default' => ''
) );
}
\IPS\Db::i()->addColumn( 'skin_collections', array(
'name' => 'set_minify',
'type' => 'int',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->delete( 'core_item_markers' );
\IPS\Db::i()->delete( 'core_item_markers_storage' );
\IPS\Db::i()->addIndex( 'core_item_markers_storage', array(
'type' => 'key',
'name' => 'item_last_saved',
'columns' => array( 'item_last_saved' )
) );
\IPS\Db::i()->addIndex( 'core_item_markers', array(
'type' => 'key',
'name' => 'item_last_saved',
'columns' => array( 'item_last_saved' )
) );
\IPS\Db::i()->dropIndex( 'core_item_markers', 'combo_key' );
\IPS\Db::i()->addIndex( 'core_item_markers', array(
'type' => 'unique',
'name' => 'combo_key',
'columns' => array( 'item_key', 'item_member_id', 'item_app' )
) );
\IPS\Db::i()->update( 'core_hooks', array( 'hook_key' => 'recent_topics' ), array( 'hook_name=?', 'Recent Topics' ) );
/* Finish */
return TRUE;
}
}
Whitespace-only changes.
@@ -0,0 +1,115 @@
<?php
/**
* @brief Upgrade steps
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 27 May 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_30006;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Upgrade steps
*/
class _Upgrade
{
/**
* Step 1
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
if( !\IPS\Db::i()->checkForColumn( 'skin_templates', 'template_user_added' ) )
{
\IPS\Db::i()->addColumn( 'skin_templates', array(
'name' => 'template_user_added',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addColumn( 'skin_templates', array(
'name' => 'template_user_edited',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
}
\IPS\Db::i()->changeColumn( 'rc_reports', 'report', array(
'name' => 'report',
'type' => 'mediumtext',
'length' => null,
'allow_null' => false
) );
\IPS\Db::i()->addIndex( 'skin_collections', array(
'type' => 'key',
'name' => 'parent_set_id',
'columns' => array( 'set_parent_id', 'set_id' )
) );
\IPS\Db::i()->changeColumn( 'forums', 'last_poster_name', array(
'name' => 'last_poster_name',
'type' => 'varchar',
'length' => 255,
'allow_null' => true,
'default' => null,
) );
\IPS\Db::i()->changeColumn( 'error_logs', 'log_error_code', array(
'name' => 'log_error_code',
'type' => 'varchar',
'length' => 24,
'allow_null' => false,
'default' => '0',
) );
\IPS\Db::i()->addIndex( 'core_sys_lang', array(
'type' => 'key',
'name' => 'lang_default',
'columns' => array( 'lang_default' )
) );
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array( array(
'table' => 'topics',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "topics CHANGE COLUMN starter_name starter_name VARCHAR(255) NULL DEFAULT NULL,
CHANGE COLUMN last_poster_name last_poster_name VARCHAR(255) NULL DEFAULT NULL;"
),
array(
'table' => 'tracker',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "tracker DROP INDEX tm_id,
ADD INDEX tm_id (member_id, topic_id);"
),
array(
'table' => 'forum_tracker',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "forum_tracker DROP INDEX fm_id,
ADD INDEX fm_id (forum_id);"
)
) );
if ( count( $toRun ) )
{
$mr = \IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 2 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => $mr ) ) ) );
}
/* Finish */
return TRUE;
}
}
Whitespace-only changes.
@@ -0,0 +1,22 @@
{
"1": {
"method": "delete",
"params": [
"core_sys_conf_settings",
[
"conf_key=?",
"number_format"
]
]
},
"2": {
"method": "delete",
"params": [
"core_sys_conf_settings",
[
"conf_key=?",
"decimal_seperator"
]
]
}
}
Whitespace-only changes.
@@ -0,0 +1,28 @@
{
"1": {
"method": "delete",
"params": [
"message_topic_user_map",
"map_user_active=0 AND map_is_system=0 AND map_user_banned=0 AND map_is_starter=1"
]
},
"2": {
"method": "changeColumn",
"params": [
"core_sys_lang",
"lang_title",
{
"name": "lang_title",
"type": "VARCHAR",
"length": "255",
"unsigned": false,
"zerofill": false,
"binary": false,
"allow_null": false,
"default": "",
"auto_increment": false,
"comment": ""
}
]
}
}
@@ -0,0 +1,49 @@
<?php
/**
* @brief Upgrade steps
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 27 May 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_30008;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Upgrade steps
*/
class _Upgrade
{
/**
* Step 1
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
foreach( \IPS\Db::i()->select( '*', 'pfields_data' ) as $row )
{
/* Attempt conversion of dd / dt microformats */
if ( stristr( $row['pf_topic_format'], '<dt>' ) OR stristr( $row['pf_topic_format'], '<dd>' ) )
{
$row['pf_topic_format'] = str_replace( '<dt>', "<span class='ft'>", $row['pf_topic_format'] );
$row['pf_topic_format'] = str_replace( '<dd>', "<span class='fc'>", $row['pf_topic_format'] );
$row['pf_topic_format'] = str_replace( array( '</dt>', '</dd>' ), "</span>", $row['pf_topic_format'] );
\IPS\Db::i()->update( 'pfields_data', array( 'pf_topic_format' => $row['pf_topic_format'] ), 'pf_id=' . $row['pf_id'] );
}
}
/* Finish */
return TRUE;
}
}
Whitespace-only changes.
@@ -0,0 +1,143 @@
<?php
/**
* @brief Upgrade steps
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 27 May 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_30009;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Upgrade steps
*/
class _Upgrade
{
/**
* Step 1
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
if( \IPS\Db::i()->checkForColumn( 'profile_portal', 'fb_status' ) )
{
\IPS\Db::i()->dropColumn( 'profile_portal', 'fb_status' );
}
if( !\IPS\Db::i()->checkForColumn( 'core_applications', 'app_hide_tab' ) )
{
\IPS\Db::i()->addColumn( 'core_applications', array(
'name' => 'app_hide_tab',
'type' => 'tinyint',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
}
if( !\IPS\Db::i()->checkForColumn( 'core_applications', 'app_tab_groups' ) )
{
\IPS\Db::i()->addColumn( 'core_applications', array(
'name' => 'app_tab_groups',
'type' => 'text',
'length' => null,
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->addColumn( 'core_applications', array(
'name' => 'app_website',
'type' => 'varchar',
'length' => 255,
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->addColumn( 'core_applications', array(
'name' => 'app_update_check',
'type' => 'varchar',
'length' => 255,
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->addColumn( 'core_applications', array(
'name' => 'app_global_caches',
'type' => 'varchar',
'length' => 255,
'allow_null' => true,
'default' => null
) );
}
\IPS\Db::i()->delete( 'task_manager', "task_key IN ('doexpiresubs', 'expiresubs') AND task_application != 'subscriptions'" );
\IPS\Db::i()->createTable( array(
'name' => 'spam_service_log',
'columns' => array(
array(
'name' => 'id',
'type' => 'int',
'length' => 10,
'unsigned' => true,
'allow_null' => false,
'auto_increment' => true
),
array(
'name' => 'log_date',
'type' => 'int',
'length' => 10,
'unsigned' => true,
'allow_null' => false,
'default' => 0
),
array(
'name' => 'log_code',
'type' => 'smallint',
'length' => 1,
'unsigned' => true,
'allow_null' => false,
'default' => 0
),
array(
'name' => 'log_msg',
'type' => 'varchar',
'length' => 32,
'allow_null' => false
),
array(
'name' => 'email_address',
'type' => 'varchar',
'length' => 255,
'allow_null' => false
),
array(
'name' => 'ip_address',
'type' => 'varchar',
'length' => 32,
'allow_null' => false
),
),
'indexes' => array(
array(
'type' => 'primary',
'columns' => array( 'id' )
)
)
) );
/* Finish */
return TRUE;
}
}
Whitespace-only changes.
@@ -0,0 +1,107 @@
<?php
/**
* @brief Upgrade steps
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 27 May 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_30010;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Upgrade steps
*/
class _Upgrade
{
/**
* Step 1
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\Db::i()->addIndex( 'admin_logs', array(
'type' => 'key',
'name' => 'ip_address',
'columns' => array( 'ip_address' )
) );
\IPS\Db::i()->addIndex( 'dnames_change', array(
'type' => 'key',
'name' => 'dname_ip_address',
'columns' => array( 'dname_ip_address' )
) );
\IPS\Db::i()->addIndex( 'error_logs', array(
'type' => 'key',
'name' => 'log_ip_address',
'columns' => array( 'log_ip_address' )
) );
\IPS\Db::i()->addIndex( 'moderator_logs', array(
'type' => 'key',
'name' => 'ip_address',
'columns' => array( 'ip_address' )
) );
\IPS\Db::i()->addIndex( 'validating', array(
'type' => 'key',
'name' => 'ip_address',
'columns' => array( 'ip_address' )
) );
\IPS\Db::i()->addIndex( 'sessions', array(
'type' => 'key',
'name' => 'member_id',
'columns' => array( 'member_id' )
) );
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array( array(
'table' => 'members',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "members ADD INDEX ip_address (ip_address),
ADD COLUMN live_id VARCHAR(32) NULL DEFAULT NULL;"
),
array(
'table' => 'message_posts',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "message_posts ADD INDEX msg_ip_address (msg_ip_address);"
),
array(
'table' => 'profile_comments',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "profile_comments ADD INDEX comment_ip_address (comment_ip_address);"
),
array(
'table' => 'topic_ratings',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "topic_ratings ADD INDEX rating_ip_address (rating_ip_address);"
),
array(
'table' => 'voters',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "voters ADD INDEX ip_address (ip_address);"
),
array(
'table' => 'profile_portal',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "profile_portal ADD INDEX pp_status (pp_status(128),pp_status_update);"
)
) );
if ( count( $toRun ) )
{
$mr = \IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 2 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => $mr ) ) ) );
}
/* Finish */
return TRUE;
}
}
Whitespace-only changes.
@@ -0,0 +1,96 @@
<?php
/**
* @brief Upgrade steps
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 27 May 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_30011;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Upgrade steps
*/
class _Upgrade
{
/**
* Step 1
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
if( !\IPS\Db::i()->checkForColumn( 'message_topic_user_map', 'map_last_topic_reply' ) )
{
\IPS\Db::i()->addColumn( 'message_topic_user_map', array(
'name' => 'map_last_topic_reply',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
}
\IPS\Db::i()->changeColumn( 'core_sys_module', 'sys_module_version', array(
'name' => 'sys_module_version',
'type' => 'varchar',
'length' => 32,
'allow_null' => false
) );
\IPS\Db::i()->changeColumn( 'core_sys_lang_words', 'word_js', array(
'name' => 'word_js',
'type' => 'tinyint',
'length' => 1,
'unsigned' => true,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->query( "UPDATE " . \IPS\Db::i()->prefix . "core_sys_conf_settings SET conf_value=conf_default WHERE conf_key='links_external' AND conf_value=''" );
\IPS\Db::i()->delete( "core_sys_conf_settings", array( 'conf_key=?', 'spider_suit' ) );
\IPS\Db::i()->delete( "core_sys_conf_settings", array( 'conf_key=?', 'c_cache_days' ) );
unset( \IPS\Data\Store::i()->settings );
\IPS\Db::i()->changeColumn( 'forums', 'permission_array', array(
'name' => 'permission_array',
'type' => 'mediumtext',
'allow_null' => true,
'default' => null
) );
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array( array(
'table' => 'topics',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "topics ADD INDEX start_date (start_date);"
),
array(
'table' => 'members',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "members CHANGE COLUMN fb_uid fb_uid BIGINT(20) NOT NULL DEFAULT 0;"
) ) );
if ( count( $toRun ) )
{
$mr = \IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 2 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => $mr ) ) ) );
}
/* @note We previously updated a media tag bbcode here, but it's no longer relevant in the latest release so there is no point in doing so */
/* Finish */
return TRUE;
}
}
Whitespace-only changes.
@@ -0,0 +1,164 @@
<?php
/**
* @brief Upgrade steps
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 27 May 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_30012;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Upgrade steps
*/
class _Upgrade
{
/**
* Step 1
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
if( !\IPS\Db::i()->checkForColumn( 'tags_index', 'tag_hidden' ) )
{
\IPS\Db::i()->addColumn( 'tags_index', array(
'name' => 'tag_hidden',
'type' => 'int',
'length' => 1,
'allow_null' => false,
'default' => 0
) );
\IPS\Db::i()->addIndex( 'tags_index', array(
'type' => 'key',
'name' => 'tag_grab',
'columns' => array( 'app', 'type', 'type_id', 'type_2', 'type_id_2', 'tag_hidden' )
) );
}
\IPS\Db::i()->addIndex( 'message_topic_user_map', array(
'type' => 'key',
'name' => 'map_topic_id',
'columns' => array( 'map_topic_id' )
) );
if( !\IPS\Db::i()->checkForColumn( 'message_topic_user_map', 'map_last_topic_reply' ) )
{
\IPS\Db::i()->addColumn( 'message_topic_user_map', array(
'name' => 'map_last_topic_reply',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
}
\IPS\Db::i()->query( "UPDATE " . \IPS\Db::i()->prefix . "message_topic_user_map m, " . \IPS\Db::i()->prefix . "message_topics t SET m.map_last_topic_reply=t.mt_last_post_time WHERE m.map_topic_id=t.mt_id" );
\IPS\Db::i()->dropIndex( 'task_manager', 'task_next_run' );
\IPS\Db::i()->addIndex( 'task_manager', array(
'type' => 'key',
'name' => 'task_next_run',
'columns' => array( 'task_enabled', 'task_next_run' )
) );
\IPS\Db::i()->addIndex( 'captcha', array(
'type' => 'key',
'name' => 'captcha_date',
'columns' => array( 'captcha_date' )
) );
\IPS\Db::i()->addIndex( 'rss_import', array(
'type' => 'key',
'name' => 'rss_import_enabled',
'columns' => array( 'rss_import_enabled', 'rss_import_last_import' )
) );
\IPS\Db::i()->addIndex( 'core_sys_settings_titles', array(
'type' => 'key',
'name' => 'conf_title_keyword',
'columns' => array( 'conf_title_keyword' )
) );
\IPS\Db::i()->addIndex( 'core_sys_conf_settings', array(
'type' => 'key',
'name' => 'conf_key',
'columns' => array( 'conf_key' )
) );
\IPS\Db::i()->createTable( array(
'name' => 'core_rss_imported',
'columns' => array(
array(
'name' => 'rss_guid',
'type' => 'char',
'length' => 32,
'allow_null' => false,
),
array(
'name' => 'rss_foreign_id',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
),
array(
'name' => 'rss_foreign_key',
'type' => 'varchar',
'length' => 100,
'allow_null' => false,
'default' => ''
)
),
'indexes' => array(
array(
'type' => 'primary',
'columns' => array( 'rss_guid' )
),
array(
'type' => 'key',
'name' => 'rss_grabber',
'columns' => array( 'rss_guid', 'rss_foreign_key' )
),
)
) );
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array( array(
'table' => 'forum_tracker',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "forum_tracker CHANGE COLUMN member_id member_id MEDIUMINT(8) NOT NULL DEFAULT 0;"
),
array(
'table' => 'topics',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "topics ADD INDEX last_x_topics (forum_id, approved, start_date),
DROP INDEX last_post,
ADD INDEX last_post (forum_id, pinned, last_post, state);"
),
array(
'table' => 'polls',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "polls ADD INDEX tid (tid);"
) ) );
if ( count( $toRun ) )
{
$mr = \IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 2 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => $mr ) ) ) );
}
/* Finish */
return TRUE;
}
}
Whitespace-only changes.
File diff suppressed because it is too large. Load diff
Whitespace-only changes.
@@ -0,0 +1,49 @@
<?php
/**
* @brief Upgrade steps
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 27 May 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_31003;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Upgrade steps
*/
class _Upgrade
{
/**
* Step 1
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
if( !\IPS\Db::i()->checkForColumn( 'skin_replacements', 'replacement_master_key' ) )
{
\IPS\Db::i()->addColumn( 'skin_replacements', array(
'name' => 'replacement_master_key',
'type' => 'VARCHAR',
'length' => 100,
'allow_null' => false,
'default' => ''
) );
\IPS\Db::i()->update( 'skin_replacements', array( 'replacement_master_key' => 'root' ), array( 'replacement_set_id=?', 0 ) );
}
/* Finish */
return TRUE;
}
}
Whitespace-only changes.
@@ -0,0 +1,136 @@
<?php
/**
* @brief Upgrade steps
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @since 27 May 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_31004;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Upgrade steps
*/
class _Upgrade
{
/**
* Step 1
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step1()
{
\IPS\Db::i()->createTable( array(
'name' => 'mobile_notifications',
'columns' => array(
array(
'name' => 'id',
'type' => 'int',
'length' => 10,
'unsigned' => true,
'allow_null' => false,
'default' => null,
'auto_increment' => true
),
array(
'name' => 'notify_title',
'type' => 'text',
'length' => null,
'allow_null' => true,
'default' => null
),
array(
'name' => 'notify_date',
'type' => 'int',
'length' => 10,
'unsigned' => true,
'allow_null' => false,
'default' => 0
),
array(
'name' => 'member_id',
'type' => 'mediumint',
'length' => 8,
'unsigned' => true,
'allow_null' => false,
'default' => 0
),
array(
'name' => 'notify_sent',
'type' => 'tinyint',
'length' => 3,
'unsigned' => true,
'allow_null' => false,
'default' => 0
),
),
'indexes' => array(
array(
'type' => 'primary',
'columns' => array( 'id' )
)
)
) );
if( \IPS\Db::i()->checkForIndex( 'rc_classes', 'group_perms' ) )
{
\IPS\Db::i()->dropIndex( 'rc_classes', 'group_perms' );
}
if( \IPS\Db::i()->checkForIndex( 'rc_classes', 'onoff' ) )
{
\IPS\Db::i()->dropIndex( 'rc_classes', 'onoff' );
}
\IPS\Db::i()->changeColumn( 'rc_classes', 'group_can_report', array(
'name' => 'group_can_report',
'type' => 'text',
'length' => null,
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->changeColumn( 'rc_classes', 'mod_group_perm', array(
'name' => 'mod_group_perm',
'type' => 'text',
'length' => null,
'allow_null' => true,
'default' => null
) );
\IPS\Db::i()->addIndex( 'rc_classes', array(
'type' => 'key',
'name' => 'onoff',
'columns' => array( 1 => 'onoff', 2 => 'mod_group_perm' ),
'length' => array( 1 => null, 2 => 255 ),
) );
\IPS\Db::i()->dropColumn( 'pfields_content', 'updated' );
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array( array(
'table' => 'members',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "members ADD COLUMN ips_mobile_token VARCHAR(64) NULL DEFAULT NULL;"
) ) );
if ( count( $toRun ) )
{
$mr = \IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 2 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => $mr ) ) ) );
}
/* Finish */
return TRUE;
}
}
Whitespace-only changes.
@@ -0,0 +1,27 @@
{
"1": {
"method": "changeIndex",
"params": [
"core_item_markers",
"item_member_id",
{
"type": "key",
"name": "item_member_id",
"columns": [
"item_is_deleted",
"item_member_id"
]
}
]
},
"2": {
"method": "update",
"params": [
"custom_bbcode",
{
"bbcode_desc": "[html]<div class=\"outer\">\n<p>Hello World<\/p>\n<\/div>[\/html]"
},
"bbcode_tag='html'"
]
}
}
Loaded 100 of 7517 files, more files were not shown because too many files have changed in this diff. Show more