当前位置: 首页>>代码示例>>PHP>>正文


PHP IPSSetUp类代码示例

本文整理汇总了PHP中IPSSetUp的典型用法代码示例。如果您正苦于以下问题:PHP IPSSetUp类的具体用法?PHP IPSSetUp怎么用?PHP IPSSetUp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了IPSSetUp类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructor
  *
  * @access	public
  * @return	void
  */
 public function __construct(ipsRegistry $registry)
 {
     /* Make object */
     $this->registry = $registry;
     $this->DB = $this->registry->DB();
     $this->settings =& $this->registry->fetchSettings();
     $this->request =& $this->registry->fetchRequest();
     $this->cache = $this->registry->cache();
     $this->caches =& $this->registry->cache()->fetchCaches();
     /* Make sure tables exist that won't in pre 3.0 versions */
     if (file_exists(IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower(ipsRegistry::$settings['sql_driver']) . '.php')) {
         require IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower(ipsRegistry::$settings['sql_driver']) . '.php';
         $prefix = $this->registry->dbFunctions()->getPrefix();
         if (!$this->DB->checkForField('upgrade_app', 'upgrade_history')) {
             if ($UPGRADE_TABLE_FIELD) {
                 $this->DB->query(IPSSetUp::addPrefixToQuery($UPGRADE_TABLE_FIELD, $prefix));
             }
         }
         if (!$this->DB->checkForTable('upgrade_sessions')) {
             if ($UPGRADE_SESSION_TABLE) {
                 $this->DB->query(IPSSetUp::addPrefixToQuery($UPGRADE_SESSION_TABLE, $prefix));
             }
         }
     }
 }
开发者ID:dalandis,项目名称:Visualization-of-Cell-Phone-Locations,代码行数:31,代码来源:3xx.php

示例2: checkForProblems

 /**
  * Check we can upgrade
  *
  * @return	mixed	Boolean true or error message
  */
 public function checkForProblems()
 {
     //-----------------------------------------
     // Compatibility check
     //-----------------------------------------
     $minAppVersions = array();
     $args = func_get_args();
     if (!empty($args)) {
         $errors = array();
         foreach ($minAppVersions as $k => $v) {
             if (!isset(ipsRegistry::$applications[$k]) or !ipsRegistry::$applications[$k]['app_enabled']) {
                 continue;
             }
             $numbers = IPSSetUp::fetchAppVersionNumbers($k);
             /* Are we upgrading this app now? */
             if (isset($args[0][$k])) {
                 $ourVersion = $numbers['latest'][0];
             } else {
                 $ourVersion = $numbers['current'][0];
             }
             if ($v > $ourVersion) {
                 $appName = ipsRegistry::$applications[$k]['app_title'];
                 $allVersions = IPSSetUp::fetchXmlAppVersions($k);
                 return "Установленная версия {$appName} не будет работать с этой версией IP.Board. Вы должны обновить {$appName} версии {$allVersions[$v]} или выше, или отключить приложение в админцентре для продолжения.";
             }
         }
     }
     return TRUE;
 }
开发者ID:Advanture,项目名称:Online-RolePlay,代码行数:34,代码来源:upgradeCheck.php

示例3: doExecute

 /**
  * Execute selected method
  *
  * @access	public
  * @param	object		Registry object
  * @return	@e void
  */
 public function doExecute(ipsRegistry $registry)
 {
     /* If less than 3, just bounce out as settings tables won't be here, etc */
     if (IPSSetUp::is300plus() !== TRUE) {
         $this->registry->autoLoadNextAction('upgrade');
         return;
     }
     if ($this->request['do'] == 'check') {
         $lcheck = $this->check();
         if ($lcheck === TRUE) {
             $this->registry->autoLoadNextAction('upgrade');
             return;
         }
     } else {
         $lcheck = $this->check(TRUE);
         if ($lcheck === TRUE) {
             $this->registry->autoLoadNextAction('upgrade');
             return;
         }
     }
     $this->registry->output->setTitle("License Key");
     $this->registry->output->setNextAction("license&do=check");
     $this->registry->output->addContent($this->registry->output->template()->page_license($lcheck));
     $this->registry->output->sendOutput();
 }
开发者ID:mover5,项目名称:imobackup,代码行数:32,代码来源:license.php

示例4: preInstallOptionsForm

    /**
     * Add pre-upgrade options: Form
     * 
     * @return	string	 HTML block
     */
    public function preInstallOptionsForm()
    {
        $_wrapper = "<ul>%s</ul>";
        $_html = '';
        $posts = $this->DB->buildAndFetch(array('select' => 'count(*) as total', 'from' => 'posts'));
        // Is 3.1?
        if (IPSSetUp::is300plus() && !IPSSetUp::is320plus()) {
            // Got more than 100K posts?
            if ($posts['total'] > 100000 && !$this->DB->checkForField('post_field_int', 'posts')) {
                $_html .= <<<EOF
\t\t<li>
\t\t\t<input type='checkbox' name='manualPostsTableQuery' value='1' checked='checked' />
\t\t\tВнести изменения в структуру таблицы Posts вручную?  На вашем форуме более 100,000 сообщений.  Мы <b>настоятельно рекомендуем</b> вам включить данную опцию и самостоятельно выполнить 
\t\t\tSQL запросы для обновления таблицы сообщений. Если вы отключите данную опцию существует большая вероятность того, что мастер обновления не сможет обновить форум.
\t\t</li>
EOF;
            }
        }
        $_html .= <<<EOF
\t\t<li>
\t\t\t<input type='checkbox' name='flagBanned' value='1' checked='checked' />
\t\t\t<strong>Отметить всех пользователей из группы "Забаненные", как забаненных</strong><br />
\t\t\tВ 3.3.0 удалена отдельная группа для заблокированных, теперь проверка осуществляется на основе метки для каждого пользователя. Возможно, что часть пользователей, отмеченных как
\t\t\tзабаненные, в результате такого переноса, не будут находится поиском в админ-центре при применении фильтра поиска по заблокированным.
\t\t\t<br />Мы рекомендуем воспользоваться этой опцией.
\t\t</li>
EOF;
        if ($_html) {
            return sprintf($_wrapper, $_html);
        } else {
            return '';
        }
    }
开发者ID:Advanture,项目名称:Online-RolePlay,代码行数:38,代码来源:version_class.php

示例5: preInstallOptionsForm

    /**
     * Add pre-upgrade options: Form
     * 
     * @return	string	 HTML block
     */
    public function preInstallOptionsForm()
    {
        $_wrapper = "<ul>%s</ul>";
        $_html = '';
        $posts = $this->DB->buildAndFetch(array('select' => 'count(*) as total', 'from' => 'posts'));
        // Is 3.1?
        if (IPSSetUp::is300plus() && !IPSSetUp::is320plus()) {
            // Got more than 100K posts?
            if ($posts['total'] > 100000 && !$this->DB->checkForField('post_field_int', 'posts')) {
                $_html .= <<<EOF
\t\t<li>
\t\t\t<input type='checkbox' name='manualPostsTableQuery' value='1' checked='checked' />
\t\t\tManually apply changes to the posts table?  Your site has more than 100,000 posts.  We <b>strongly recommend</b> that you enable this option and manually run the provided 
\t\t\tSQL query to alter your posts table in order to prevent timeouts in the web-based upgrader.  If you uncheck this option, it is very possible the upgrader will timeout attempting to
\t\t\tupdate your posts table.
\t\t</li>
EOF;
            }
        }
        $_html .= <<<EOF
\t\t<li>
\t\t\t<input type='checkbox' name='flagBanned' value='1' checked='checked' />
\t\t\t<strong>Flag all members in the Banned member group as banned</strong><br />
\t\t\t3.3.0 removes the need for a specific Banned Group and uses the built in 'flag' on a per-member basis. However, unless you choose to update all
\t\t\tmembers in the current Banned Group as 'banned' they may not appear when searching for banned members in the ACP.
\t\t\t<br />We recommend you keep this box ticked
\t\t</li>
EOF;
        if ($_html) {
            return sprintf($_wrapper, $_html);
        } else {
            return '';
        }
    }
开发者ID:mover5,项目名称:imobackup,代码行数:39,代码来源:version_class.php

示例6: postInstallNotices

 /**
  * Return any post-installation notices
  * 
  * @return	array	 Array of notices
  */
 public function postInstallNotices()
 {
     $options = IPSSetUp::getSavedData('custom_options');
     $_skip = $options['ipchat'][13000]['skipIgnoredUsers'];
     $notices = array();
     if ($_skip) {
         $notices[] = "Ignored chat users have not been converted.  You should run the tool in the ACP under Other Apps &gt; Chat &gt; Tools to convert the ignored users.";
     }
     return $notices;
 }
开发者ID:mover5,项目名称:imobackup,代码行数:15,代码来源:version_class.php

示例7: convertIgnored

 /**
  * Convert ignored users
  * 
  * @param	int
  * @return	@e void
  */
 public function convertIgnored()
 {
     /* Are we skipping this step? */
     $options = IPSSetUp::getSavedData('custom_options');
     $_skip = $options['ipchat'][13000]['skipIgnoredUsers'];
     if ($_skip) {
         $this->registry->output->addMessage("Skipping chat ignored users conversion...");
         $this->request['st'] = 0;
         $this->request['workact'] = '';
         return;
     }
     /* Init */
     $st = intval($this->request['st']);
     $did = 0;
     $each = 500;
     /* Find chat ignored users */
     $this->DB->build(array('select' => 'member_id, members_cache', 'from' => 'members', 'order' => 'member_id ASC', 'limit' => array($st, $each)));
     $outer = $this->DB->execute();
     while ($r = $this->DB->fetch($outer)) {
         $did++;
         /* Unpack cache */
         $_cache = unserialize($r['members_cache']);
         /* Now look for ignored users in chat */
         if (is_array($_cache['ignore_chat']) and count($_cache['ignore_chat'])) {
             foreach ($_cache['ignore_chat'] as $_mid) {
                 /* Are we already 'ignoring' this user for other reasons? */
                 $_check = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'ignored_users', 'where' => "ignore_owner_id=" . $r['member_id'] . ' AND ignore_ignore_id=' . $_mid));
                 /* If yes, then update record to also ignore chat */
                 if ($_check['ignore_id']) {
                     $this->DB->update('ignored_users', array('ignore_chats' => 1), 'ignore_id=' . $_check['ignore_id']);
                 } else {
                     $this->DB->insert('ignored_users', array('ignore_chats' => 1, 'ignore_owner_id' => $r['member_id'], 'ignore_ignore_id' => $_mid));
                 }
             }
             /* Rebuild cache */
             IPSMember::rebuildIgnoredUsersCache($r);
             /* Clean up members_cache */
             unset($_cache['ignore_chat']);
             $_cache = serialize($_cache);
             $this->DB->update('members', array('members_cache' => $_cache), 'member_id=' . $r['member_id']);
         }
     }
     /* Show message and redirect */
     if ($did > 0) {
         $this->request['st'] = $st + $did;
         $this->request['workact'] = 'ignored';
         $this->registry->output->addMessage("Up to {$this->request['st']} members checked for ignored chat users...");
     } else {
         $this->request['st'] = 0;
         $this->request['workact'] = '';
         $this->registry->output->addMessage("All ignored chat users converted...");
     }
     /* Next Page */
     return;
 }
开发者ID:mover5,项目名称:imobackup,代码行数:61,代码来源:version_upgrade.php

示例8: doExecute

 /**
  * Execute selected method
  *
  * @access	public
  * @param	object		Registry object
  * @return	@e void
  */
 public function doExecute(ipsRegistry $registry)
 {
     /* INIT */
     $error = false;
     /* Check input? */
     if ($this->request['do'] == 'check') {
         /* Check Directory */
         if (!is_dir($this->request['install_dir'])) {
             $error = true;
             $this->registry->output->addWarning('The specified directory does not exist');
         }
         /* Check URL */
         if (!$this->request['install_dir']) {
             $error = true;
             $this->registry->output->addWarning('You did not specify a URL');
         }
         if (!$error) {
             /* Save Form Data */
             IPSSetUp::setSavedData('install_dir', preg_replace("#(//)\$#", "", str_replace('\\', '/', $this->request['install_dir']) . '/'));
             IPSSetUp::setSavedData('install_url', preg_replace("#(//)\$#", "", str_replace('\\', '/', $this->request['install_url']) . '/'));
             /* Next Action */
             $this->registry->autoLoadNextAction('db');
         }
     }
     /* Guess at directory */
     if (!defined('CP_DIRECTORY')) {
         define('CP_DIRECTORY', 'admin');
     }
     $dir = str_replace(CP_DIRECTORY . '/install', '', getcwd());
     $dir = str_replace(CP_DIRECTORY . '\\install', '', $dir);
     // Windows
     $dir = str_replace('\\', '/', $dir);
     /* Guess at URL */
     $url = str_replace("/" . CP_DIRECTORY . "/installer/index.php", "", $_SERVER['HTTP_REFERER']);
     $url = str_replace("/" . CP_DIRECTORY . "/installer/", "", $url);
     $url = str_replace("/" . CP_DIRECTORY . "/installer", "", $url);
     $url = str_replace("/" . CP_DIRECTORY . "/install/index.php", "", $_SERVER['HTTP_REFERER']);
     $url = str_replace("/" . CP_DIRECTORY . "/install/", "", $url);
     $url = str_replace("/" . CP_DIRECTORY . "/install", "", $url);
     $url = str_replace("/" . CP_DIRECTORY, "", $url);
     $url = str_replace("index.php", "", $url);
     $url = preg_replace("!\\?(.+?)*!", "", $url);
     $url = "{$url}/";
     /* Page Output */
     $this->registry->output->setTitle("Paths and URLs");
     $this->registry->output->setNextAction("address&do=check");
     $this->registry->output->addContent($this->registry->output->template()->page_address($dir, $url));
     $this->registry->output->sendOutput();
 }
开发者ID:ConnorChristie,项目名称:GrabViews-Live,代码行数:56,代码来源:address.php

示例9: setDbPrefix

 /**
  * Set db prefix
  *
  * @access	public
  * @param	object	Registry reference
  * @return	@e void
  */
 public function setDbPrefix($prefix = '')
 {
     if ($prefix) {
         $this->prefix = $prefix;
         return;
     } else {
         if (class_exists('IPSSetUp')) {
             if (IPSSetUp::getSavedData('db_pre')) {
                 $this->prefix = IPSSetUp::getSavedData('db_pre');
                 return;
             }
         }
     }
     /* Still 'ere? */
     $this->prefix = $this->settings['sql_tbl_prefix'];
 }
开发者ID:Advanture,项目名称:Online-RolePlay,代码行数:23,代码来源:mysql_install.php

示例10: __construct

 /**
  * Constructor
  *
  * @access	public
  * @return	@e void
  */
 public function __construct(ipsRegistry $registry)
 {
     /* Make object */
     $this->registry = $registry;
     $this->DB = $this->registry->DB();
     $this->settings =& $this->registry->fetchSettings();
     $this->request =& $this->registry->fetchRequest();
     $this->cache = $this->registry->cache();
     $this->caches =& $this->registry->cache()->fetchCaches();
     //* Make sure tables exist that won't in pre 3.0 versions */
     if (is_file(IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower(ipsRegistry::$settings['sql_driver']) . '.php')) {
         /* Init vars */
         $UPGRADE_HISTORY_TABLE = '';
         $UPGRADE_TABLE_FIELD = '';
         $UPGRADE_SESSION_TABLE = '';
         $UPGRADE_CSS_PREVIOUS = '';
         $UPGRADE_TEMPLATE_PREVIOUS = '';
         require IPS_ROOT_PATH . 'setup/sql/ipb3_' . strtolower(ipsRegistry::$settings['sql_driver']) . '.php';
         /*noLibHook*/
         $prefix = $this->registry->dbFunctions()->getPrefix();
         if (!$this->DB->checkForTable('upgrade_history')) {
             if ($UPGRADE_HISTORY_TABLE) {
                 $this->DB->query(IPSSetUp::addPrefixToQuery($UPGRADE_HISTORY_TABLE, $prefix));
             }
         }
         if (!$this->DB->checkForField('upgrade_app', 'upgrade_history')) {
             if ($UPGRADE_TABLE_FIELD) {
                 $this->DB->query(IPSSetUp::addPrefixToQuery($UPGRADE_TABLE_FIELD, $prefix));
             }
         }
         if (!$this->DB->checkForTable('upgrade_sessions')) {
             if ($UPGRADE_SESSION_TABLE) {
                 $this->DB->query(IPSSetUp::addPrefixToQuery($UPGRADE_SESSION_TABLE, $prefix));
             }
         }
         if (!$this->DB->checkForTable('skin_css_previous')) {
             if ($UPGRADE_CSS_PREVIOUS) {
                 $this->DB->query(IPSSetUp::addPrefixToQuery($UPGRADE_CSS_PREVIOUS, $prefix));
             }
         }
         if (!$this->DB->checkForTable('skin_templates_previous')) {
             if ($UPGRADE_TEMPLATE_PREVIOUS) {
                 $this->DB->query(IPSSetUp::addPrefixToQuery($UPGRADE_TEMPLATE_PREVIOUS, $prefix));
             }
         }
     }
 }
开发者ID:ConnorChristie,项目名称:GrabViews-Live,代码行数:53,代码来源:1xx.php

示例11: doExecute

 /**
  * Execute selected method
  *
  * @access	public
  * @param	object		Registry object
  * @return	@e void
  */
 public function doExecute(ipsRegistry $registry)
 {
     /* Remove the FURL cache */
     @unlink(FURL_CACHE_PATH);
     /* Got anything to show? */
     $apps = explode(',', IPSSetUp::getSavedData('install_apps'));
     $vNums = IPSSetUp::getSavedData('version_numbers');
     $output = array();
     if (is_array($apps) and count($apps)) {
         foreach ($apps as $app) {
             /* Grab version numbers */
             $numbers = IPSSetUp::fetchAppVersionNumbers($app);
             /* Grab all numbers */
             $nums[$app] = IPSSetUp::fetchXmlAppVersions($app);
             /* Grab app data */
             $appData[$app] = IPSSetUp::fetchXmlAppInformation($app, $this->settings['gb_char_set']);
             $appClasses[$app] = IPSSetUp::fetchVersionClasses($app, $vNums[$app], $numbers['latest'][0]);
         }
         /* Got anything? */
         if (count($appClasses)) {
             foreach ($appClasses as $app => $data) {
                 foreach ($data as $num) {
                     if (is_file(IPSLib::getAppDir($app) . '/setup/versions/upg_' . $num . '/version_class.php')) {
                         $_class = 'version_class_' . $app . '_' . $num;
                         require_once IPSLib::getAppDir($app) . '/setup/versions/upg_' . $num . '/version_class.php';
                         /*noLibHook*/
                         $_tmp = new $_class($this->registry);
                         if (method_exists($_tmp, 'postInstallNotices')) {
                             $_t = $_tmp->postInstallNotices();
                             if (is_array($_t) and count($_t)) {
                                 $output[$app][$num] = array('long' => $nums[$app][$num], 'app' => $appData[$app], 'out' => implode("<br />", $_t));
                             }
                         }
                     }
                 }
             }
         }
     }
     /* Remove any SQL source files */
     IPSSetUp::removeSqlSourceFiles();
     /* Simply return the Done page */
     $this->registry->output->setTitle("Complete!");
     $this->registry->output->setHideButton(TRUE);
     $this->registry->output->addContent($this->registry->output->template()->upgrade_complete($output));
     $this->registry->output->sendOutput();
 }
开发者ID:ConnorChristie,项目名称:GrabViews,代码行数:53,代码来源:done.php

示例12: doExecute

 /**
  * Execute selected method
  *
  * @access	public
  * @param	object		Registry object
  * @return	@e void
  */
 public function doExecute(ipsRegistry $registry)
 {
     $_e = 0;
     /* Check input? */
     if ($this->request['do'] == 'check') {
         if (!$this->request['username']) {
             $_e = 1;
             $this->registry->output->addWarning('You must specify a display name for the admin account');
         }
         if (!$this->request['password']) {
             $_e = 1;
             $this->registry->output->addWarning('You must specify a password for the admin account');
         } else {
             if ($this->request['password'] != $this->request['confirm_password']) {
                 $_e = 1;
                 $this->registry->output->addWarning('The admin passwords did not match');
             }
         }
         if (!$this->request['email'] or IPSText::checkEmailAddress($this->request['email']) !== TRUE) {
             $_e = 1;
             $this->registry->output->addWarning('You must specify an email address for the admin account');
         }
         if ($_e) {
             $this->registry->output->setTitle("Admin: Errors");
             $this->registry->output->setNextAction('admin&do=check');
             $this->registry->output->addContent($this->registry->output->template()->page_admin());
             $this->registry->output->sendOutput();
         } else {
             /* Save Form Data */
             IPSSetUp::setSavedData('admin_user', $this->request['username']);
             IPSSetUp::setSavedData('admin_pass', $this->request['password']);
             IPSSetUp::setSavedData('admin_email', $this->request['email']);
             /* Next Action */
             $this->registry->autoLoadNextAction('install');
             return;
         }
     }
     /* Output */
     $this->registry->output->setTitle("Admin Account Creation");
     $this->registry->output->setNextAction('admin&do=check');
     $this->registry->output->addContent($this->registry->output->template()->page_admin());
     $this->registry->output->sendOutput();
 }
开发者ID:ConnorChristie,项目名称:GrabViews-Live,代码行数:50,代码来源:admin.php

示例13: checkForProblems

 /**
  * Check we can upgrade
  *
  * @return	mixed	Boolean true or error message
  */
 public function checkForProblems()
 {
     //-----------------------------------------
     // Compatibility check
     //-----------------------------------------
     $requiredIpbVersion = 32006;
     // 3.2.3
     $args = func_get_args();
     if (!empty($args)) {
         $numbers = IPSSetUp::fetchAppVersionNumbers('core');
         /* Are we upgrading core now? */
         if (isset($args[0]['core'])) {
             $ourVersion = $numbers['latest'][0];
         } else {
             $ourVersion = $numbers['current'][0];
         }
         if ($requiredIpbVersion > $ourVersion) {
             $allVersions = IPSSetUp::fetchXmlAppVersions('core');
             return "This version of IP.Chat requires IP.Board {$allVersions[$requiredIpbVersion]} or higher.";
         }
     }
     return TRUE;
 }
开发者ID:mover5,项目名称:imobackup,代码行数:28,代码来源:upgradeCheck.php

示例14: doExecute

 /**
  * Execute selected method
  *
  * @access	public
  * @param	object		Registry object
  * @return	@e void
  */
 public function doExecute(ipsRegistry $registry)
 {
     /* Delete sessions and continue */
     if ($this->request['do'] == 'rsessions') {
         IPSSetUp::removePreviousSession();
     }
     /* Rebuild from last session and continue */
     if ($this->request['do'] == 'rcontinue') {
         $oldSession = IPSSetUp::checkForPreviousSessions();
         if (count($oldSession) and $oldSession['_session_get']['section'] and $oldSession['_sd']['install_apps']) {
             IPSSetUp::restorePreviousSession($oldSession);
             exit;
         }
     }
     /* Check for failed upgrade */
     if (!$this->request['do'] or $this->request['do'] != 'rsessions') {
         $oldSession = IPSSetUp::checkForPreviousSessions();
         if (count($oldSession) and $oldSession['_session_get']['section'] and $oldSession['_sd']['install_apps']) {
             /* Page Output */
             $this->registry->output->setTitle("Applications");
             $this->registry->output->setNextAction('apps&do=rsessions');
             //$this->registry->output->setHideButton( TRUE );
             $this->registry->output->addContent($this->registry->output->template()->upgrade_previousSession($oldSession));
             $this->registry->output->sendOutput();
         }
     }
     /* Save data */
     if ($this->request['do'] == 'save') {
         $apps = explode(',', IPSSetUp::getSavedData('install_apps'));
         $toSave = array();
         $vNums = array();
         if (is_array($apps) and count($apps)) {
             foreach ($apps as $app) {
                 /* Grab version numbers */
                 $numbers = IPSSetUp::fetchAppVersionNumbers($app);
                 /* Grab all numbers */
                 $nums[$app] = IPSSetUp::fetchXmlAppVersions($app);
                 /* Grab app data */
                 $appData[$app] = IPSSetUp::fetchXmlAppInformation($app, $this->settings['gb_char_set']);
                 $appClasses[$app] = IPSSetUp::fetchVersionClasses($app, $numbers['current'][0], $numbers['latest'][0]);
                 /* Store starting vnums */
                 $vNums[$app] = $numbers['current'][0];
             }
             /* Got anything? */
             if (count($appClasses)) {
                 foreach ($appClasses as $app => $data) {
                     foreach ($data as $num) {
                         if (is_file(IPSLib::getAppDir($app) . '/setup/versions/upg_' . $num . '/version_class.php')) {
                             $_class = 'version_class_' . $app . '_' . $num;
                             require_once IPSLib::getAppDir($app) . '/setup/versions/upg_' . $num . '/version_class.php';
                             /*noLibHook*/
                             $_tmp = new $_class($this->registry);
                             if (method_exists($_tmp, 'preInstallOptionsSave')) {
                                 $_t = $_tmp->preInstallOptionsSave();
                                 if (is_array($_t) and count($_t)) {
                                     $toSave[$app][$num] = $_t;
                                 }
                             }
                         }
                     }
                 }
                 /* Save it */
                 if (count($toSave)) {
                     IPSSetUp::setSavedData('custom_options', $toSave);
                 }
                 if (count($vNums)) {
                     IPSSetUp::setSavedData('version_numbers', $vNums);
                 }
             }
         }
         /* Next Action */
         $this->registry->autoLoadNextAction('license');
     } else {
         if ($this->request['do'] == 'check') {
             /* Check Directory */
             if (!is_array($_POST['apps']) or !count($_POST['apps'])) {
                 /* We use 'warning' because it has same effect but does not block the 'next' button (which they'll want to use after selecting an app when page reloads) */
                 $this->registry->output->addWarning('You must select to upgrade at least one application');
             } else {
                 /* If it's lower than 3.0.0, then add in the removed apps */
                 if (IPSSetUp::is300plus() !== TRUE) {
                     $_POST['apps']['forums'] = 1;
                     $_POST['apps']['members'] = 1;
                     $_POST['apps']['calendar'] = 1;
                     $_POST['apps']['chat'] = 1;
                 } else {
                     if ($_POST['apps']['core']) {
                         $_POST['apps']['forums'] = 1;
                         $_POST['apps']['members'] = 1;
                     }
                 }
                 /* Save Form Data */
                 IPSSetUp::setSavedData('install_apps', implode(',', array_keys($_POST['apps'])));
//.........这里部分代码省略.........
开发者ID:mover5,项目名称:imobackup,代码行数:101,代码来源:apps.php

示例15: doExecute

 /**
  * Main function executed automatically by the controller
  *
  * @param	object		$registry		Registry object
  * @return	@e void
  */
 public function doExecute(ipsRegistry $registry)
 {
     //-----------------------------------------
     // Load skin
     //-----------------------------------------
     $this->html = $this->registry->output->loadTemplate('cp_skin_mycp');
     //-----------------------------------------
     // Load language
     //-----------------------------------------
     $this->registry->getClass('class_localization')->loadLanguageFile(array('admin_mycp'));
     /* This is a little hacky, but we have to allow access to the whole module to get access to 
        'change my details'.  This check just makes sure that we don't also get access to the Dashboard
        if the permission system automatically added permission for 'change my details' */
     if ($this->registry->getClass('class_permissions')->editDetailsOnly) {
         /* If they just don't have access to the dashboard, let's show them something we do have access to */
         if (!$this->request['app']) {
             foreach (ipsRegistry::$applications as $k => $data) {
                 if ($this->registry->getClass('class_permissions')->checkForAppAccess($k) and ($k != 'core' or !$this->registry->getClass('class_permissions')->editDetailsOnly)) {
                     foreach (ipsRegistry::$modules[$k] as $module) {
                         if ($this->registry->getClass('class_permissions')->checkForModuleAccess($k, $module['sys_module_key'])) {
                             $filepath = IPSLib::getAppDir($k) . '/modules_admin/' . $module['sys_module_key'] . '/defaultSection.php';
                             if (is_file($filepath)) {
                                 $DEFAULT_SECTION = '';
                                 include $filepath;
                                 /*noLibHook*/
                                 if ($this->registry->getClass('class_permissions')->checkForSectionAccess($k, $module['sys_module_key'], $DEFAULT_SECTION)) {
                                     $this->registry->output->silentRedirectWithMessage($this->settings['base_url'] . "app={$k}&amp;module={$module['sys_module_key']}&amp;section={$DEFAULT_SECTION}");
                                 }
                             }
                         }
                     }
                 }
             }
         }
         /* If all else fails, take them to the change details page */
         $this->registry->output->silentRedirectWithMessage($this->settings['base_url'] . "core&amp;module=mycp&amp;section=details");
     } else {
         if (!$this->registry->getClass('class_permissions')->checkPermission('dashboard', 'core', 'mycp')) {
             $this->registry->output->silentRedirectWithMessage($this->settings['base_url'] . "core&amp;module=mycp&amp;section=details");
         }
     }
     //-----------------------------------------
     // Set up stuff
     //-----------------------------------------
     $this->form_code = $this->html->form_code = 'module=mycp&amp;section=dashboard';
     $this->form_code_js = $this->html->form_code_js = 'module=mycp&section=dashboard';
     //-----------------------------------------
     // Hang on, do we need the upgrader?
     // The only reason this is still here, since we check on the login form, is because Rhett Buck AKA BHP wants to
     // login to the ACP, then upload files, then click the System tab and be automatically redirected to the upgrader.
     // Seriously though?  Who does that?  The login form redirects you, so if you happen to upload files and click on
     // the ACP link you're already covered.  Only Mr. RB, that's who.
     //-----------------------------------------
     if (!IN_DEV and (!defined('SKIP_UPGRADE_CHECK') or !SKIP_UPGRADE_CHECK)) {
         require_once IPS_ROOT_PATH . 'setup/sources/base/setup.php';
         /*noLibHook*/
         foreach (ipsRegistry::$applications as $app_dir => $app) {
             $_a = ($app_dir == 'forums' or $app_dir == 'members') ? 'core' : $app_dir;
             $numbers = IPSSetUp::fetchAppVersionNumbers($_a);
             if ($numbers['latest'][0] and $numbers['latest'][0] > $numbers['current'][0]) {
                 $this->registry->output->silentRedirect($this->settings['base_acp_url'] . '/upgrade/index.php?_acpRedirect=1');
                 return;
             }
         }
     }
     //-----------------------------------------
     // Get external data
     //-----------------------------------------
     $content = array();
     $thiscontent = "";
     $latest_version = array();
     $reg_end = "";
     $unfinished_upgrade = 0;
     $ipsNewsData = $this->cache->getCache('ipsNewsData');
     if (!isset($ipsNewsData['time']) or $ipsNewsData['time'] < time() - 43200) {
         $classToLoad = IPSLib::loadLibrary(IPS_KERNEL_PATH . 'classFileManagement.php', 'classFileManagement');
         $classFileManagement = new $classToLoad();
         if (strpos($this->settings['base_url'], 'https://') !== false) {
             $ipsNewsData['news'] = $classFileManagement->getFileContents('https://external.ipslink.com/ipboard33/dashboard/index.php?v=' . ipsRegistry::$vn_full);
             $ipsNewsData['vcheck'] = $classFileManagement->getFileContents('https://external.ipslink.com/latestversioncheck/ipb30x.php?' . base64_encode(ipsRegistry::$vn_full . '|^|' . $this->settings['board_url']));
         } else {
             $ipsNewsData['news'] = $classFileManagement->getFileContents('http://external.ipslink.com/ipboard33/dashboard/index.php?v=' . ipsRegistry::$vn_full);
             $ipsNewsData['vcheck'] = $classFileManagement->getFileContents('http://external.ipslink.com/latestversioncheck/ipb30x.php?' . base64_encode(ipsRegistry::$vn_full . '|^|' . $this->settings['board_url']));
         }
         $ipsNewsData['time'] = time();
         $this->cache->setCache('ipsNewsData', $ipsNewsData, array('array' => 1));
     }
     //-----------------------------------------
     // Get MySQL & PHP Version
     //-----------------------------------------
     $this->DB->getSqlVersion();
     //-----------------------------------------
     // Upgrade history?
     //-----------------------------------------
//.........这里部分代码省略.........
开发者ID:mover5,项目名称:imobackup,代码行数:101,代码来源:dashboard.php


注:本文中的IPSSetUp类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。