Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
Whitespace-only changes.
@@ -1,29 +0,0 @@
|
||||
{
|
||||
"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.
@@ -1,106 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Alpha 1 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 25 Mar 2013
|
||||
*/
|
||||
|
||||
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 ) )
|
||||
{
|
||||
\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' => \IPS\Request::i()->mr ) ) ) );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step2CustomTitle()
|
||||
{
|
||||
return "Resetting friendly URL titles";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Upgrader: Custom Upgrade Options
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 4 Dec 2014
|
||||
*/
|
||||
|
||||
/* 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' ) ) )
|
||||
);
|
||||
@@ -1,268 +0,0 @@
|
||||
{
|
||||
"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
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,327 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Alpha 1 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 25 Mar 2013
|
||||
*/
|
||||
|
||||
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
|
||||
* 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 step2()
|
||||
{
|
||||
/* 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++;
|
||||
|
||||
/* Make sure the users aren't orphaned */
|
||||
$requester = \IPS\Member::load( $friend['friends_friend_id'] );
|
||||
$requestee = \IPS\Member::load( $friend['friends_member_id'] );
|
||||
|
||||
if( !$requestee->member_id OR !$requester->member_id )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* 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 step2CustomTitle()
|
||||
{
|
||||
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 3
|
||||
* 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 step3()
|
||||
{
|
||||
if ( \IPS\Db::i()->select( 'COUNT(*)', 'core_advertisements', 'ad_active=1' )->first() )
|
||||
{
|
||||
\IPS\Settings::i()->changeValues( array( 'ads_exist' => 1 ) );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step3CustomTitle()
|
||||
{
|
||||
return "Setting advertisement statuses";
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 4
|
||||
* 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 step4()
|
||||
{
|
||||
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,
|
||||
) );
|
||||
}
|
||||
|
||||
if ( ! isset( \IPS\Request::i()->run_anyway ) )
|
||||
{
|
||||
\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( \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 ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 5 ) ) );
|
||||
|
||||
/* 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' => \IPS\Request::i()->mr ) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step4CustomTitle()
|
||||
{
|
||||
return "Cleaning up member and member rank tables";
|
||||
}
|
||||
|
||||
/* ! Conversation Participants */
|
||||
/**
|
||||
* Step 5
|
||||
* 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 step5()
|
||||
{
|
||||
$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 step5CustomTitle()
|
||||
{
|
||||
$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.
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Alpha 1 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 25 Mar 2013
|
||||
*/
|
||||
|
||||
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.
@@ -1,91 +0,0 @@
|
||||
{
|
||||
"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
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Alpha 1 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 25 Mar 2013
|
||||
*/
|
||||
|
||||
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";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
Whitespace-only changes.
@@ -1,38 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"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.
@@ -1,373 +0,0 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
},
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,178 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Beta 6 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 15 Jan 2015
|
||||
*/
|
||||
|
||||
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 . '`';
|
||||
}
|
||||
|
||||
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.
@@ -1,41 +0,0 @@
|
||||
{
|
||||
"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
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 15 Jan 2015
|
||||
*/
|
||||
|
||||
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 2
|
||||
* Fix the imported ipb3 words
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
$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 step2()
|
||||
{
|
||||
\IPS\Db::i()->delete('core_tasks', array('`key`=? and app=?', 'searchcleanup', 'core' ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,36 +0,0 @@
|
||||
{
|
||||
"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.
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 15 Jan 2015
|
||||
*/
|
||||
|
||||
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.
@@ -1,45 +0,0 @@
|
||||
{
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 24 Feb 2015
|
||||
*/
|
||||
|
||||
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.
@@ -1,68 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 25 Feb 2015
|
||||
*/
|
||||
|
||||
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\Friendly::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\Settings::i()->changeValues( array( 'furl_configuration' => $customDefinitions ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Updating FURL definitions";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,364 +0,0 @@
|
||||
{
|
||||
"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
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 5 Mar 2015
|
||||
*/
|
||||
|
||||
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
|
||||
* 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 step2()
|
||||
{
|
||||
\IPS\Db::i()->delete( 'core_follow', array( 'follow_member_id=?', 0 ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step2CustomTitle()
|
||||
{
|
||||
return "Clean up guest followers";
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 3
|
||||
* 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 step3()
|
||||
{
|
||||
if( \IPS\Db::i()->select( 'count(*)', 'core_attachments_map', "location_key=1" )->first() )
|
||||
{
|
||||
foreach ( \IPS\Content::routedClasses( FALSE, TRUE ) as $class )
|
||||
{
|
||||
if ( isset( $class::$databaseColumnMap['content'] ) )
|
||||
{
|
||||
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 step3CustomTitle()
|
||||
{
|
||||
return "Fixing broken attachment maps";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,155 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 17 Mar 2015
|
||||
*/
|
||||
|
||||
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.
@@ -1,128 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 RC7 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 20 Mar 2015
|
||||
*/
|
||||
|
||||
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();
|
||||
|
||||
if( \IPS\Db::i()->select( 'COUNT(*)', 'core_notifications' )->first() )
|
||||
{
|
||||
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.
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"core_members",
|
||||
{
|
||||
"pp_photo_type": "custom"
|
||||
},
|
||||
[
|
||||
"pp_photo_type=?",
|
||||
"upload"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.0 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 3 Apr 2015
|
||||
*/
|
||||
|
||||
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' => \IPS\Text\Parser::utf8mb4SafeDecode( $emoticon['typed'] ) ), array( 'id=?', $emoticon['id'] ) );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Fixing emoticons";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,129 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.1 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 10 Apr 2015
|
||||
*/
|
||||
|
||||
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)
|
||||
*/
|
||||
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";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,43 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.5 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 27 Apr 2015
|
||||
*/
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,190 +0,0 @@
|
||||
{
|
||||
"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
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.7 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 28 May 2015
|
||||
*/
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"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'"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.8 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 17 Jun 2015
|
||||
*/
|
||||
|
||||
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 ) )
|
||||
{
|
||||
\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' => \IPS\Request::i()->mr ) ) ) );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Adjusting search index";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.8.1 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 18 Jun 2015
|
||||
*/
|
||||
|
||||
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 finish()
|
||||
{
|
||||
\IPS\Log::pruneLogs( 1 );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,135 +0,0 @@
|
||||
{
|
||||
"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
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.9 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 11 Jun 2015
|
||||
*/
|
||||
|
||||
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\Settings::i()->changeValues( array( 'max_video_width_css' => \IPS\Settings::i()->max_video_width . 'px' ) );
|
||||
}
|
||||
|
||||
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 ) )
|
||||
{
|
||||
\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' => \IPS\Request::i()->mr ) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step2CustomTitle()
|
||||
{
|
||||
return "Correcting invalid group mappings";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,56 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.10 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 06 Jul 2015
|
||||
*/
|
||||
|
||||
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();
|
||||
|
||||
/* If this is the first cycle, make sure votes column can hold all the votes */
|
||||
if( $limit === 0 )
|
||||
{
|
||||
\IPS\Db::i()->changeColumn( 'core_polls', 'votes', array(
|
||||
'name' => 'votes',
|
||||
'type' => 'int',
|
||||
'length' => null,
|
||||
'unsigned' => false,
|
||||
'allow_null' => false,
|
||||
'default' => "0"
|
||||
) );
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$poll->save();
|
||||
}
|
||||
catch( \IPS\Db\Exception $e )
|
||||
{
|
||||
\IPS\Log::log( $e, 'upgrade_error' );
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $did )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Fixing polls";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,51 +0,0 @@
|
||||
{
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.11 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 14 Jul 2015
|
||||
*/
|
||||
|
||||
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()
|
||||
{
|
||||
if( \IPS\Db::i()->select( 'COUNT(*)', 'core_notifications' )->first() )
|
||||
{
|
||||
$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";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,41 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,132 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.12 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 14 Jul 2015
|
||||
*/
|
||||
|
||||
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 css_set_id, css_app, css_location, css_path, css_name, 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 ) )
|
||||
{
|
||||
\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' => \IPS\Request::i()->mr ) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step3CustomTitle()
|
||||
{
|
||||
return "Fixing incorrect custom field URLs";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,145 +0,0 @@
|
||||
{
|
||||
"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
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,189 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.0.13 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 31 Jul 2015
|
||||
*/
|
||||
|
||||
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()
|
||||
{
|
||||
if( \IPS\Db::i()->select( 'COUNT(*)', 'core_notifications' )->first() )
|
||||
{
|
||||
$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 ) )
|
||||
{
|
||||
\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' => \IPS\Request::i()->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\Settings::i()->changeValues( array( 'posts_add_nofollow_exclude' => json_encode( array_values( $domains ) ) ) );
|
||||
}
|
||||
|
||||
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.
@@ -1,97 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief Upgrader: Custom Upgrade Options
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 26 Oct 2015
|
||||
*/
|
||||
|
||||
$options = array();
|
||||
|
||||
/* Check utilitiesMenu */
|
||||
try
|
||||
{
|
||||
$affectedThemes = array();
|
||||
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_theme_templates', array( array( 'template_set_id > 0 and template_name=? and template_group=? and template_app=? and template_location=?', 'globalTemplate', 'global', 'core', 'front' ) ) ) as $template )
|
||||
{
|
||||
if ( mb_stristr( $template['template_content'], '{template="utilitiesMenu"' ) )
|
||||
{
|
||||
$affectedThemes[] = $template['template_set_id'];
|
||||
}
|
||||
}
|
||||
|
||||
if ( \count( $affectedThemes ) )
|
||||
{
|
||||
$options[] = new \IPS\Helpers\Form\Radio( '101000_globalTemplate_revert', 'no', TRUE, array( 'options' => array( 'yes' => '101000_yes', 'no' => '101000_no' ) ) );
|
||||
}
|
||||
}
|
||||
catch( \Exception $ex ) { }
|
||||
|
||||
/* We are going to go ahead and disable applications and plugins to prevent 3rd party code from breaking the upgrader (and/or the suite post-upgrade) - this doesn't
|
||||
apply if we're upgrading from a version before 4.0 (i.e. 3.x) since they won't have any applications or plugins */
|
||||
if ( $application->long_version >= 40000 and !\IPS\NO_WRITES )
|
||||
{
|
||||
$disabledAppNames = array();
|
||||
$disabledPluginNames = array();
|
||||
|
||||
/* Loop Apps */
|
||||
$language = \IPS\Lang::load( \IPS\Lang::defaultLanguage() );
|
||||
|
||||
foreach ( \IPS\Application::applications() as $_app )
|
||||
{
|
||||
if ( $_app->enabled and !\in_array( $_app->directory, \IPS\IPS::$ipsApps ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$disabledAppNames[] = $language->get( '__app_' . $_app->directory );
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
{
|
||||
$disabledAppNames[] = $_app->directory;
|
||||
}
|
||||
|
||||
$_app->enabled = FALSE;
|
||||
$_app->save( TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
/* Look Plugins */
|
||||
if( \IPS\Db::i()->checkForTable( 'core_plugins' ) )
|
||||
{
|
||||
foreach ( \IPS\Plugin::plugins() as $plugin )
|
||||
{
|
||||
if ( $plugin->enabled )
|
||||
{
|
||||
$plugin->enabled = FALSE;
|
||||
|
||||
try
|
||||
{
|
||||
$plugin->save();
|
||||
}
|
||||
catch( \IPS\Db\Exception $e )
|
||||
{
|
||||
/* Column may be missing from a table, i.e. upgrading from an old version where set_cache_key doesn't exist */
|
||||
if( $e->getCode() != 1054 )
|
||||
{
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
$disabledPluginNames[] = $plugin->_title;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( \count( $disabledAppNames ) OR \count( $disabledPluginNames ) )
|
||||
{
|
||||
$_SESSION['upgrade_postUpgrade']['core'][101000] = \IPS\Theme::i()->getTemplate( 'global' )->disabled3rdParty( $disabledAppNames, $disabledPluginNames );
|
||||
|
||||
/* Show us what is disabled */
|
||||
$options[] = new \IPS\Helpers\Form\Custom( '101000_disable_3rdparty', null, FALSE, array( 'getHtml' => function( $element ) use ( $disabledAppNames, $disabledPluginNames ){
|
||||
return \IPS\Theme::i()->getTemplate( 'global' )->disabled3rdParty( $disabledAppNames, $disabledPluginNames );
|
||||
} ), function( $val ) {}, NULL, NULL, '101000_disable_3rdparty' );
|
||||
}
|
||||
}
|
||||
@@ -1,712 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "createTable",
|
||||
"params": [
|
||||
{
|
||||
"name": "core_menu",
|
||||
"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"
|
||||
},
|
||||
"app": {
|
||||
"name": "app",
|
||||
"type": "VARCHAR",
|
||||
"length": 250,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": null,
|
||||
"comment": "The application key for the item",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"extension": {
|
||||
"name": "extension",
|
||||
"type": "VARCHAR",
|
||||
"length": 255,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "The FrontNavigation extension key",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"config": {
|
||||
"name": "config",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "Any additional configuration",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"position": {
|
||||
"name": "position",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "1",
|
||||
"comment": "This item's position within the bar",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"parent": {
|
||||
"name": "parent",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "The ID of the parent item if this is on the second bar, or NULL if the first bar",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"permissions": {
|
||||
"name": "permissions",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": null,
|
||||
"comment": "Comma-delimited list of group IDs, or * for all",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"PRIMARY": {
|
||||
"type": "primary",
|
||||
"name": "PRIMARY",
|
||||
"columns": [
|
||||
"id"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "createTable",
|
||||
"params": [
|
||||
{
|
||||
"name": "core_streams",
|
||||
"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"
|
||||
},
|
||||
"classes": {
|
||||
"name": "classes",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "The classes this stream will pull from or null for all",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"containers": {
|
||||
"name": "containers",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "A JSON-encoded array of classes to allowed containers or NULL for all",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"read": {
|
||||
"name": "read",
|
||||
"type": "ENUM",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [
|
||||
"all",
|
||||
"unread"
|
||||
],
|
||||
"allow_null": false,
|
||||
"default": "all",
|
||||
"comment": "If the stream only includes unread items",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"follow": {
|
||||
"name": "follow",
|
||||
"type": "ENUM",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [
|
||||
"all",
|
||||
"followed"
|
||||
],
|
||||
"allow_null": false,
|
||||
"default": "all",
|
||||
"comment": "If the stream only shows followed content",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"date_start": {
|
||||
"name": "date_start",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "If using a custom date, the start date",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"position": {
|
||||
"name": "position",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": null,
|
||||
"comment": "The position in the list",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"member": {
|
||||
"name": "member",
|
||||
"type": "MEDIUMINT",
|
||||
"length": 8,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "The member who created the stream or null for a global stream",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"sort": {
|
||||
"name": "sort",
|
||||
"type": "ENUM",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [
|
||||
"newest",
|
||||
"oldest"
|
||||
],
|
||||
"allow_null": false,
|
||||
"default": "newest",
|
||||
"comment": "Whether the stream sorts newest first or oldest first by default",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"date_type": {
|
||||
"name": "date_type",
|
||||
"type": "ENUM",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [
|
||||
"all",
|
||||
"last_visit",
|
||||
"custom",
|
||||
"relative"
|
||||
],
|
||||
"allow_null": false,
|
||||
"default": "all",
|
||||
"comment": "The date range for the stream",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"date_end": {
|
||||
"name": "date_end",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "If using a custom date, the end date",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"date_relative_days": {
|
||||
"name": "date_relative_days",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "If using a relative date period, the number of days",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"custom_members": {
|
||||
"name": "custom_members",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "If using custom ownership, the member IDs",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"tags": {
|
||||
"name": "tags",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "Tags to match",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"followed_types": {
|
||||
"name": "followed_types",
|
||||
"type": "SET",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [
|
||||
"containers",
|
||||
"items",
|
||||
"members"
|
||||
],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "If filtering by followed content, what kind of follows to include",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"ownership": {
|
||||
"name": "ownership",
|
||||
"type": "ENUM",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [
|
||||
"all",
|
||||
"started",
|
||||
"postedin",
|
||||
"custom"
|
||||
],
|
||||
"allow_null": false,
|
||||
"default": "all",
|
||||
"comment": "Stream pulls all content or only content the viewer has started or posted in",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"include_comments": {
|
||||
"name": "include_comments",
|
||||
"type": "TINYINT",
|
||||
"length": 1,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "1",
|
||||
"comment": "Should comments and reviews be included?",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"title": {
|
||||
"name": "title",
|
||||
"type": "VARCHAR",
|
||||
"length": 255,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "If this is a member-created stream, the title (admin created streams use language strings)",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"default": {
|
||||
"name": "default",
|
||||
"type": "TINYINT",
|
||||
"length": 1,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "Default item shows to the right of the top breadcrumb navigation",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"PRIMARY": {
|
||||
"type": "primary",
|
||||
"name": "PRIMARY",
|
||||
"columns": [
|
||||
"id"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_follow",
|
||||
{
|
||||
"name": "follow_index_id",
|
||||
"type": "BIGINT",
|
||||
"length": 20,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "The ID from core_search_index",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_search_index"
|
||||
]
|
||||
},
|
||||
"5": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_search_index",
|
||||
{
|
||||
"name": "index_item_index_id",
|
||||
"type": "BIGINT",
|
||||
"length": 20,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "The index ID of the item",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"6": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_search_index",
|
||||
{
|
||||
"name": "index_item_author",
|
||||
"type": "MEDIUMINT",
|
||||
"length": 8,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "The author of the item",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"7": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_members",
|
||||
{
|
||||
"name": "member_streams",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"8": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_members",
|
||||
{
|
||||
"name": "photo_last_update",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"9": {
|
||||
"method": "dropColumn",
|
||||
"params": [
|
||||
"core_members",
|
||||
"vnc_preferences"
|
||||
]
|
||||
},
|
||||
"10": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"core_search_index",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "index_date_created",
|
||||
"columns": [
|
||||
"index_date_created"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"11": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_emoticons",
|
||||
{
|
||||
"name": "image_2x",
|
||||
"type": "TEXT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"12": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_emoticons",
|
||||
{
|
||||
"name": "width",
|
||||
"type": "SMALLINT",
|
||||
"length": 3,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"13": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_emoticons",
|
||||
{
|
||||
"name": "height",
|
||||
"type": "SMALLINT",
|
||||
"length": 3,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"14": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"core_search_index",
|
||||
{
|
||||
"type": "fulltext",
|
||||
"name": "index_tags",
|
||||
"columns": [
|
||||
"index_tags"
|
||||
],
|
||||
"length": [
|
||||
250
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"15": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"core_polls",
|
||||
"votes",
|
||||
{
|
||||
"name": "votes",
|
||||
"type": "INT",
|
||||
"length": null,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"16": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_search_index",
|
||||
{
|
||||
"name": "index_is_last_comment",
|
||||
"type": "TINYINT",
|
||||
"length": 1,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "Is this the last comment\/review on an item?",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"17": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"core_soft_delete_log",
|
||||
"sdl_obj_key",
|
||||
{
|
||||
"name": "sdl_obj_key",
|
||||
"type": "VARCHAR",
|
||||
"length": 128,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "",
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"18": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"core_search_index",
|
||||
{
|
||||
"type": "fulltext",
|
||||
"name": "index_title",
|
||||
"columns": [
|
||||
"index_title"
|
||||
],
|
||||
"length": [
|
||||
250
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,703 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.0 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 29 Jul 2015
|
||||
*/
|
||||
|
||||
namespace IPS\core\setup\upg_101000;
|
||||
|
||||
/* 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.1.0 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Step 1: Sort out the global template
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
/* Drop globalTemplates */
|
||||
if ( isset( $_SESSION['upgrade_options']['core']['101000']['globalTemplate_revert'] ) and $_SESSION['upgrade_options']['core']['101000']['globalTemplate_revert'] == 'yes' )
|
||||
{
|
||||
$templateIds = array();
|
||||
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_theme_templates', array( array( 'template_set_id > 0 and template_name=? and template_group=? and template_app=? and template_location=?', 'globalTemplate', 'global', 'core', 'front' ) ) ) as $template )
|
||||
{
|
||||
if ( mb_stristr( $template['template_content'], '{template="utilitiesMenu"' ) )
|
||||
{
|
||||
$templateIds[] = $template['template_id'];
|
||||
}
|
||||
}
|
||||
|
||||
if ( \count( $templateIds ) )
|
||||
{
|
||||
\IPS\Db::i()->delete( 'core_theme_templates', array( \IPS\Db::i()->in( 'template_id', $templateIds ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Upgrading menu";
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 2: Add email to upgrade notification 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_sys_conf_settings', array( 'conf_value' => \IPS\Settings::i()->email_in ), "conf_key = 'upgrade_email'" );
|
||||
\IPS\Settings::i()->clearCache();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step2CustomTitle()
|
||||
{
|
||||
return "Setting upgrade notifications email address";
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 3: Upgrade emoticons
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
$json = json_decode( file_get_contents( \IPS\ROOT_PATH . '/' . \IPS\CP_DIRECTORY ."/install/emoticons/data.json" ), TRUE );
|
||||
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_emoticons', \IPS\Db::i()->in( 'typed', array_keys( $json ) ) ) as $emoticon )
|
||||
{
|
||||
if( !isset( $json[ $emoticon['typed'] ]['image_2x'] ) or !file_exists(\IPS\ROOT_PATH . '/' . \IPS\CP_DIRECTORY . "/install/emoticons/" . $json[ $emoticon['typed'] ]['image_2x'] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$imageDimensions = \IPS\File::get( 'core_Emoticons', $emoticon['image'] )->getImageDimensions();
|
||||
$fileObj2x = \IPS\File::create( 'core_Emoticons', $json[ $emoticon['typed'] ]['image_2x'], NULL, 'emoticons', TRUE, \IPS\ROOT_PATH . '/' . \IPS\CP_DIRECTORY . "/install/emoticons/" . $json[ $emoticon['typed'] ]['image_2x'], FALSE );
|
||||
|
||||
$update = array(
|
||||
'image_2x' => (string) $fileObj2x,
|
||||
'width' => $imageDimensions[0] ,
|
||||
'height' => $imageDimensions[1]
|
||||
);
|
||||
\IPS\Db::i()->update( 'core_emoticons', $update, array( 'typed=?', $emoticon['typed'] ) );
|
||||
}
|
||||
catch( \Exception $ex ) { }
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step3CustomTitle()
|
||||
{
|
||||
return "Upgrading emoticons";
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 4: Populate default streams
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
/* Grab the inserts from the schematic as they will always be the most up to date */
|
||||
$json = json_decode( file_get_contents( \IPS\ROOT_PATH . '/applications/core/data/schema.json' ), TRUE );
|
||||
|
||||
foreach( $json['core_streams']['inserts'] as $data )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\Db::i()->insert( 'core_streams', $data );
|
||||
}
|
||||
catch( \IPS\Db\Exception $ex ) { }
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step4CustomTitle()
|
||||
{
|
||||
return "Populating default streams";
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 5
|
||||
* Fix followers from a 3.x upgrade - We have to do this here because the original code was wrong, and we need to fix people affected between then and now
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
/* Init */
|
||||
$perCycle = 500;
|
||||
$did = 0;
|
||||
$limit = \intval( \IPS\Request::i()->extra );
|
||||
|
||||
/* Because follow_id gets changed in the process, we have to copy data to a temporary table first */
|
||||
if ( !$limit )
|
||||
{
|
||||
$tableDefinition = \IPS\Db::i()->getTableDefinition( 'core_follow' );
|
||||
\IPS\Db::i()->renameTable( 'core_follow', 'core_follow_backup' );
|
||||
\IPS\Db::i()->createTable( $tableDefinition );
|
||||
}
|
||||
|
||||
/* Try to prevent timeouts to the extent possible */
|
||||
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
|
||||
|
||||
/* Now do it - sort by follow_added ASC so that we do them in reverse order so if a new record was added which is now correct, that is what gets maintained */
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_follow_backup', NULL, 'follow_added ASC', array( $limit, $perCycle ) ) as $follow )
|
||||
{
|
||||
/* Try to prevent timeouts to the extent possible */
|
||||
if( $cutOff !== null AND time() >= $cutOff )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
|
||||
/* Increase the counter */
|
||||
$did++;
|
||||
|
||||
/* Figure out what to update */
|
||||
$insert = $follow;
|
||||
switch( $follow['follow_area'] )
|
||||
{
|
||||
case 'topics':
|
||||
$insert['follow_area'] = 'topic';
|
||||
$insert['follow_id'] = md5( 'forums;topic;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
|
||||
break;
|
||||
|
||||
case 'forums':
|
||||
$insert['follow_area'] = 'forum';
|
||||
$insert['follow_id'] = md5( 'forums;forum;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
|
||||
break;
|
||||
|
||||
case 'files':
|
||||
$insert['follow_area'] = 'file';
|
||||
$insert['follow_id'] = md5( 'downloads;file;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
|
||||
break;
|
||||
|
||||
case 'images':
|
||||
$insert['follow_area'] = 'image';
|
||||
$insert['follow_id'] = md5( 'gallery;image;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
|
||||
break;
|
||||
|
||||
case 'entries':
|
||||
$insert['follow_area'] = 'entry';
|
||||
$insert['follow_id'] = md5( 'blog;entry;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
|
||||
break;
|
||||
|
||||
case 'calendars':
|
||||
$insert['follow_area'] = 'calendar';
|
||||
$insert['follow_id'] = md5( 'calendar;calendar;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
|
||||
break;
|
||||
|
||||
case 'categories':
|
||||
$insert['follow_area'] = 'category';
|
||||
$insert['follow_id'] = md5( $follow['follow_app'] . ';category;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
|
||||
break;
|
||||
|
||||
case 'albums':
|
||||
$insert['follow_area'] = 'album';
|
||||
$insert['follow_id'] = md5( 'gallery;album;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
|
||||
break;
|
||||
|
||||
case 'events':
|
||||
$insert['follow_area'] = 'event';
|
||||
$insert['follow_id'] = md5( 'calendar;event;' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
|
||||
break;
|
||||
|
||||
default:
|
||||
if ( mb_strpos( $follow['follow_area'], 'ccs_custom_database' ) === 0 )
|
||||
{
|
||||
$data = explode( '_', str_replace( 'ccs_custom_database_', '', $follow['follow_area'] ) );
|
||||
$insert['follow_app'] = 'cms';
|
||||
$insert['follow_area'] = $data[1] . $data[0];
|
||||
$insert['follow_id'] = md5( 'cms;' . $insert['follow_area'] . ';' . $follow['follow_rel_id'] . ';' . $follow['follow_member_id'] );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* And insert */
|
||||
\IPS\Db::i()->replace( 'core_follow', $insert );
|
||||
}
|
||||
|
||||
/* More to do? */
|
||||
if( $did )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
/* Nope - carry on */
|
||||
else
|
||||
{
|
||||
\IPS\Db::i()->dropTable( 'core_follow_backup' );
|
||||
unset( $_SESSION['_step5Count'] );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step5CustomTitle()
|
||||
{
|
||||
$limit = isset( \IPS\Request::i()->extra ) ? \IPS\Request::i()->extra : 0;
|
||||
|
||||
if( !isset( $_SESSION['_step5Count'] ) )
|
||||
{
|
||||
$_SESSION['_step5Count'] = \IPS\Db::i()->select( 'COUNT(*)', 'core_follow' )->first();
|
||||
}
|
||||
|
||||
return "Fixing existing follows (Fixed so far: " . ( ( $limit > $_SESSION['_step5Count'] ) ? $_SESSION['_step5Count'] : $limit ) . ' out of ' . $_SESSION['_step5Count'] . ')';
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 6: Adjust email SMTP host/protocol
|
||||
*
|
||||
* @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 step6()
|
||||
{
|
||||
/* We only need to do this if there is an SMTP host and it is something like tls://domain */
|
||||
if( \IPS\Settings::i()->smtp_host AND mb_strpos( \IPS\Settings::i()->smtp_host, '://' ) !== FALSE )
|
||||
{
|
||||
/* First we need to insert the setting since it won't be present just yet */
|
||||
\IPS\Db::i()->replace( 'core_sys_conf_settings', array( 'conf_key' => 'smtp_protocol', 'conf_default' => 'plain', 'conf_app' => 'core' ) );
|
||||
|
||||
/* Now figure out what we need to set it to */
|
||||
$protocol = mb_substr( \IPS\Settings::i()->smtp_host, 0, mb_strpos( \IPS\Settings::i()->smtp_host, '://' ) );
|
||||
$host = mb_substr( \IPS\Settings::i()->smtp_host, mb_strpos( \IPS\Settings::i()->smtp_host, '://' ) + 3 );
|
||||
|
||||
/* And update */
|
||||
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => $host ), "conf_key = 'smtp_host'" );
|
||||
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => $protocol ), "conf_key = 'smtp_protocol'" );
|
||||
\IPS\Settings::i()->clearCache();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step6CustomTitle()
|
||||
{
|
||||
return "Adjusting email configuration";
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 7: Remove some legacy columns if they still exist
|
||||
*
|
||||
* @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 step7()
|
||||
{
|
||||
if ( \IPS\Db::i()->checkForColumn( 'core_bulk_mail', 'mail_pergo' ) )
|
||||
{
|
||||
$columns[] = 'mail_pergo';
|
||||
}
|
||||
|
||||
if ( \IPS\Db::i()->checkForColumn( 'core_bulk_mail', 'mail_groups' ) )
|
||||
{
|
||||
$columns[] = 'mail_groups';
|
||||
}
|
||||
|
||||
if( \count( $columns ) )
|
||||
{
|
||||
\IPS\Db::i()->dropColumn( 'core_bulk_mail', $columns );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step7CustomTitle()
|
||||
{
|
||||
return "Cleaning up bulk mail database table";
|
||||
}
|
||||
|
||||
/**
|
||||
* Update widgets and menu
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
/* Create the new default configuration */
|
||||
\IPS\core\FrontNavigation::buildDefaultFrontNavigation();
|
||||
$maxPosition = \IPS\Db::i()->select( 'MAX(position)', 'core_menu', 'parent IS NULL' )->first();
|
||||
|
||||
/* Add the home link if necessary */
|
||||
if ( \IPS\Settings::i()->show_home_link )
|
||||
{
|
||||
$id = \IPS\Db::i()->insert( 'core_menu', array(
|
||||
'app' => 'core',
|
||||
'extension' => 'CustomItem',
|
||||
'config' => json_encode( array( 'menu_custom_item_url' => \IPS\Settings::i()->home_url ) ),
|
||||
'position' => ++$maxPosition,
|
||||
'parent' => NULL,
|
||||
'permissions' => '*',
|
||||
) );
|
||||
\IPS\Lang::copyCustom( 'core', 'home_name_value', "menu_item_{$id}" );
|
||||
\IPS\Lang::deleteCustom( 'core', 'home_name_value' );
|
||||
}
|
||||
|
||||
/* We have to fix nexus language bits */
|
||||
if ( \IPS\Application::appIsEnabled('nexus') )
|
||||
{
|
||||
/* There is a support tab we will need to fix */
|
||||
$menu = \IPS\Db::i()->select( 'id', 'core_menu', array( "extension=? AND config LIKE '%app=nexus%' AND parent IS NULL", 'CustomItem' ) )->first();
|
||||
|
||||
\IPS\Lang::saveCustom( 'nexus', 'menu_item_' . $menu, 'Support' );
|
||||
|
||||
/* There is a my details menu we will need to fix */
|
||||
$menu = \IPS\Db::i()->select( 'parent', 'core_menu', array( "app=? AND is_menu_child=?", 'nexus', 1 ) )->first();
|
||||
|
||||
\IPS\Lang::saveCustom( 'nexus', 'menu_item_' . $menu, 'My Details' );
|
||||
}
|
||||
|
||||
/* And pages? */
|
||||
if ( \IPS\Application::appIsEnabled('cms') )
|
||||
{
|
||||
$rootId = \IPS\Db::i()->insert( 'core_menu', array(
|
||||
'app' => 'core',
|
||||
'extension' => 'CustomItem',
|
||||
'config' => json_encode( array( 'menu_custom_item_url' => 'app=cms&module=pages&controller=page', 'internal' => '' ) ),
|
||||
'position' => ++$maxPosition,
|
||||
'parent' => NULL,
|
||||
'permissions' => '*',
|
||||
) );
|
||||
|
||||
/* 3.x to 4.x won't have language strings installed at this point */
|
||||
try
|
||||
{
|
||||
$pagesLang = \IPS\Lang::load( \IPS\Lang::defaultLanguage() )->get("__app_cms");
|
||||
}
|
||||
catch( \UnderflowException $ex )
|
||||
{
|
||||
$pagesLang = "Pages";
|
||||
}
|
||||
|
||||
\IPS\Lang::saveCustom( 'core', "menu_item_{$rootId}", $pagesLang );
|
||||
|
||||
$position = 1;
|
||||
foreach ( \IPS\Db::i()->select( '*', 'cms_page_menu' ) as $menuItem )
|
||||
{
|
||||
if ( $menuItem['menu_type'] == 'page' )
|
||||
{
|
||||
/* We need to make sure the page actually exists, otherwise the site will be down with a 500 ISE after upgrade */
|
||||
try
|
||||
{
|
||||
$_page = \IPS\Db::i()->select( 'page_id', 'cms_pages', array( 'page_id=?', $menuItem['menu_content'] ) )->first();
|
||||
}
|
||||
catch( \UnderflowException $e )
|
||||
{
|
||||
/* If the page doesn't exist, just don't add it to the core_menu table and continue */
|
||||
continue;
|
||||
}
|
||||
|
||||
$app = 'cms';
|
||||
$extension = 'Pages';
|
||||
$config = array( 'menu_content_page' => $menuItem['menu_content'], 'menu_title_page_type' => ( $menuItem['menu_title'] ? 1 : 0 ) );
|
||||
}
|
||||
elseif ( $menuItem['menu_type'] == 'folder' )
|
||||
{
|
||||
$app = 'core';
|
||||
$extension = 'Menu';
|
||||
$config = array();
|
||||
}
|
||||
elseif ( $menuItem['menu_type'] == 'url' )
|
||||
{
|
||||
$app = 'core';
|
||||
$extension = 'CustomItem';
|
||||
$config = array( 'menu_custom_item_url' => $menuItem['menu_content'] );
|
||||
}
|
||||
|
||||
$_id = \IPS\Db::i()->insert( 'core_menu', array(
|
||||
'id' => $menuItem['menu_id'] + $rootId,
|
||||
'app' => $app,
|
||||
'extension' => $extension,
|
||||
'config' => json_encode( $config ),
|
||||
'position' => $position++,
|
||||
'parent' => $menuItem['menu_parent_id'] ? ( $menuItem['menu_parent_id'] + $rootId ) : $rootId,
|
||||
'permissions' => $menuItem['menu_permission'] == 'page' ? '*' : $menuItem['menu_permission'],
|
||||
) );
|
||||
|
||||
if ( $menuItem['menu_type'] == 'folder' or $menuItem['menu_type'] == 'url' )
|
||||
{
|
||||
\IPS\Lang::copyCustom( 'cms', "cms_menu_title_{$menuItem['menu_id']}", "menu_item_{$_id}", 'core' );
|
||||
\IPS\Lang::deleteCustom( 'cms', "cms_menu_title_{$menuItem['menu_id']}" );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Lang::copyCustom( 'cms', "cms_menu_title_{$menuItem['menu_id']}", "cms_menu_title_{$_id}" );
|
||||
\IPS\Lang::deleteCustom( 'cms', "cms_menu_title_{$menuItem['menu_id']}" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
\IPS\Db::i()->dropTable('cms_page_menu');
|
||||
}
|
||||
|
||||
$areas = array( 'core_widget_areas' );
|
||||
if ( \IPS\Application::appIsEnabled('cms') )
|
||||
{
|
||||
$areas[] = 'cms_page_widget_areas';
|
||||
}
|
||||
|
||||
foreach ( $areas as $table )
|
||||
{
|
||||
foreach ( \IPS\Db::i()->select( '*', $table ) as $area )
|
||||
{
|
||||
$widgetsColumn = $table == 'core_widget_areas' ? 'widgets' : 'area_widgets';
|
||||
$whereClause = $table == 'core_widget_areas' ? array( 'id=? AND area=?', $area['id'], $area['area'] ) : array( 'area_page_id=? AND area_area=?', $area['area_page_id'], $area['area_area'] );
|
||||
|
||||
$widgets = json_decode( $area[ $widgetsColumn ], TRUE );
|
||||
$update = FALSE;
|
||||
|
||||
foreach ( $widgets as $k => $widget )
|
||||
{
|
||||
if ( $widget['key'] == 'topicFeed' )
|
||||
{
|
||||
if ( isset( $widgets[ $k ]['configuration'] ) )
|
||||
{
|
||||
$update = TRUE;
|
||||
$config = array();
|
||||
foreach ( $widgets[ $k ]['configuration'] as $_k => $_v )
|
||||
{
|
||||
if ( $_k === 'widget_feed_status' )
|
||||
{
|
||||
if ( \in_array( 'open', $_v ) and \in_array( 'closed', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_locked'] = 'any';
|
||||
}
|
||||
else if ( \in_array( 'open', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_locked'] = 'open';
|
||||
}
|
||||
else if ( \in_array( 'closed', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_locked'] = 'closed';
|
||||
}
|
||||
|
||||
if ( \in_array( 'pinned', $_v ) and \in_array( 'notpinned', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_pinned'] = 'any';
|
||||
}
|
||||
else if ( \in_array( 'pinned', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_pinned'] = 'open';
|
||||
}
|
||||
else if ( \in_array( 'notpinned', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_pinned'] = 'closed';
|
||||
}
|
||||
|
||||
if ( \in_array( 'featured', $_v ) and \in_array( 'notfeatured', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_pinned'] = 'any';
|
||||
}
|
||||
else if ( \in_array( 'featured', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_pinned'] = 'featured';
|
||||
}
|
||||
else if ( \in_array( 'notfeatured', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_pinned'] = 'notfeatured';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$widgets[ $k ]['configuration'][ $_k ] = $_v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $widget['key'] == 'postFeed' )
|
||||
{
|
||||
if ( isset( $widgets[ $k ]['configuration'] ) )
|
||||
{
|
||||
$update = TRUE;
|
||||
$config = array();
|
||||
foreach ( $widgets[ $k ]['configuration'] as $_k => $_v )
|
||||
{
|
||||
if ( \in_array( $_k, array( 'tfb_show', 'tfb_sort_dir', 'tfb_use_perms', 'tfb_topic_status' ) ) )
|
||||
{
|
||||
$_k = str_replace( 'tfb_', 'widget_feed', $_k );
|
||||
}
|
||||
else
|
||||
{
|
||||
$_k = str_replace( 'tfb_', 'widget_feed_item', $_k );
|
||||
}
|
||||
|
||||
if ( $_k == 'widget_feed_topic_status' )
|
||||
{
|
||||
if ( \in_array( 'open', $_v ) and \in_array( 'closed', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_item_status_locked'] = 'any';
|
||||
}
|
||||
else if ( \in_array( 'open', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_item_status_locked'] = 'open';
|
||||
}
|
||||
else if ( \in_array( 'closed', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_item_status_locked'] = 'closed';
|
||||
}
|
||||
|
||||
if ( \in_array( 'pinned', $_v ) and \in_array( 'notpinned', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_item_status_pinned'] = 'any';
|
||||
}
|
||||
else if ( \in_array( 'pinned', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_item_status_pinned'] = 'open';
|
||||
}
|
||||
else if ( \in_array( 'notpinned', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_item_status_pinned'] = 'closed';
|
||||
}
|
||||
|
||||
if ( \in_array( 'featured', $_v ) and \in_array( 'notfeatured', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_item_status_pinned'] = 'any';
|
||||
}
|
||||
else if ( \in_array( 'featured', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_item_status_pinned'] = 'featured';
|
||||
}
|
||||
else if ( \in_array( 'notfeatured', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_item_status_pinned'] = 'notfeatured';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$widgets[ $k ]['configuration'][ $_k ] = $_v;
|
||||
}
|
||||
|
||||
$widgets[ $k ]['configuration'][ $_k ] = $_v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $widget['key'] == 'RecordFeed' )
|
||||
{
|
||||
if ( isset( $widgets[ $k ]['configuration'] ) )
|
||||
{
|
||||
$config = array();
|
||||
foreach ( $widgets[ $k ]['configuration'] as $_k => $_v )
|
||||
{
|
||||
$_k = str_replace( 'cms_rf', 'widget_feed', $_k );
|
||||
if ( $_k == 'widget_feed_record_status' )
|
||||
{
|
||||
$_k = 'widget_feed_status';
|
||||
}
|
||||
|
||||
if ( $_k === 'widget_feed_status' )
|
||||
{
|
||||
if ( \in_array( 'open', $_v ) and \in_array( 'closed', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_locked'] = 'any';
|
||||
}
|
||||
else if ( \in_array( 'open', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_locked'] = 'open';
|
||||
}
|
||||
else if ( \in_array( 'closed', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_locked'] = 'closed';
|
||||
}
|
||||
|
||||
if ( \in_array( 'pinned', $_v ) and \in_array( 'notpinned', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_pinned'] = 'any';
|
||||
}
|
||||
else if ( \in_array( 'pinned', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_pinned'] = 'open';
|
||||
}
|
||||
else if ( \in_array( 'notpinned', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_pinned'] = 'closed';
|
||||
}
|
||||
|
||||
if ( \in_array( 'featured', $_v ) and \in_array( 'notfeatured', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_pinned'] = 'any';
|
||||
}
|
||||
else if ( \in_array( 'featured', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_pinned'] = 'featured';
|
||||
}
|
||||
else if ( \in_array( 'notfeatured', $_v ) )
|
||||
{
|
||||
$widgets[ $k ]['configuration']['widget_feed_status_pinned'] = 'notfeatured';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$widgets[ $k ]['configuration'][ $_k ] = $_v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $update )
|
||||
{
|
||||
\IPS\Db::i()->update( $table, array( $widgetsColumn => json_encode( $widgets ) ), $whereClause );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,71 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"core_follow",
|
||||
{
|
||||
"follow_notify_freq": "immediate"
|
||||
},
|
||||
"follow_notify_freq NOT IN('immediate','daily','weekly','none')"
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "changeIndex",
|
||||
"params": [
|
||||
"core_acronyms",
|
||||
"a_short",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "a_short",
|
||||
"columns": [
|
||||
"a_short"
|
||||
],
|
||||
"length": [
|
||||
250
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"3": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"core_acronyms",
|
||||
"a_short",
|
||||
{
|
||||
"name": "a_short",
|
||||
"type": "TEXT",
|
||||
"length": "",
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"4": {
|
||||
"method": "changeColumn",
|
||||
"params": [
|
||||
"core_acronyms",
|
||||
"a_long",
|
||||
{
|
||||
"name": "a_long",
|
||||
"type": "TEXT",
|
||||
"length": "",
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.0 Beta 2 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 06 Oct 2015
|
||||
*/
|
||||
|
||||
namespace IPS\core\setup\upg_101001;
|
||||
|
||||
/* 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.1.0 Beta 2 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Some file storage extensions (i.e. CMS) may never have been saved in the upload_settings setting, which resulted in the RepairFileUrls not being run against them,
|
||||
* which then results in the files being deleted by the orphaned files tool because the full URL is still stored
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
/* Anything that is not set, we'll assume the same setting as core_Attachment */
|
||||
$settings = json_decode( \IPS\Settings::i()->upload_settings, TRUE );
|
||||
$defaultSetting = $settings['filestorage__core_Attachment'];
|
||||
|
||||
/* Set some variables to help us determine if we need to do anything else after */
|
||||
$hasChanges = FALSE;
|
||||
$applications = array();
|
||||
|
||||
$_SESSION['repairFileUrls'] = false;
|
||||
|
||||
/* Loop over all file storage extensions */
|
||||
foreach ( \IPS\Application::allExtensions( 'core', 'FileStorage', FALSE, NULL, NULL, TRUE ) as $name => $obj )
|
||||
{
|
||||
if( !isset( $settings[ "filestorage__{$name}" ] ) )
|
||||
{
|
||||
$settings[ "filestorage__{$name}" ] = $defaultSetting;
|
||||
$hasChanges = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Now, if we have changes, update the setting and reinitiate the RepairFileUrls background queue task for the affected application(s) */
|
||||
if( $hasChanges )
|
||||
{
|
||||
\IPS\Settings::i()->changeValues( array( 'upload_settings' => json_encode( $settings ) ) );
|
||||
|
||||
$_SESSION['repairFileUrls'] = true;
|
||||
}
|
||||
|
||||
/* That's all ... easy peasy */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Fixing missing upload storage configurations";
|
||||
}
|
||||
|
||||
/**
|
||||
* Orphaned private message maps from older versions can cause errors for specific users
|
||||
*
|
||||
* @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_message_topic_user_map',
|
||||
'query' => "DELETE FROM " . \IPS\Db::i()->prefix . "core_message_topic_user_map WHERE map_topic_id NOT IN(SELECT mt_id FROM " . \IPS\Db::i()->prefix . "core_message_topics)",
|
||||
)
|
||||
);
|
||||
|
||||
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $toRunQueries );
|
||||
|
||||
if ( \count( $toRun ) )
|
||||
{
|
||||
\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' => \IPS\Request::i()->mr ) ) ) );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step2CustomTitle()
|
||||
{
|
||||
return "Removing orphaned personal message maps";
|
||||
}
|
||||
|
||||
/**
|
||||
* Repair URLs
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
if( isset( $_SESSION['repairFileUrls'] ) AND $_SESSION['repairFileUrls'] )
|
||||
{
|
||||
foreach( \IPS\Application::applications() as $app )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::repairFileUrls( $app->directory );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"core_members_warn_reasons",
|
||||
{
|
||||
"wr_remove": "-1"
|
||||
},
|
||||
[
|
||||
"wr_remove=?",
|
||||
0
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,201 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.0 Beta 7 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 16 Oct 2015
|
||||
*/
|
||||
|
||||
namespace IPS\core\setup\upg_101006;
|
||||
|
||||
/* 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.1.0 Beta 7 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Clean up orphaned status updates
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
$toRunQueries = array(
|
||||
array(
|
||||
'table' => 'core_member_status_updates',
|
||||
'query' => "DELETE FROM " . \IPS\Db::i()->prefix . "core_member_status_updates WHERE status_member_id NOT IN(SELECT member_id FROM " . \IPS\Db::i()->prefix . "core_members)",
|
||||
),
|
||||
array(
|
||||
'table' => 'core_member_status_updates',
|
||||
'query' => "DELETE FROM " . \IPS\Db::i()->prefix . "core_member_status_updates WHERE status_author_id NOT IN(SELECT member_id FROM " . \IPS\Db::i()->prefix . "core_members)",
|
||||
)
|
||||
);
|
||||
|
||||
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $toRunQueries );
|
||||
|
||||
if ( \count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( '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' => \IPS\Request::i()->mr ) ) ) );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Removing orphaned status updates";
|
||||
}
|
||||
|
||||
/**
|
||||
* We need to clean up template editing logs
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_admin_logs', array( 'do=? OR do=?', 'deleteTemplate', 'saveTemplate' ) ) as $template )
|
||||
{
|
||||
$update = array();
|
||||
$data = json_decode( $template['note'], TRUE );
|
||||
|
||||
/* deleteTemplate previously just stored "name => FALSE", so we need to populate the rest of the data which we don't have -
|
||||
as this is legacy though and won't be an issue moving forward, it isn't too big a deal */
|
||||
if( $template['do'] == 'deleteTemplate' )
|
||||
{
|
||||
$keys = array_keys( $data );
|
||||
|
||||
$update['note'] = json_encode( array( '(unknown)' => FALSE, '(unknown)' => FALSE, '(unknown)' => FALSE, $keys[0] => FALSE ) );
|
||||
}
|
||||
/* saveTemplate stored all the data but in a way that won't be retrievable, so we need to convert it */
|
||||
else
|
||||
{
|
||||
$update['note'] = json_encode( array( $data['app'] => FALSE, $data['location'] => FALSE, $data['group'] => FALSE, $data['name'] => FALSE ) );
|
||||
}
|
||||
|
||||
\IPS\Db::i()->update( 'core_admin_logs', $update, array( 'id=?', $template['id'] ) );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step2CustomTitle()
|
||||
{
|
||||
return "Adjusting administrator logs";
|
||||
}
|
||||
|
||||
/**
|
||||
* Trim leading path slash if present
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
$toRunQueries = array(
|
||||
array(
|
||||
'table' => 'core_attachments',
|
||||
'query' => "UPDATE " . \IPS\Db::i()->prefix . "core_attachments SET attach_location=SUBSTR( attach_location, 2 ) WHERE attach_location LIKE '/%'",
|
||||
),
|
||||
array(
|
||||
'table' => 'core_attachments',
|
||||
'query' => "UPDATE " . \IPS\Db::i()->prefix . "core_attachments SET attach_thumb_location=SUBSTR( attach_thumb_location, 2 ) WHERE attach_thumb_location LIKE '/%'",
|
||||
)
|
||||
);
|
||||
|
||||
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $toRunQueries );
|
||||
|
||||
if ( \count( $toRun ) )
|
||||
{
|
||||
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( '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' => \IPS\Request::i()->mr ) ) ) );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step3CustomTitle()
|
||||
{
|
||||
return "Fixing broken attachment paths";
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix moderator permissions - containers need to be -1 instead of 0 to represent "all containers"
|
||||
* This has to be run last so that the other app tables have been renamed
|
||||
*
|
||||
* @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 have to figure out which fields are 'node' fields */
|
||||
$nodeFields = array();
|
||||
|
||||
foreach ( \IPS\Application::allExtensions( 'core', 'ModeratorPermissions', FALSE, 'core' ) as $k => $ext )
|
||||
{
|
||||
foreach( $ext->getPermissions( array() ) as $name => $data )
|
||||
{
|
||||
$type = \is_array( $data ) ? $data[0] : $data;
|
||||
|
||||
if( $type == 'Node' )
|
||||
{
|
||||
$nodeFields[ $name ] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Now loop over moderators and fix them */
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_moderators' ) as $moderator )
|
||||
{
|
||||
/* We only need to fix them if the perms aren't * */
|
||||
if( $moderator['perms'] !== '*' )
|
||||
{
|
||||
$perms = json_decode( $moderator['perms'], TRUE );
|
||||
$hasChange = FALSE;
|
||||
|
||||
foreach( $perms as $k => $v )
|
||||
{
|
||||
if( \in_array( $k, $nodeFields ) AND $v == 0 )
|
||||
{
|
||||
$perms[ $k ] = -1;
|
||||
$hasChange = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Only bother updating if we need to */
|
||||
if( $hasChange )
|
||||
{
|
||||
\IPS\Db::i()->update( 'core_moderators', array( 'perms' => json_encode( $perms ) ), array( 'type=? AND id=?', $moderator['type'], $moderator['id'] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "update",
|
||||
"params": [
|
||||
"core_members",
|
||||
{
|
||||
"pp_photo_type": null
|
||||
},
|
||||
[
|
||||
"pp_photo_type=? and ( pp_main_photo=? or pp_main_photo IS NULL )",
|
||||
"custom",
|
||||
""
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,42 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addColumn",
|
||||
"params": [
|
||||
"core_menu",
|
||||
{
|
||||
"name": "is_menu_child",
|
||||
"type": "TINYINT",
|
||||
"length": 1,
|
||||
"decimals": null,
|
||||
"values": [],
|
||||
"allow_null": false,
|
||||
"default": "0",
|
||||
"comment": "If this item is a child of a dropdown menu",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"core_follow",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "follow_stream",
|
||||
"columns": [
|
||||
"follow_app",
|
||||
"follow_area",
|
||||
"follow_member_id"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.3 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 16 Oct 2015
|
||||
*/
|
||||
|
||||
namespace IPS\core\setup\upg_101013;
|
||||
|
||||
/* 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.1.3 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Changes to how child menu items are stored
|
||||
*
|
||||
* @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 = 50;
|
||||
$did = 0;
|
||||
$limit = \intval( \IPS\Request::i()->extra );
|
||||
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
|
||||
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_menu', array( 'app=? AND extension=?', 'core', 'Menu' ), 'id ASC', array( $limit, $perCycle ) ) as $menuItem )
|
||||
{
|
||||
if( $cutOff !== null AND time() >= $cutOff )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
$did++;
|
||||
|
||||
\IPS\Db::i()->update( 'core_menu', array( 'is_menu_child' => 1 ), array( 'parent=?', $menuItem['id'] ) );
|
||||
}
|
||||
|
||||
if( $did )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
else
|
||||
{
|
||||
unset( \IPS\Data\Store::i()->frontNavigation );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Updating menu";
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,128 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "createTable",
|
||||
"params": [
|
||||
{
|
||||
"name": "core_image_proxy",
|
||||
"columns": {
|
||||
"md5_url": {
|
||||
"name": "md5_url",
|
||||
"type": "CHAR",
|
||||
"length": 32,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": false,
|
||||
"default": null,
|
||||
"comment": "The md5sum of the URL",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"location": {
|
||||
"name": "location",
|
||||
"type": "VARCHAR",
|
||||
"length": 255,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": true,
|
||||
"default": null,
|
||||
"comment": "The stored location or NULL if it's invalid",
|
||||
"unsigned": false,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
},
|
||||
"cache_time": {
|
||||
"name": "cache_time",
|
||||
"type": "INT",
|
||||
"length": 10,
|
||||
"decimals": null,
|
||||
"values": null,
|
||||
"allow_null": false,
|
||||
"default": null,
|
||||
"comment": "Timestamp of when the image was cached",
|
||||
"unsigned": true,
|
||||
"zerofill": false,
|
||||
"auto_increment": false,
|
||||
"binary": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"PRIMARY": {
|
||||
"type": "primary",
|
||||
"name": "PRIMARY",
|
||||
"columns": [
|
||||
"md5_url"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
},
|
||||
"cache_time": {
|
||||
"type": "key",
|
||||
"name": "cache_time",
|
||||
"columns": [
|
||||
"cache_time"
|
||||
],
|
||||
"length": [
|
||||
null
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "createTable",
|
||||
"params": [
|
||||
{
|
||||
"name": "core_view_updates",
|
||||
"columns": {
|
||||
"classname": {
|
||||
"allow_null": false,
|
||||
"auto_increment": false,
|
||||
"binary": false,
|
||||
"comment": "Name of the class the view is for",
|
||||
"decimals": null,
|
||||
"default": "",
|
||||
"length": 255,
|
||||
"name": "classname",
|
||||
"type": "VARCHAR",
|
||||
"unsigned": false,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
},
|
||||
"id": {
|
||||
"allow_null": true,
|
||||
"auto_increment": false,
|
||||
"binary": false,
|
||||
"comment": "The ID number for the object",
|
||||
"decimals": null,
|
||||
"default": null,
|
||||
"length": 20,
|
||||
"name": "id",
|
||||
"type": "BIGINT",
|
||||
"unsigned": true,
|
||||
"values": [],
|
||||
"zerofill": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"classname_and_id": {
|
||||
"type": "key",
|
||||
"name": "classname_and_id",
|
||||
"length": [
|
||||
171,
|
||||
null
|
||||
],
|
||||
"columns": [
|
||||
"classname",
|
||||
"id"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,226 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.4 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 06 Nov 2015
|
||||
*/
|
||||
|
||||
namespace IPS\core\setup\upg_101016;
|
||||
|
||||
/* 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.1.4 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Fix ACP Restrictions
|
||||
*
|
||||
* @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 = 50;
|
||||
$did = 0;
|
||||
$limit = \intval( \IPS\Request::i()->extra );
|
||||
$cutOff = \IPS\core\Setup\Upgrade::determineCutoff();
|
||||
|
||||
foreach( \IPS\Db::i()->select( '*', 'core_admin_permission_rows', NULL, 'row_id_type,row_id', array( $limit, $perCycle ) ) as $row )
|
||||
{
|
||||
if( $cutOff !== null AND time() >= $cutOff )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
$did++;
|
||||
|
||||
if ( $row['row_perm_cache'] != '*' and $row['row_perm_cache'] != '[]' )
|
||||
{
|
||||
$perms = json_decode( $row['row_perm_cache'], TRUE );
|
||||
$applications = array();
|
||||
|
||||
/* Might have a broken permissions row that isn't stored in a format we expect */
|
||||
if( !isset( $perms['applications'] ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ( $perms['applications'] as $k => $app )
|
||||
{
|
||||
/* We've stored ACP permissions in different ways - one way was 'app' => array( 'module1', 'module2' ) */
|
||||
if( \is_array( $app ) )
|
||||
{
|
||||
$applications[ $k ] = $app;
|
||||
}
|
||||
else
|
||||
{
|
||||
$applications[ $app ] = $perms['modules'];
|
||||
}
|
||||
}
|
||||
$perms['applications'] = $applications;
|
||||
unset( $perms['modules'] );
|
||||
|
||||
\IPS\Db::i()->update( 'core_admin_permission_rows', array( 'row_perm_cache' => json_encode( $perms ) ), array( 'row_id=? AND row_id_type=?', $row['row_id'], $row['row_id_type'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
if( $did )
|
||||
{
|
||||
return ( $limit + $did );
|
||||
}
|
||||
else
|
||||
{
|
||||
unset( \IPS\Data\Store::i()->administrators );
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step1CustomTitle()
|
||||
{
|
||||
return "Fixing admin permissions";
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up invalid themes set for a user
|
||||
*
|
||||
* @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_members',
|
||||
'query' => "UPDATE " . \IPS\Db::i()->prefix . "core_members SET skin=0 WHERE skin NOT IN(SELECT set_id FROM " . \IPS\Db::i()->prefix . "core_themes)",
|
||||
)
|
||||
);
|
||||
|
||||
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $toRunQueries );
|
||||
|
||||
if ( \count( $toRun ) )
|
||||
{
|
||||
\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' => \IPS\Request::i()->mr ) ) ) );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step2CustomTitle()
|
||||
{
|
||||
return "Removing orphaned member theme preferences";
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix orphaned profile fields
|
||||
*
|
||||
* @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 there are none, do not bother */
|
||||
$count = \IPS\Db::i()->select( 'COUNT(*)', 'core_pfields_data', array( "pf_group_id=?", 0 ) )->first();
|
||||
|
||||
if ( !$count )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
$group = new \IPS\core\ProfileFields\Group;
|
||||
$group->save();
|
||||
|
||||
\IPS\Lang::saveCustom( 'core', "core_pfieldgroups_{$group->id}", 'Uncategorized' );
|
||||
|
||||
\IPS\Db::i()->update( 'core_pfields_data', array( "pf_group_id" => $group->id ), array( "pf_group_id=?", 0 ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step3CustomTitle()
|
||||
{
|
||||
return "Fixing orphaned profile fields";
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix searchable profile fields
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
$searchableFields = array( 'Email', 'Tel', 'Text', 'TextArea', 'Url' );
|
||||
|
||||
\IPS\Db::i()->update( 'core_pfields_data', array( 'pf_search_type' => '' ), \IPS\Db::i()->in( 'pf_type', $searchableFields, TRUE ) );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom title for this step
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function step4CustomTitle()
|
||||
{
|
||||
return "Fixing searchable custom fields";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fix custom furl definition keys
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
$json = array();
|
||||
try
|
||||
{
|
||||
$config = \IPS\Db::i()->select( 'conf_value', 'core_sys_conf_settings', array( array( 'conf_key=?', 'furl_configuration' ) ) )->first();
|
||||
|
||||
if( $config )
|
||||
{
|
||||
foreach( json_decode( $config, TRUE ) as $k => $v )
|
||||
{
|
||||
if ( mb_substr( $k, 0, 3 ) !== 'key' and \is_numeric( $k ) )
|
||||
{
|
||||
$json[ 'key' . $k ] = $v;
|
||||
}
|
||||
else
|
||||
{
|
||||
$json[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Settings::i()->changeValues( array( 'furl_configuration' => json_encode( $json ) ) );
|
||||
}
|
||||
}
|
||||
catch( \UnderflowException $e ) { }
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,78 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief 4.1.5 Upgrade Code
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 06 Nov 2015
|
||||
*/
|
||||
|
||||
namespace IPS\core\setup\upg_101018;
|
||||
|
||||
/* 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.1.5 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
{
|
||||
/**
|
||||
* Fix custom furl definition keys from a previous fix that wasn't so accurate
|
||||
*
|
||||
* @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()
|
||||
{
|
||||
$existing = array();
|
||||
foreach ( \IPS\Application::applications() as $app )
|
||||
{
|
||||
if( file_exists( \IPS\ROOT_PATH . "/applications/{$app->directory}/data/furl.json" ) )
|
||||
{
|
||||
$data = json_decode( preg_replace( '/\/\*.+?\*\//s', '', \file_get_contents( \IPS\ROOT_PATH . "/applications/{$app->directory}/data/furl.json" ) ), TRUE );
|
||||
$existing = array_merge( $existing, array_keys( $data['pages'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
$json = array();
|
||||
try
|
||||
{
|
||||
$config = \IPS\Db::i()->select( 'conf_value', 'core_sys_conf_settings', array( array( 'conf_key=?', 'furl_configuration' ) ) )->first();
|
||||
$json = array();
|
||||
|
||||
if( $config )
|
||||
{
|
||||
foreach( json_decode( $config, TRUE ) as $k => $v )
|
||||
{
|
||||
if ( mb_substr( $k, 0, 3 ) === 'key' )
|
||||
{
|
||||
$originalKey = mb_substr( $k, 3 );
|
||||
|
||||
if ( \in_array( $originalKey, $existing ) )
|
||||
{
|
||||
$json[ $originalKey ] = $v;
|
||||
}
|
||||
else
|
||||
{
|
||||
$json[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$json[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Settings::i()->changeValues( array( 'furl_configuration' => json_encode( $json ) ) );
|
||||
}
|
||||
}
|
||||
catch( \UnderflowException $e ) { }
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -1,28 +0,0 @@
|
||||
{
|
||||
"1": {
|
||||
"method": "addIndex",
|
||||
"params": [
|
||||
"core_search_index",
|
||||
{
|
||||
"type": "key",
|
||||
"name": "index_item_author",
|
||||
"columns": [
|
||||
"index_item_author",
|
||||
"index_permissions",
|
||||
"index_date_updated"
|
||||
],
|
||||
"length": [
|
||||
null,
|
||||
250,
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"2": {
|
||||
"method": "delete",
|
||||
"params": [
|
||||
"core_view_updates"
|
||||
]
|
||||
}
|
||||
}
|
||||
Loaded 100 of 6736 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user