Version 3.4.5
This commit is contained in:
1 parent
fb6b5baabc
commit
e4478369d8
1360 files changed
+228921
-179445
No files matched your search
@@ -1,223 +1,223 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* Static SETUP Classes for IP.Board 3
|
||||
*
|
||||
* These classes are not required as objects.
|
||||
* Last Updated: $Date: 2012-06-22 10:34:40 -0400 (Fri, 22 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10971 $
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Collection of methods to for installation alone
|
||||
*
|
||||
* @author Matt
|
||||
*/
|
||||
class IPSInstall
|
||||
{
|
||||
/**
|
||||
* Create admin account
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
static public function createAdminAccount()
|
||||
{
|
||||
/* Build Entry */
|
||||
$_mke_time = ( ipsRegistry::$settings['login_key_expire'] ) ? ( time() + ( intval( ipsRegistry::$settings['login_key_expire'] ) * 86400 ) ) : 0;
|
||||
$salt = IPSMember::generatePasswordSalt( 5 );
|
||||
$passhash = IPSMember::generateCompiledPasshash( $salt, md5( IPSSetUp::getSavedData('admin_pass') ) );
|
||||
$_dname = IPSSetUp::getSavedData('admin_user');
|
||||
|
||||
$member = array(
|
||||
'name' => $_dname,
|
||||
'members_l_username' => strtolower( $_dname ),
|
||||
'members_display_name' => $_dname,
|
||||
'members_l_display_name' => strtolower( $_dname ),
|
||||
'members_seo_name' => IPSText::makeSeoTitle( $_dname ),
|
||||
'member_login_key' => IPSMember::generateAutoLoginKey(),
|
||||
'member_login_key_expire' => $_mke_time,
|
||||
'title' => 'Administrator',
|
||||
'email' => IPSSetUp::getSavedData('admin_email') ,
|
||||
'member_group_id' => 4,
|
||||
'posts' => 1,
|
||||
'joined' => time(),
|
||||
'last_visit' => time(),
|
||||
'last_activity' => time(),
|
||||
'ip_address' => my_getenv('REMOTE_ADDR'),
|
||||
'view_sigs' => 1,
|
||||
'restrict_post' => 0,
|
||||
'msg_show_notification' => 1,
|
||||
'msg_count_total' => 0,
|
||||
'msg_count_new' => 0,
|
||||
'coppa_user' => 0,
|
||||
'language' => IPSLib::getDefaultLanguage(),
|
||||
'members_auto_dst' => 1,
|
||||
'member_uploader' => 'flash',
|
||||
'allow_admin_mails' => 0,
|
||||
'members_pass_hash' => $passhash,
|
||||
'members_pass_salt' => $salt,
|
||||
'has_blog' => '',
|
||||
'fb_token' => '',
|
||||
'ignored_users' => '',
|
||||
'members_cache' => '',
|
||||
'failed_logins' => '',
|
||||
'bday_day' => 0,
|
||||
'bday_month' => 0,
|
||||
'bday_year' => 0
|
||||
);
|
||||
|
||||
/* Insert: MEMBERS */
|
||||
ipsRegistry::DB()->setDataType( array( 'name', 'members_display_name', 'members_l_username', 'members_l_display_name' ), 'string' );
|
||||
|
||||
ipsRegistry::DB()->insert( 'members', $member );
|
||||
|
||||
$member_id = ipsRegistry::DB()->getInsertId();
|
||||
$member['member_id'] = $member_id;
|
||||
|
||||
/* Insert into the custom profile fields DB */
|
||||
ipsRegistry::DB()->insert( 'pfields_content', array( 'member_id' => $member_id ) );
|
||||
|
||||
/* Insert into pp */
|
||||
ipsRegistry::DB()->insert( 'profile_portal', array(
|
||||
'pp_member_id' => $member_id,
|
||||
'pp_setting_count_friends' => 1,
|
||||
'signature' => '',
|
||||
'pconversation_filters' => '',
|
||||
'pp_setting_count_comments' => 1,
|
||||
'pp_setting_count_visitors' => 1 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes out conf_global
|
||||
*
|
||||
* @access public
|
||||
* @return bool File written successfully
|
||||
*/
|
||||
static public function writeConfiguration()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Safe mode?
|
||||
//-----------------------------------------
|
||||
|
||||
$safe_mode = 0;
|
||||
|
||||
if ( @get_cfg_var('safe_mode') )
|
||||
{
|
||||
$safe_mode = @get_cfg_var('safe_mode');
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set info array
|
||||
//-----------------------------------------
|
||||
|
||||
$INFO = array(
|
||||
'sql_driver' => IPSSetUp::getSavedData('sql_driver'),
|
||||
'sql_host' => IPSSetUp::getSavedData('db_host'),
|
||||
'sql_database' => IPSSetUp::getSavedData('db_name'),
|
||||
'sql_user' => IPSSetUp::getSavedData('db_user'),
|
||||
'sql_pass' => str_replace( '\'', '\\\'', IPSSetUp::getSavedData('db_pass') ),
|
||||
'sql_tbl_prefix' => IPSSetUp::getSavedData('db_pre'),
|
||||
'sql_debug' => 0,
|
||||
'sql_charset' => '',
|
||||
|
||||
'board_start' => time(),
|
||||
'installed' => 1,
|
||||
|
||||
'php_ext' => 'php',
|
||||
'safe_mode' => $safe_mode,
|
||||
|
||||
//'base_url' => IPSSetUp::getSavedData('install_url'),
|
||||
'board_url' => IPSSetUp::getSavedData('install_url'),
|
||||
'banned_group' => '5',
|
||||
'admin_group' => '4',
|
||||
'guest_group' => '2',
|
||||
'member_group' => '3',
|
||||
'auth_group' => '1',
|
||||
'use_friendly_urls' => 1,
|
||||
'_jsDebug' => 0
|
||||
);
|
||||
|
||||
//---------------------------------------------
|
||||
// Any "extra" configs required for this driver?
|
||||
//---------------------------------------------
|
||||
|
||||
foreach( IPSSetUp::getSavedDataAsArray() as $k => $v )
|
||||
{
|
||||
if ( preg_match( "#^__sql__#", $k ) )
|
||||
{
|
||||
$k = str_replace( "__sql__", "", $k );
|
||||
|
||||
$INFO[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------
|
||||
// Write to disk
|
||||
//---------------------------------------------
|
||||
|
||||
$core_conf = "<"."?php\n";
|
||||
|
||||
foreach( $INFO as $k => $v )
|
||||
{
|
||||
$core_conf .= '$INFO['."'".$k."'".']'."\t\t\t=\t'".$v."';\n";
|
||||
}
|
||||
|
||||
$core_conf .= "\ndefine('IN_DEV', 0);";
|
||||
|
||||
/* Remote archive stuff */
|
||||
$core_conf .= "\n/* Remote archive DB - complete these details if you\'re using a remote DB for the post archive.\n If content has already been archived in the local DB, this will need transferring and will not be done automatically. */\n";
|
||||
|
||||
foreach( array( 'archive_remote_sql_host', 'archive_remote_sql_database', 'archive_remote_sql_user', 'archive_remote_sql_pass', 'archive_remote_sql_charset' ) as $k )
|
||||
{
|
||||
$core_conf .= '$INFO['."'".$k."'".']'."\t\t\t=\t'';\n";
|
||||
}
|
||||
|
||||
$core_conf .= "\n".'?'.'>';
|
||||
|
||||
/* Write Configuration Files */
|
||||
$output[] = 'Writing configuration files...<br />';
|
||||
|
||||
$ret = IPSSetUp::writeFile( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' , $core_conf );
|
||||
|
||||
/* Now freeze data */
|
||||
IPSSetUp::freezeSavedData();
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up conf global
|
||||
* Removes data variables
|
||||
*
|
||||
* @access public
|
||||
* @return boolean
|
||||
*/
|
||||
static public function cleanConfGlobal()
|
||||
{
|
||||
if ( $contents = @file_get_contents( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' ) )
|
||||
{
|
||||
if ( $contents )
|
||||
{
|
||||
$contents = preg_replace( "#/\*~~DATA~~\*/(.+?)\n/\*\*/#s", "", $contents );
|
||||
|
||||
return IPSSetUp::writeFile( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' , $contents );
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* Static SETUP Classes for IP.Board 3
|
||||
*
|
||||
* These classes are not required as objects.
|
||||
* Last Updated: $Date: 2012-06-29 10:12:14 -0400 (Fri, 29 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 11007 $
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Collection of methods to for installation alone
|
||||
*
|
||||
* @author Matt
|
||||
*/
|
||||
class IPSInstall
|
||||
{
|
||||
/**
|
||||
* Create admin account
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
static public function createAdminAccount()
|
||||
{
|
||||
/* Build Entry */
|
||||
$_mke_time = ( ipsRegistry::$settings['login_key_expire'] ) ? ( time() + ( intval( ipsRegistry::$settings['login_key_expire'] ) * 86400 ) ) : 0;
|
||||
$salt = IPSMember::generatePasswordSalt( 5 );
|
||||
$passhash = IPSMember::generateCompiledPasshash( $salt, md5( IPSSetUp::getSavedData('admin_pass') ) );
|
||||
$_dname = IPSSetUp::getSavedData('admin_user');
|
||||
|
||||
$member = array(
|
||||
'name' => $_dname,
|
||||
'members_l_username' => mb_strtolower( $_dname ),
|
||||
'members_display_name' => $_dname,
|
||||
'members_l_display_name' => mb_strtolower( $_dname ),
|
||||
'members_seo_name' => IPSText::makeSeoTitle( $_dname ),
|
||||
'member_login_key' => IPSMember::generateAutoLoginKey(),
|
||||
'member_login_key_expire' => $_mke_time,
|
||||
'title' => 'Администратор',
|
||||
'email' => IPSSetUp::getSavedData('admin_email') ,
|
||||
'member_group_id' => 4,
|
||||
'posts' => 1,
|
||||
'joined' => time(),
|
||||
'last_visit' => time(),
|
||||
'last_activity' => time(),
|
||||
'ip_address' => my_getenv('REMOTE_ADDR'),
|
||||
'view_sigs' => 1,
|
||||
'restrict_post' => 0,
|
||||
'msg_show_notification' => 1,
|
||||
'msg_count_total' => 0,
|
||||
'msg_count_new' => 0,
|
||||
'coppa_user' => 0,
|
||||
'language' => IPSLib::getDefaultLanguage(),
|
||||
'members_auto_dst' => 1,
|
||||
'member_uploader' => 'flash',
|
||||
'allow_admin_mails' => 0,
|
||||
'members_pass_hash' => $passhash,
|
||||
'members_pass_salt' => $salt,
|
||||
'has_blog' => '',
|
||||
'fb_token' => '',
|
||||
'ignored_users' => '',
|
||||
'members_cache' => '',
|
||||
'failed_logins' => '',
|
||||
'bday_day' => 0,
|
||||
'bday_month' => 0,
|
||||
'bday_year' => 0
|
||||
);
|
||||
|
||||
/* Insert: MEMBERS */
|
||||
ipsRegistry::DB()->setDataType( array( 'name', 'members_display_name', 'members_l_username', 'members_l_display_name' ), 'string' );
|
||||
|
||||
ipsRegistry::DB()->insert( 'members', $member );
|
||||
|
||||
$member_id = ipsRegistry::DB()->getInsertId();
|
||||
$member['member_id'] = $member_id;
|
||||
|
||||
/* Insert into the custom profile fields DB */
|
||||
ipsRegistry::DB()->insert( 'pfields_content', array( 'member_id' => $member_id ) );
|
||||
|
||||
/* Insert into pp */
|
||||
ipsRegistry::DB()->insert( 'profile_portal', array(
|
||||
'pp_member_id' => $member_id,
|
||||
'pp_setting_count_friends' => 1,
|
||||
'signature' => '',
|
||||
'pconversation_filters' => '',
|
||||
'pp_setting_count_comments' => 1,
|
||||
'pp_setting_count_visitors' => 1 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes out conf_global
|
||||
*
|
||||
* @access public
|
||||
* @return bool File written successfully
|
||||
*/
|
||||
static public function writeConfiguration()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Safe mode?
|
||||
//-----------------------------------------
|
||||
|
||||
$safe_mode = 0;
|
||||
|
||||
if ( @get_cfg_var('safe_mode') )
|
||||
{
|
||||
$safe_mode = @get_cfg_var('safe_mode');
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Set info array
|
||||
//-----------------------------------------
|
||||
|
||||
$INFO = array(
|
||||
'sql_driver' => IPSSetUp::getSavedData('sql_driver'),
|
||||
'sql_host' => IPSSetUp::getSavedData('db_host'),
|
||||
'sql_database' => IPSSetUp::getSavedData('db_name'),
|
||||
'sql_user' => IPSSetUp::getSavedData('db_user'),
|
||||
'sql_pass' => str_replace( '\'', '\\\'', IPSSetUp::getSavedData('db_pass') ),
|
||||
'sql_tbl_prefix' => IPSSetUp::getSavedData('db_pre'),
|
||||
'sql_debug' => 0,
|
||||
'sql_charset' => 'utf8',
|
||||
|
||||
'board_start' => time(),
|
||||
'installed' => 1,
|
||||
|
||||
'php_ext' => 'php',
|
||||
'safe_mode' => $safe_mode,
|
||||
|
||||
//'base_url' => IPSSetUp::getSavedData('install_url'),
|
||||
'board_url' => IPSSetUp::getSavedData('install_url'),
|
||||
'banned_group' => '5',
|
||||
'admin_group' => '4',
|
||||
'guest_group' => '2',
|
||||
'member_group' => '3',
|
||||
'auth_group' => '1',
|
||||
'use_friendly_urls' => 1,
|
||||
'_jsDebug' => 0
|
||||
);
|
||||
|
||||
//---------------------------------------------
|
||||
// Any "extra" configs required for this driver?
|
||||
//---------------------------------------------
|
||||
|
||||
foreach( IPSSetUp::getSavedDataAsArray() as $k => $v )
|
||||
{
|
||||
if ( preg_match( "#^__sql__#", $k ) )
|
||||
{
|
||||
$k = str_replace( "__sql__", "", $k );
|
||||
|
||||
$INFO[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------
|
||||
// Write to disk
|
||||
//---------------------------------------------
|
||||
|
||||
$core_conf = "<"."?php\n";
|
||||
|
||||
foreach( $INFO as $k => $v )
|
||||
{
|
||||
$core_conf .= '$INFO['."'".$k."'".']'."\t\t\t=\t'".$v."';\n";
|
||||
}
|
||||
|
||||
$core_conf .= "\ndefine('IN_DEV', 0);";
|
||||
|
||||
/* Remote archive stuff */
|
||||
$core_conf .= "\n/* Remote archive DB - complete these details if you\'re using a remote DB for the post archive.\n If content has already been archived in the local DB, this will need transferring and will not be done automatically. */\n";
|
||||
|
||||
foreach( array( 'archive_remote_sql_host', 'archive_remote_sql_database', 'archive_remote_sql_user', 'archive_remote_sql_pass', 'archive_remote_sql_charset' ) as $k )
|
||||
{
|
||||
$core_conf .= '$INFO['."'".$k."'".']'."\t\t\t=\t'';\n";
|
||||
}
|
||||
|
||||
$core_conf .= "\n".'?'.'>';
|
||||
|
||||
/* Write Configuration Files */
|
||||
$output[] = 'Запись файлов настройки<br />';
|
||||
|
||||
$ret = IPSSetUp::writeFile( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' , $core_conf );
|
||||
|
||||
/* Now freeze data */
|
||||
IPSSetUp::freezeSavedData();
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up conf global
|
||||
* Removes data variables
|
||||
*
|
||||
* @access public
|
||||
* @return boolean
|
||||
*/
|
||||
static public function cleanConfGlobal()
|
||||
{
|
||||
if ( $contents = @file_get_contents( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' ) )
|
||||
{
|
||||
if ( $contents )
|
||||
{
|
||||
$contents = preg_replace( "#/\*~~DATA~~\*/(.+?)\n/\*\*/#s", "", $contents );
|
||||
|
||||
return IPSSetUp::writeFile( IPSSetUp::getSavedData('install_dir') . '/conf_global.php' , $contents );
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,301 +1,301 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* ipsController for setup
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10914 $
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class "Controller"
|
||||
* A very simple public facing interface to resolve incoming data into
|
||||
* a command class
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @since Wednesday 14th May 2008
|
||||
* @package IP.Board
|
||||
* @ignore
|
||||
*/
|
||||
class ipsController
|
||||
{
|
||||
/**
|
||||
* Registry reference
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $registry;
|
||||
|
||||
/**
|
||||
* Current command
|
||||
*
|
||||
* @access public
|
||||
* @var object
|
||||
*/
|
||||
static public $cmd;
|
||||
|
||||
/**
|
||||
* Make us a singleton please
|
||||
*
|
||||
* @access private
|
||||
* @return @e void
|
||||
*/
|
||||
private function __construct() { }
|
||||
|
||||
/**
|
||||
* Public facing function to run the controller
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
static public function run()
|
||||
{
|
||||
$instance = new ipsController();
|
||||
$instance->init();
|
||||
$instance->handleRequest();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize ipsRegistry and this class
|
||||
*
|
||||
* @access protected
|
||||
* @return @e void
|
||||
*/
|
||||
protected function init()
|
||||
{
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->registry->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the incoming request using the command resolver
|
||||
*
|
||||
* @access protected
|
||||
* @return @e void
|
||||
*/
|
||||
protected function handleRequest()
|
||||
{
|
||||
$cmd_r = new ipsController_CommandResolver();
|
||||
self::$cmd = $cmd_r->getCommand( $this->registry );
|
||||
self::$cmd->execute( $this->registry );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class "Command Resolver"
|
||||
* Resolves the incoming data
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @since Wednesday 14th May 2008
|
||||
* @package IP.Board
|
||||
*/
|
||||
class ipsController_CommandResolver
|
||||
{
|
||||
/**
|
||||
* Base command
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private static $base_cmd;
|
||||
|
||||
/**
|
||||
* AJAX command
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private static $ajax_cmd;
|
||||
|
||||
/**
|
||||
* Default command
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private static $default_cmd;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ( ! self::$base_cmd )
|
||||
{
|
||||
self::$base_cmd = new ReflectionClass( 'ipsCommand' );
|
||||
self::$default_cmd = new ipsCommand_default();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the command
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return object Command object
|
||||
*/
|
||||
public function getCommand( ipsRegistry $registry )
|
||||
{
|
||||
$module = ipsRegistry::$current_module;
|
||||
$section = ipsRegistry::$current_section;
|
||||
$filepath = ( IPS_IS_UPGRADER ) ? IPS_ROOT_PATH . 'setup/applications/upgrade/sections/' : IPS_ROOT_PATH . 'setup/applications/install/sections/';
|
||||
|
||||
/* Got a section? */
|
||||
if ( ! $section )
|
||||
{
|
||||
if ( is_file( $filepath . 'index.php' ) )
|
||||
{
|
||||
$section = 'index';
|
||||
}
|
||||
}
|
||||
|
||||
$classname = IPS_APP_COMPONENT . '_' . $section;
|
||||
|
||||
if ( is_file( $filepath . 'manualResolver.php' ) )
|
||||
{
|
||||
require_once( $filepath . 'manualResolver.php' );/*noLibHook*/
|
||||
$classname = IPS_APP_COMPONENT . '_' . $module . '_manualResolver';
|
||||
}
|
||||
else if ( is_file( $filepath . $section . '.php' ) )
|
||||
{
|
||||
require_once( $filepath . $section . '.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
if ( class_exists( $classname ) )
|
||||
{
|
||||
$cmd_class = new ReflectionClass( $classname );
|
||||
|
||||
if ( $cmd_class->isSubClassOf( self::$base_cmd ) )
|
||||
{
|
||||
return $cmd_class->newInstance();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception( "{$section} in {$module} does not exist!" );
|
||||
}
|
||||
}
|
||||
|
||||
# Fudge it to return just the default object
|
||||
return clone self::$default_cmd;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
abstract class ipsCommand
|
||||
{
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
public $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor override
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
final public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Create registry shortcuts
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function makeRegistryShortcuts( ipsRegistry $registry )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the commands
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function execute( ipsRegistry $registry )
|
||||
{
|
||||
$this->makeRegistryShortcuts( $registry );
|
||||
$this->doExecute( $registry );
|
||||
}
|
||||
|
||||
/**
|
||||
* doExecute, most be override
|
||||
*
|
||||
* @access protected
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
protected abstract function doExecute( ipsRegistry $registry );
|
||||
}
|
||||
|
||||
|
||||
class ipsCommand_default extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main execution method
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
protected function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$filepath = IPSLib::getAppDir( IPS_APP_COMPONENT ) . '/modules/' . ipsRegistry::$current_module . '/' . ipsRegistry::$current_section . '.php';
|
||||
$filepath = str_replace( DOC_IPS_ROOT_PATH, '', $filepath );
|
||||
|
||||
//-----------------------------------------
|
||||
// Uh oh, this is a big one.. (no forums app)
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! is_file( $filepath ) )
|
||||
{
|
||||
print "Command File " . ipsRegistry::$current_module . " missing";
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Nothing to do!";
|
||||
exit();
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.4.5
|
||||
* ipsController for setup
|
||||
* Last Updated: $Date: 2012-05-10 16:10:13 -0400 (Thu, 10 May 2012) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/company/standards.php#license
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10721 $
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class "Controller"
|
||||
* A very simple public facing interface to resolve incoming data into
|
||||
* a command class
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @since Wednesday 14th May 2008
|
||||
* @package IP.Board
|
||||
* @ignore
|
||||
*/
|
||||
class ipsController
|
||||
{
|
||||
/**
|
||||
* Registry reference
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private $registry;
|
||||
|
||||
/**
|
||||
* Current command
|
||||
*
|
||||
* @access public
|
||||
* @var object
|
||||
*/
|
||||
static public $cmd;
|
||||
|
||||
/**
|
||||
* Make us a singleton please
|
||||
*
|
||||
* @access private
|
||||
* @return @e void
|
||||
*/
|
||||
private function __construct() { }
|
||||
|
||||
/**
|
||||
* Public facing function to run the controller
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
static public function run()
|
||||
{
|
||||
$instance = new ipsController();
|
||||
$instance->init();
|
||||
$instance->handleRequest();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize ipsRegistry and this class
|
||||
*
|
||||
* @access protected
|
||||
* @return @e void
|
||||
*/
|
||||
protected function init()
|
||||
{
|
||||
$this->registry = ipsRegistry::instance();
|
||||
$this->registry->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the incoming request using the command resolver
|
||||
*
|
||||
* @access protected
|
||||
* @return @e void
|
||||
*/
|
||||
protected function handleRequest()
|
||||
{
|
||||
$cmd_r = new ipsController_CommandResolver();
|
||||
self::$cmd = $cmd_r->getCommand( $this->registry );
|
||||
self::$cmd->execute( $this->registry );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class "Command Resolver"
|
||||
* Resolves the incoming data
|
||||
*
|
||||
* @author Matt Mecham
|
||||
* @since Wednesday 14th May 2008
|
||||
* @package IP.Board
|
||||
*/
|
||||
class ipsController_CommandResolver
|
||||
{
|
||||
/**
|
||||
* Base command
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private static $base_cmd;
|
||||
|
||||
/**
|
||||
* AJAX command
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private static $ajax_cmd;
|
||||
|
||||
/**
|
||||
* Default command
|
||||
*
|
||||
* @access private
|
||||
* @var object
|
||||
*/
|
||||
private static $default_cmd;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if ( ! self::$base_cmd )
|
||||
{
|
||||
self::$base_cmd = new ReflectionClass( 'ipsCommand' );
|
||||
self::$default_cmd = new ipsCommand_default();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the command
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return object Command object
|
||||
*/
|
||||
public function getCommand( ipsRegistry $registry )
|
||||
{
|
||||
$module = ipsRegistry::$current_module;
|
||||
$section = ipsRegistry::$current_section;
|
||||
$filepath = ( IPS_IS_UPGRADER ) ? IPS_ROOT_PATH . 'setup/applications/upgrade/sections/' : IPS_ROOT_PATH . 'setup/applications/install/sections/';
|
||||
|
||||
/* Got a section? */
|
||||
if ( ! $section )
|
||||
{
|
||||
if ( is_file( $filepath . 'index.php' ) )
|
||||
{
|
||||
$section = 'index';
|
||||
}
|
||||
}
|
||||
|
||||
$classname = IPS_APP_COMPONENT . '_' . $section;
|
||||
|
||||
if ( is_file( $filepath . 'manualResolver.php' ) )
|
||||
{
|
||||
require_once( $filepath . 'manualResolver.php' );/*noLibHook*/
|
||||
$classname = IPS_APP_COMPONENT . '_' . $module . '_manualResolver';
|
||||
}
|
||||
else if ( is_file( $filepath . $section . '.php' ) )
|
||||
{
|
||||
require_once( $filepath . $section . '.php' );/*noLibHook*/
|
||||
}
|
||||
|
||||
if ( class_exists( $classname ) )
|
||||
{
|
||||
$cmd_class = new ReflectionClass( $classname );
|
||||
|
||||
if ( $cmd_class->isSubClassOf( self::$base_cmd ) )
|
||||
{
|
||||
return $cmd_class->newInstance();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception( "{$section} в модуле {$module} не существует!" );
|
||||
}
|
||||
}
|
||||
|
||||
# Fudge it to return just the default object
|
||||
return clone self::$default_cmd;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
abstract class ipsCommand
|
||||
{
|
||||
/**#@+
|
||||
* Registry Object Shortcuts
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
protected $registry;
|
||||
protected $DB;
|
||||
protected $settings;
|
||||
public $request;
|
||||
protected $lang;
|
||||
protected $member;
|
||||
protected $memberData;
|
||||
protected $cache;
|
||||
protected $caches;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor override
|
||||
*
|
||||
* @access public
|
||||
* @return @e void
|
||||
*/
|
||||
final public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Create registry shortcuts
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function makeRegistryShortcuts( ipsRegistry $registry )
|
||||
{
|
||||
/* Make registry objects */
|
||||
$this->registry = $registry;
|
||||
$this->DB = $this->registry->DB();
|
||||
$this->settings =& $this->registry->fetchSettings();
|
||||
$this->request =& $this->registry->fetchRequest();
|
||||
$this->member = $this->registry->member();
|
||||
$this->memberData =& $this->registry->member()->fetchMemberData();
|
||||
$this->cache = $this->registry->cache();
|
||||
$this->caches =& $this->registry->cache()->fetchCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the commands
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
public function execute( ipsRegistry $registry )
|
||||
{
|
||||
$this->makeRegistryShortcuts( $registry );
|
||||
$this->doExecute( $registry );
|
||||
}
|
||||
|
||||
/**
|
||||
* doExecute, most be override
|
||||
*
|
||||
* @access protected
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
protected abstract function doExecute( ipsRegistry $registry );
|
||||
}
|
||||
|
||||
|
||||
class ipsCommand_default extends ipsCommand
|
||||
{
|
||||
/**
|
||||
* Main execution method
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry reference
|
||||
* @return @e void
|
||||
*/
|
||||
protected function doExecute( ipsRegistry $registry )
|
||||
{
|
||||
$filepath = IPSLib::getAppDir( IPS_APP_COMPONENT ) . '/modules/' . ipsRegistry::$current_module . '/' . ipsRegistry::$current_section . '.php';
|
||||
$filepath = str_replace( DOC_IPS_ROOT_PATH, '', $filepath );
|
||||
|
||||
//-----------------------------------------
|
||||
// Uh oh, this is a big one.. (no forums app)
|
||||
//-----------------------------------------
|
||||
|
||||
if ( ! is_file( $filepath ) )
|
||||
{
|
||||
print "Command File " . ipsRegistry::$current_module . " missing";
|
||||
exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Nothing to do!";
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -3,11 +3,11 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.3.4
|
||||
* IP.Board v3.4.5
|
||||
* Static SETUP Classes for IP.Board 3
|
||||
*
|
||||
* These classes are not required as objects.
|
||||
* Last Updated: $Date: 2012-06-12 10:14:49 -0400 (Tue, 12 Jun 2012) $
|
||||
* Last Updated: $Date: 2013-01-30 20:50:13 -0500 (Wed, 30 Jan 2013) $
|
||||
* </pre>
|
||||
*
|
||||
* @author Matt Mecham
|
||||
@@ -16,7 +16,7 @@
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 1st December 2008
|
||||
* @version $Revision: 10914 $
|
||||
* @version $Revision: 11920 $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,7 @@ class IPSSetUp
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const minPhpVersion = '5.2.0';
|
||||
const minPhpVersion = '5.2.1';
|
||||
|
||||
/**
|
||||
* Min MySQL Version
|
||||
@@ -825,6 +825,20 @@ class IPSSetUp
|
||||
}
|
||||
}
|
||||
}
|
||||
/* http://community.invisionpower.com/resources/bugs.html/_/ip-board/342-legacy-upgrader-failure-r41062?st=0#comment_109878
|
||||
else
|
||||
{
|
||||
if ( self::is300plus() === TRUE )
|
||||
{
|
||||
$_version = ipsRegistry::DB()->buildAndFetch( array( 'select' => '*',
|
||||
'from' => 'core_applications',
|
||||
'where' => 'app_directory=\'' . $app . '\'' ) );
|
||||
|
||||
$key = $_version['app_id'] ? $key : 0;
|
||||
}
|
||||
}
|
||||
*
|
||||
*/
|
||||
|
||||
$return['current'] = ( $key ) ? array( $key, $XMLVersions[ $key ] ) : array( 0, 'install' );
|
||||
|
||||
@@ -1354,7 +1368,12 @@ class IPSSetUp
|
||||
{
|
||||
$value = strtolower($value);
|
||||
}
|
||||
|
||||
|
||||
if ( ! is_array( self::$_savedData ) )
|
||||
{
|
||||
self::$_savedData = array();
|
||||
}
|
||||
|
||||
self::$_savedData[ $key ] = $value;
|
||||
}
|
||||
|
||||
@@ -1367,14 +1386,14 @@ class IPSSetUp
|
||||
static function freezeSavedData()
|
||||
{
|
||||
/* Encode */
|
||||
$data = base64_encode( serialize( self::$_savedData ) );
|
||||
$data = base64_encode( json_encode( self::$_savedData ) );
|
||||
|
||||
/* Write to our cache file */
|
||||
if ( is_array( self::$_savedData ) )
|
||||
{
|
||||
self::_writeFreezerCache( $data );
|
||||
}
|
||||
|
||||
|
||||
/* Return */
|
||||
return $data;
|
||||
}
|
||||
@@ -1400,7 +1419,7 @@ class IPSSetUp
|
||||
}
|
||||
}
|
||||
|
||||
self::$_savedData = unserialize( base64_decode( $data ) );
|
||||
self::$_savedData = json_decode( base64_decode( $data ), TRUE );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user