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


PHP IPSSetUp::fetchAppVersionNumbers方法代码示例

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


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

示例1: 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 "The version of {$appName} you have installed will not work with this version of IP.Board. You must upgrade {$appName} to {$allVersions[$v]} or higher, or disable it in the Admin CP in order continue.";
             }
         }
     }
     return TRUE;
 }
开发者ID:ConnorChristie,项目名称:GrabViews-Live,代码行数:34,代码来源:upgradeCheck.php

示例2: 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

示例3: 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

示例4: get

 public function get()
 {
     /* INIT */
     $entries = array();
     /* FURL cache OOD? */
     if (is_file(FURL_CACHE_PATH)) {
         $mtime = intval(@filemtime(FURL_CACHE_PATH));
         /* Check mtimes on extensions.. */
         foreach (ipsRegistry::$applications as $app_dir => $application) {
             if (is_file(IPSLib::getAppDir($app_dir) . '/extensions/furlTemplates.php')) {
                 $_mtime = intval(@filemtime(IPSLib::getAppDir($app_dir) . '/extensions/furlTemplates.php'));
                 if ($_mtime > $mtime) {
                     $entries[] = array($this->lang->words['furlcache_outofdate'], sprintf($this->lang->words['furlcache_outofdate_desc'], $application['app_title']) . "<a href='" . $this->settings['base_url'] . "app=core&amp;module=applications&amp;section=applications&amp;do=seoRebuild'>{$this->lang->words['rebuild_furl_cache']}</a>");
                     break;
                 }
             }
         }
     }
     /* Sphinx cache OOD? */
     if ($this->settings['search_method'] == 'sphinx') {
         $mtime = intval($this->cache->getCache('sphinx_config'));
         /* Check mtimes on extensions.. */
         foreach (ipsRegistry::$applications as $app_dir => $application) {
             if (is_file(IPSLib::getAppDir($app_dir) . '/extensions/sphinxTemplate.php')) {
                 $_mtime = intval(@filemtime(IPSLib::getAppDir($app_dir) . '/extensions/sphinxTemplate.php'));
                 if (!$mtime or $_mtime > $mtime) {
                     $entries[] = array($this->lang->words['sphinxconfig_outofdate'], $this->lang->words['sphinxconfig_outofdate_desc'] . ' ' . "<a href='" . $this->settings['base_url'] . "app=core&amp;module=applications&amp;section=applications&amp;do=applications_overview'>{$this->lang->words['rebuild_sphinx_config']}</a>");
                     break;
                 }
             }
         }
     }
     /* Minify on but /cache/tmp not writeable? */
     if (!empty($this->settings['_use_minify'])) {
         $entries[] = array($this->lang->words['minifywrite_head'], $this->lang->words['minifynot_writeable']);
     }
     /* Installer Check */
     if (@is_file(IPS_ROOT_PATH . 'install/index.php')) {
         if (!@is_file(DOC_IPS_ROOT_PATH . 'cache/installer_lock.php')) {
             $this->lang->words['cp_unlocked_warning'] = sprintf($this->lang->words['cp_unlocked_warning'], CP_DIRECTORY);
             $entries[] = array($this->lang->words['cp_unlockedinstaller'], $this->lang->words['cp_unlocked_warning']);
         }
     }
     /* Unfinished Upgrade */
     require_once IPS_ROOT_PATH . '/setup/sources/base/setup.php';
     /*noLibHook*/
     $versions = IPSSetUp::fetchAppVersionNumbers('core');
     if ($versions['current'][0] != $versions['latest'][0]) {
         $this->lang->words['cp_upgrade_warning'] = sprintf($this->lang->words['cp_upgrade_warning'], $versions['current'][1], $versions['latest'][1], $this->settings['base_acp_url']);
         $entries[] = array($this->lang->words['cp_unfinishedupgrade'], $this->lang->words['cp_upgrade_warning']);
     }
     /**
      * PHP Version Check
      * 
      * @todo	Remove this for 4.0? Installer/upgrader already do check for this anyway...
      */
     if (PHP_VERSION < '5.2.0') {
         $entries[] = array(sprintf($this->lang->words['cp_yourphpversion'], PHP_VERSION), $this->lang->words['cp_php_warning']);
     }
     /* Outgoing email address specified */
     if (!$this->settings['email_out'] or !$this->settings['email_in']) {
         $entries[] = array($this->lang->words['cp_missingemail'], "{$this->lang->words['cp_missingemail1']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&amp;module=settings&amp;section=settings&amp;do=findsetting&amp;key=email'>{$this->lang->words['cp_missingemail2']}</a>");
     }
     /* Board Offline Check */
     if ($this->settings['board_offline']) {
         $entries[] = array($this->lang->words['cp_boardoffline'], "{$this->lang->words['cp_boardoffline1']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&amp;module=settings&amp;section=settings&amp;do=findsetting&amp;key=boardoffline'>{$this->lang->words['cp_boardoffline2']}</a>");
     }
     /* Fulltext Check */
     if ($this->settings['search_method'] == 'traditional' and !$this->settings['use_fulltext'] and !$this->settings['hide_ftext_note']) {
         $entries[] = array($this->lang->words['fulltext_off'], "{$this->lang->words['fulltext_turnon']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&amp;module=settings&amp;section=settings&amp;do=findsetting&amp;key=searchsetup'>{$this->lang->words['fulltext_find']}</a>");
     }
     /* Make sure the profile directory is writable */
     if (!is_dir($this->settings['upload_dir'] . '/profile/') || !is_writable($this->settings['upload_dir'] . '/profile/')) {
         $entries[] = array($this->lang->words['cp_profilephotoerr_title'], sprintf($this->lang->words['cp_profilephotoerr_msg'], $this->settings['upload_dir'] . '/profile/'));
     }
     /* Check for upgrade finish folder */
     if (is_dir(IPS_ROOT_PATH . 'upgradeFinish/')) {
         $entries[] = array($this->lang->words['cp_upgradefinishfolder'], sprintf($this->lang->words['cp_upgradefinishfolder_msg'], IPS_ROOT_PATH . 'upgradeFinish/'));
     }
     /* Check to see if GD is intalled */
     if (!extension_loaded('gd') || !function_exists('gd_info')) {
         $entries[] = array($this->lang->words['cp_gdnotinstalled_title'], $this->lang->words['cp_gdnotinstalled_msg']);
     }
     /* Performance mode check */
     $perfMode = $this->cache->getCache('performanceCache');
     if (is_array($perfMode) && count($perfMode)) {
         $entries[] = array($this->lang->words['cp_perfmodeon_title'], $this->lang->words['cp_perfmodeon_msg']);
     }
     /* Suhosin check */
     if (extension_loaded('suhosin')) {
         $_postMaxVars = @ini_get('suhosin.post.max_vars');
         $_reqMaxVars = @ini_get('suhosin.request.max_vars');
         $_getMaxLen = @ini_get('suhosin.get.max_value_length');
         $_postMaxLen = @ini_get('suhosin.post.max_value_length');
         $_reqMaxLen = @ini_get('suhosin.request.max_value_length');
         $_reqMaxVar = @ini_get('suhosin.request.max_varname_length');
         if ($_postMaxVars < 4096) {
             $entries[] = array($this->lang->words['suhosin_notification'], sprintf($this->lang->words['suhosin_badvalue1'], $_postMaxVars));
         }
         if ($_reqMaxVars < 4096) {
//.........这里部分代码省略.........
开发者ID:ConnorChristie,项目名称:GrabViews,代码行数:101,代码来源:dashboardNotifications.php

示例5: 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

示例6: 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

示例7: showRedirectScreen

 /**
  * Show the redirect screen
  *
  * @param	string	$app_directory
  * @param	string	$output
  * @param	string	$errors
  * @param	string	$next_url
  * @return	@e void
  */
 protected function showRedirectScreen($app_directory, $output, $errors, $next_url)
 {
     /* Init Data */
     $data = IPSSetUp::fetchXmlAppInformation($app_directory, $this->settings['gb_char_set']);
     $_numbers = IPSSetUp::fetchAppVersionNumbers($app_directory);
     /* Grab Data */
     $data['app_directory'] = $app_directory;
     $data['current_version'] = $_numbers['current'][0] ? $_numbers['current'][0] : $this->lang->words['cur_version_none'];
     $data['latest_version'] = $_numbers['latest'][1];
     $data['next_version'] = $_numbers['next'][0];
     /* Setup Redirect */
     $this->registry->output->html .= $this->html->setup_redirectScreen($output, $errors, $next_url);
 }
开发者ID:Advanture,项目名称:Online-RolePlay,代码行数:22,代码来源:setup.php

示例8: loginForm

 /**
  * Log the user out
  *
  * @param	string		Message to show on the form
  * @return	@e void
  */
 public function loginForm($message = '')
 {
     //-----------------------------------------
     // Hang on, do we need the upgrader?
     //-----------------------------------------
     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;
             }
         }
     }
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $message = $message ? $message : $this->member->sessionClass()->getMessage();
     //-------------------------------------------------------
     // Remove all out of date sessions, like a good boy. Woof.
     //-------------------------------------------------------
     $cut_off_stamp = time() - 60 * 60 * 2;
     $this->DB->delete('core_sys_cp_sessions', "session_running_time < {$cut_off_stamp}");
     //------------------------------------------------------
     // Start form
     //------------------------------------------------------
     $qs = str_replace('&amp;', '&', IPSText::parseCleanValue(urldecode(my_getenv('QUERY_STRING'))));
     $qs = str_replace('adsess=', 'old_adsess=', $qs);
     $qs = str_replace('module=menu', '', $qs);
     $additional_data = $this->han_login->additionalFormHTML();
     $replace = false;
     $data = array();
     if (!is_null($additional_data) and is_array($additional_data) and count($additional_data)) {
         $replace = $additional_data[0];
         $data = $additional_data[1];
     }
     $uses_name = false;
     $uses_email = false;
     foreach (ipsRegistry::cache()->getCache('login_methods') as $method) {
         $login_methods[$method['login_folder_name']] = $method['login_folder_name'];
         if ($method['login_user_id'] == 'username' or $method['login_user_id'] == 'either') {
             $uses_name = true;
         }
         if ($method['login_user_id'] == 'email' or $method['login_user_id'] == 'either') {
             $uses_email = true;
         }
     }
     if ($uses_name and $uses_email) {
         $this->lang->words['gl_signinname'] = $this->lang->words['enter_name_and_email'];
     } else {
         if ($uses_email) {
             $this->lang->words['gl_signinname'] = $this->lang->words['enter_useremail'];
         } else {
             $this->lang->words['gl_signinname'] = $this->lang->words['enter_username'];
         }
     }
     ipsRegistry::getClass('output')->html_title = $this->lang->words['ipb_login'];
     ipsRegistry::getClass('output')->html_main = ipsRegistry::getClass('output')->global_template->log_in_form($qs, $message, $replace == 'replace' ? true : false, $data);
     ipsRegistry::getClass('output')->html_main = str_replace('<%TITLE%>', ipsRegistry::getClass('output')->html_title, ipsRegistry::getClass('output')->html_main);
     @header("Content-type: text/html");
     print ipsRegistry::getClass('output')->html_main;
     exit;
 }
开发者ID:ConnorChristie,项目名称:GrabViews,代码行数:72,代码来源:manualResolver.php

示例9: restorePreviousSession

 /**
  * Check for previous sessions.
  * Checks to see if there's an unfinished upgrade.
  *
  * @param	array
  * @access	public
  */
 public static function restorePreviousSession($session)
 {
     /* Delete all previous sessions */
     ipsRegistry::DB()->delete('upgrade_sessions', 'session_id != \'' . ipsRegistry::$request['s'] . '\'');
     /* Update the session */
     ipsRegistry::DB()->update('upgrade_sessions', array('session_current_time' => time(), 'session_section' => $session['session_section'], 'session_post' => serialize($session['_session_post']), 'session_get' => serialize($session['_session_get'])), 'session_id=\'' . ipsRegistry::$request['s'] . '\'');
     /* Set correct app */
     $_GET['app'] = 'upgrade';
     $_POST['app'] = 'upgrade';
     ipsRegistry::$request['app'] = 'upgrade';
     ipsRegistry::$current_section = 'upgrade';
     /* Set correct section */
     $_GET['section'] = $session['_session_get']['section'];
     $_POST['section'] = $session['_session_get']['section'];
     ipsRegistry::$request['section'] = $session['_session_get']['section'];
     ipsRegistry::$current_section = $session['_session_get']['section'];
     /* Set up the correct do */
     $_GET['do'] = $session['_session_get']['do'];
     $_POST['do'] = $session['_session_get']['do'];
     ipsRegistry::$request['do'] = $session['_session_get']['do'];
     /* Set up the correct previous */
     $_GET['previous'] = $session['_session_get']['previous'];
     $_POST['previous'] = $session['_session_get']['previous'];
     ipsRegistry::$request['previous'] = $session['_session_get']['previous'];
     /* Set up SD */
     $_POST['_sd'] = $session['_sd'];
     ipsRegistry::$request['_sd'] = $session['_sd'];
     /* App dir, etc */
     ipsRegistry::$request['appdir'] = $session['_sd']['appdir'];
     ipsRegistry::$request['man'] = $session['_sd']['man'];
     ipsRegistry::$request['helpfile'] = $session['_sd']['helpfile'];
     $apps = explode(',', $session['_sd']['install_apps']);
     $toSave = array();
     $vNums = array();
     /* set saved data */
     if (count($session['_sd'])) {
         foreach ($session['_sd'] as $k => $v) {
             if ($k) {
                 IPSSetUp::setSavedData($k, $v);
             }
         }
     }
     if (is_array($apps) and count($apps)) {
         /* Grab data */
         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);
             $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(ipsRegistry::instance());
                         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);
             }
         }
         /* Freeze data */
         IPSSetUp::freezeSavedData();
         /* Thaw it */
         IPSSetUp::thawSavedData();
     }
     /* Re run our controller */
     ipsController::run();
 }
开发者ID:ConnorChristie,项目名称:GrabViews,代码行数:96,代码来源:setup.php

示例10: doExecute

 /**
  * Main class entry point
  *
  * @access	public
  * @param	object		ipsRegistry reference
  * @return	void		[Outputs to screen]
  */
 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'));
     //-----------------------------------------
     // 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';
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     define('IPS_NEWS_URL', 'http://external./globalfeeds/news/');
     define('IPS_BULLETINS_URL', 'http://external./ipbfeeds/300/staffbulletin/');
     define('IPS_VERSION_CHECK_URL', 'http://www./latestversioncheck/ipb30x.php');
     $content = array();
     $thiscontent = "";
     $latest_version = array();
     $reg_end = "";
     $sm_install = 0;
     $lock_file = 0;
     $converter = 0;
     $fulltext_a = 0;
     $unfinished_upgrade = 0;
     $urls = array('news' => IPS_NEWS_URL, 'keiths_bits' => IPS_BULLETINS_URL, 'version_check' => IPS_VERSION_CHECK_URL, 'blogs' => 'http://external./globalfeeds/blog/');
     if (@file_exists(IPS_ROOT_PATH . 'install/index.php')) {
         $sm_install = 1;
     }
     if (@file_exists(DOC_IPS_ROOT_PATH . 'cache/installer_lock.php')) {
         $lock_file = 1;
     }
     if (@is_dir(IPS_ROOT_PATH . 'applications_addon/ips/convert/')) {
         $converter = 1;
         if (!@file_exists(DOC_IPS_ROOT_PATH . 'cache/converter_lock.php')) {
             $converter = 2;
         }
     }
     if ($this->DB->checkFulltextSupport()) {
         if (!$this->DB->getFulltextStatus('posts')) {
             $fulltext_a = 1;
         }
     }
     require_once IPS_ROOT_PATH . '/setup/sources/base/setup.php';
     $versions = IPSSetUp::fetchAppVersionNumbers('core');
     if ($versions['current'][0] != $versions['latest'][0]) {
         $unfinished_upgrade = 1;
     }
     //-----------------------------------------
     // Get MySQL & PHP Version
     //-----------------------------------------
     $this->DB->getSqlVersion();
     //-----------------------------------------
     // Upgrade history?
     //-----------------------------------------
     $latest_version = array('upgrade_version_id' => NULL);
     $this->DB->build(array('select' => '*', 'from' => 'upgrade_history', 'order' => 'upgrade_version_id DESC', 'limit' => array(1)));
     $this->DB->execute();
     while ($r = $this->DB->fetch()) {
         $latest_version = $r;
     }
     //-----------------------------------------
     // Resetting security image?
     //-----------------------------------------
     if ($this->request['reset_security_flag'] and $this->request['reset_security_flag'] == 1 and $this->request['new_build']) {
         $_latest = IPSLib::fetchVersionNumber('core');
         $new_build = intval($this->request['new_build']);
         $new_reason = trim(substr($this->request['new_reason'], 0, 1));
         $new_version = $_latest['long'] . '.' . $new_build . '.' . $new_reason;
         $this->DB->update('upgrade_history', array('upgrade_notes' => $new_version), 'upgrade_version_id=' . $latest_version['upgrade_version_id']);
         $latest_version['upgrade_notes'] = $new_version;
     }
     //-----------------------------------------
     // Got real version number?
     //-----------------------------------------
     ipsRegistry::$version = 'v' . $latest_version['upgrade_version_human'];
     ipsRegistry::$vn_full = (isset($latest_version['upgrade_notes']) and $latest_version['upgrade_notes']) ? $latest_version['upgrade_notes'] : ipsRegistry::$vn_full;
     //-----------------------------------------
     // Licensed?
     //-----------------------------------------
     $urls['keiths_bits'] = IPS_BULLETINS_URL . '?v=' . ipsRegistry::$vn_full;
     //-----------------------------------------
     // Notepad
     //-----------------------------------------
     if ($this->request['save'] and $this->request['save'] == 1) {
         $_POST['notes'] = $_POST['notes'] ? $_POST['notes'] : $this->lang->words['cp_acpnotes'];
         $this->cache->setCache('adminnotes', IPSText::stripslashes($_POST['notes']), array('donow' => 1, 'deletefirst' => 0, 'array' => 0));
     }
//.........这里部分代码省略.........
开发者ID:dalandis,项目名称:Visualization-of-Cell-Phone-Locations,代码行数:101,代码来源:dashboard.php

示例11: doExecute

 /**
  * Execute selected method
  * [ REPEAT FOR APPS: SQL > VERSION UPGRADER / FINISH ] -> SETTINGS  > TEMPLATES > TASKS > LANGUAGES > PUBLIC LANGUAGES > BBCODE > ACP HELP OTHER [ Email Templates ] > Build Caches
  *
  * @access	public
  * @param	object		Registry object
  * @return	@e void
  */
 public function doExecute(ipsRegistry $registry)
 {
     /* Set Up */
     IPSSetUp::setSavedData('man', intval($this->request['man']) ? intval($this->request['man']) : IPSSetUp::getSavedData('man'));
     IPSSetUp::setSavedData('appdir', $this->request['appdir'] ? $this->request['appdir'] : IPSSetUp::getSavedData('appdir'));
     IPSSetUp::setSavedData('helpfile', intval($this->request['helpfile']) ? intval($this->request['helpfile']) : IPSSetUp::getSavedData('helpfile'));
     /* Do we have a current application? */
     if (!IPSSetUp::getSavedData('appdir')) {
         $_app = IPSSetUp::fetchNextApplication('', '', $this->settings['gb_char_set']);
         IPSSetUp::setSavedData('appdir', $_app['key']);
     }
     /* Set current app */
     $this->_currentApp = IPSSetUp::getSavedData('appdir');
     /* Fetch numbers */
     $numbers = IPSSetUp::fetchAppVersionNumbers($this->_currentApp);
     /* Set numbers */
     $this->_currentLong = $numbers['current'][0];
     $this->_currentHuman = $numbers['current'][1];
     $this->_uipLong = $numbers['next'][0];
     $this->_uipHuman = $numbers['next'][1];
     $this->_latestLong = $numbers['latest'][0];
     $this->_latestHuman = $numbers['latest'][1];
     $this->_dbDriver = strtolower($this->settings['sql_driver']);
     if ($this->_currentApp) {
         $this->_appData = IPSSetUp::fetchXmlAppInformation($this->_currentApp, $this->settings['gb_char_set']);
         if ($this->_currentApp == 'core') {
             $this->_appData['name'] = 'IP.Board';
         }
     }
     /* Fail safe */
     if (!$this->_currentApp) {
         print "No app";
         exit;
     }
     $this->registry->output->setVersionAndApp($this->_uipHuman, $this->_appData);
     /* Switch */
     switch ($this->request['do']) {
         case 'sql':
             $this->_stepCount = 1;
             $this->install_sql();
             break;
         case 'appclass':
             $this->_stepCount = 2;
             $this->install_appclass();
             break;
         case 'checkdb':
             $this->_stepCount = 3;
             $this->install_checkdb();
             break;
         case 'modules':
             $this->_stepCount = 4;
             $this->install_modules();
             break;
         case 'settings':
             $this->_stepCount = 5;
             $this->install_settings();
             break;
         case 'templates':
             $this->_stepCount = 6;
             $this->install_templates();
             break;
         case 'tasks':
             $this->_stepCount = 7;
             $this->install_tasks();
             break;
         case 'languages':
             $this->_stepCount = 8;
             $this->install_languages();
             break;
         case 'clientlanguages':
             $this->_stepCount = 9;
             $this->install_client_languages();
             break;
         case 'bbcode':
             $this->_stepCount = 10;
             $this->install_bbcode();
             break;
         case 'acphelp':
             $this->_stepCount = 11;
             $this->install_acphelp();
             break;
         case 'other':
             $this->_stepCount = 12;
             $this->install_other();
             break;
         case 'caches':
             $this->_stepCount = 13;
             $this->install_caches();
             break;
         case 'templatecache':
             $this->_stepCount = 14;
             $this->install_template_caches();
//.........这里部分代码省略.........
开发者ID:Advanture,项目名称:Online-RolePlay,代码行数:101,代码来源:upgrade.php

示例12: get


//.........这里部分代码省略.........
                     break;
                 }
             }
         }
     }
     /* Sphinx cache OOD? */
     if ($this->settings['search_method'] == 'sphinx') {
         $mtime = intval($this->cache->getCache('sphinx_config'));
         /* Check mtimes on extensions.. */
         foreach (ipsRegistry::$applications as $app_dir => $application) {
             if (is_file(IPSLib::getAppDir($app_dir) . '/extensions/sphinxTemplate.php')) {
                 $_mtime = intval(@filemtime(IPSLib::getAppDir($app_dir) . '/extensions/sphinxTemplate.php'));
                 if (!$mtime or $_mtime > $mtime) {
                     $entries[] = array($this->lang->words['sphinxconfig_outofdate'], $this->lang->words['sphinxconfig_outofdate_desc'] . ' ' . "<a href='" . $this->settings['base_url'] . "app=core&amp;module=applications&amp;section=applications&amp;do=applications_overview'>{$this->lang->words['rebuild_sphinx_config']}</a>");
                     break;
                 }
             }
         }
     }
     /* Minify on but /cache/tmp not writeable? */
     if (!empty($this->settings['_use_minify'])) {
         $entries[] = array($this->lang->words['minifywrite_head'], $this->lang->words['minifynot_writeable']);
     }
     /* Installer Check */
     if (@is_file(IPS_ROOT_PATH . 'install/index.php')) {
         if (!@is_file(DOC_IPS_ROOT_PATH . 'cache/installer_lock.php')) {
             $this->lang->words['cp_unlocked_warning'] = sprintf($this->lang->words['cp_unlocked_warning'], CP_DIRECTORY);
             $entries[] = array($this->lang->words['cp_unlockedinstaller'], $this->lang->words['cp_unlocked_warning']);
         }
     }
     /* Unfinished Upgrade */
     require_once IPS_ROOT_PATH . '/setup/sources/base/setup.php';
     /*noLibHook*/
     $versions = IPSSetUp::fetchAppVersionNumbers('core');
     if ($versions['current'][0] != $versions['latest'][0]) {
         $this->lang->words['cp_upgrade_warning'] = sprintf($this->lang->words['cp_upgrade_warning'], $versions['current'][1], $versions['latest'][1], $this->settings['base_acp_url']);
         $entries[] = array($this->lang->words['cp_unfinishedupgrade'], $this->lang->words['cp_upgrade_warning']);
     }
     /**
      * PHP Version Check
      * 
      * @todo	Remove this for 4.0? Installer/upgrader already do check for this anyway...
      */
     if (PHP_VERSION < '5.2.0') {
         $entries[] = array(sprintf($this->lang->words['cp_yourphpversion'], PHP_VERSION), $this->lang->words['cp_php_warning']);
     }
     /* Outgoing email address specified */
     if (!$this->settings['email_out'] or !$this->settings['email_in']) {
         $entries[] = array($this->lang->words['cp_missingemail'], "{$this->lang->words['cp_missingemail1']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&amp;module=settings&amp;section=settings&amp;do=findsetting&amp;key=email'>{$this->lang->words['cp_missingemail2']}</a>");
     }
     /* Board Offline Check */
     if ($this->settings['board_offline']) {
         $entries[] = array($this->lang->words['cp_boardoffline'], "{$this->lang->words['cp_boardoffline1']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&amp;module=settings&amp;section=settings&amp;do=findsetting&amp;key=boardoffline'>{$this->lang->words['cp_boardoffline2']}</a>");
     }
     /* Fulltext Check */
     if ($this->settings['search_method'] == 'traditional' and !$this->settings['use_fulltext'] and !$this->settings['hide_ftext_note']) {
         $entries[] = array($this->lang->words['fulltext_off'], "{$this->lang->words['fulltext_turnon']}<br /><br />{$this->lang->words['_raquo']} <a href='" . $this->settings['base_url'] . "&amp;module=settings&amp;section=settings&amp;do=findsetting&amp;key=searchsetup'>{$this->lang->words['fulltext_find']}</a>");
     }
     /* Make sure the profile directory is writable */
     if (!is_dir($this->settings['upload_dir'] . '/profile/') || !is_writable($this->settings['upload_dir'] . '/profile/')) {
         $entries[] = array($this->lang->words['cp_profilephotoerr_title'], sprintf($this->lang->words['cp_profilephotoerr_msg'], $this->settings['upload_dir'] . '/profile/'));
     }
     /* Check for upgrade finish folder */
     if (is_dir(IPS_ROOT_PATH . 'upgradeFinish/')) {
         $entries[] = array($this->lang->words['cp_upgradefinishfolder'], sprintf($this->lang->words['cp_upgradefinishfolder_msg'], IPS_ROOT_PATH . 'upgradeFinish/'));
     }
开发者ID:Advanture,项目名称:Online-RolePlay,代码行数:67,代码来源:dashboardNotifications.php

示例13: applicationViewDetails

 /**
  * View details about an application
  *
  * @return	@e void		[Outputs to screen]
  */
 protected function applicationViewDetails()
 {
     $id = intval($this->request['app_id']);
     if (!$id) {
         $this->registry->output->showError($this->lang->words['a_noid'], 11110.1);
     }
     $appData = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'core_applications', 'where' => 'app_id=' . $id));
     if (!$appData['app_id']) {
         $this->registry->output->showError($this->lang->words['a_nodetails'], 11111.1);
     }
     /* Format dates */
     $lastUpdate = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'upgrade_history', 'where' => "upgrade_app='{$appData['app_directory']}'", 'order' => 'upgrade_version_id DESC', 'limit' => array(1)));
     $appData['_installed'] = $this->registry->getClass('class_localization')->getDate($appData['app_added'], 'DATE');
     $appData['_updated'] = $lastUpdate['upgrade_date'] > $appData['app_added'] ? $this->registry->getClass('class_localization')->getDate($lastUpdate['upgrade_date'], 'DATE') : '--';
     /* Get the setup class */
     require_once IPS_ROOT_PATH . "setup/sources/base/setup.php";
     /*noLibHook*/
     /* Version numbers */
     $_a = in_array($appData['app_directory'], array('forums', 'members')) ? 'core' : $appData['app_directory'];
     $numbers = IPSSetUp::fetchAppVersionNumbers($_a);
     $appData['_human_version'] = $numbers['latest'][1];
     $appData['_long_version'] = $numbers['latest'][0];
     $appData['_human_current'] = $numbers['current'][1];
     $appData['_long_current'] = $numbers['current'][0];
     /* Got updates? */
     if ($appData['app_update_check']) {
         /* Get hooks file for update check */
         $classToLoad = IPSLib::loadActionOverloader(IPSLib::getAppDir('core') . '/modules_admin/applications/hooks.php', 'admin_core_applications_hooks');
         $hooksClass = new $classToLoad();
         $hooksClass->makeRegistryShortcuts($this->registry);
         $appData['app_update_available'] = $hooksClass->_updateAvailable($appData['app_update_check'], $appData['app_long_version']);
     } else {
         $appData['app_update_available'] = array(0);
     }
     /* Get related hooks */
     $hooks = array();
     $this->DB->build(array('select' => '*', 'from' => 'core_hooks', 'where' => 'hook_requirements LIKE \'%:"' . $this->DB->addSlashes($appData['app_directory']) . '";a:%\'', 'order' => 'hook_id ASC'));
     $outer = $this->DB->execute();
     /* Got results? */
     if ($this->DB->getTotalRows($outer)) {
         /* Get hooks file for update check */
         $classToLoad = IPSLib::loadActionOverloader(IPSLib::getAppDir('core') . '/modules_admin/applications/hooks.php', 'admin_core_applications_hooks');
         $hooksClass = new $classToLoad();
         $hooksClass->makeRegistryShortcuts($this->registry);
         /* Loop */
         while ($rh = $this->DB->fetch($outer)) {
             /* Check requirements */
             if ($rh['hook_enabled']) {
                 $rh['_require_errors'] = $hooksClass->checkHookRequirements($rh);
             }
             $hooks[] = $rh;
         }
     }
     /* Upgrade history */
     $upgradeHistory = array();
     $this->DB->build(array('select' => '*', 'from' => 'upgrade_history', 'where' => "upgrade_app='" . $this->DB->addSlashes($appData['app_directory']) . "'", 'order' => 'upgrade_version_id DESC'));
     $this->DB->execute();
     while ($r = $this->DB->fetch()) {
         $upgradeHistory[] = $r;
     }
     /* Output */
     $this->registry->output->html .= $this->html->application_details($appData, $upgradeHistory, $hooks);
 }
开发者ID:ConnorChristie,项目名称:GrabViews-Live,代码行数:68,代码来源:applications.php

示例14: doExecute

 /**
  * Execute selected method
  *
  * @access	public
  * @param	object		Registry object
  * @return	void
  */
 public function doExecute(ipsRegistry $registry)
 {
     /* 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);
                 $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 (file_exists(IPSLib::getAppDir($app) . '/setup/versions/upg_' . $num . '/version_class.php')) {
                             $_class = 'version_class_' . $num;
                             require_once IPSLib::getAppDir($app) . '/setup/versions/upg_' . $num . '/version_class.php';
                             $_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('upgrade');
     } else {
         if ($this->request['do'] == 'check') {
             /* Check Directory */
             if (!is_array($_POST['apps']) or !count($_POST['apps'])) {
                 $this->registry->output->addError('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;
                     $_POST['apps']['portal'] = 1;
                     //$_POST['apps']['subscriptions'] = 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'])));
                 /* Got any app-version classes? */
                 $appClasses = array();
                 $output = array();
                 $nums = array();
                 $appData = array();
                 foreach ($_POST['apps'] as $app => $val) {
                     /* Grab version numbers */
                     $numbers = IPSSetUp::fetchAppVersionNumbers($app);
                     /* Grab all numbers */
                     $nums[$app] = IPSSetUp::fetchXmlAppVersions($app);
                     /* Grab app data */
                     $appData[$app] = IPSSetUp::fetchXmlAppInformation($app);
                     $appClasses[$app] = IPSSetUp::fetchVersionClasses($app, $numbers['current'][0], $numbers['latest'][0]);
                 }
                 /* Got anything? */
                 if (count($appClasses)) {
                     foreach ($appClasses as $app => $data) {
                         foreach ($data as $num) {
                             if (file_exists(IPSLib::getAppDir($app) . '/setup/versions/upg_' . $num . '/version_class.php')) {
                                 $_class = 'version_class_' . $num;
                                 require_once IPSLib::getAppDir($app) . '/setup/versions/upg_' . $num . '/version_class.php';
                                 $_tmp = new $_class($this->registry);
                                 if (method_exists($_tmp, 'preInstallOptionsForm')) {
                                     $_t = $_tmp->preInstallOptionsForm();
//.........这里部分代码省略.........
开发者ID:dalandis,项目名称:Visualization-of-Cell-Phone-Locations,代码行数:101,代码来源:apps.php

示例15: applicationsOverview

 /**
  * List applications
  *
  * @access	private
  * @return	void		[Outputs to screen]
  */
 private function applicationsOverview()
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $folders = array();
     $application = array();
     $_apps = array();
     $seen_count = 0;
     $total_items = 0;
     $uninstalled = array();
     /* Get the setup class */
     require IPS_ROOT_PATH . "setup/sources/base/setup.php";
     //-----------------------------------------
     // Get DB applications
     //-----------------------------------------
     $this->DB->build(array('select' => '*', 'from' => 'core_applications', 'order' => 'app_position'));
     $this->DB->execute();
     while ($row = $this->DB->fetch()) {
         $_apps[IPSLib::getAppFolder($row['app_directory']) . '/' . $row['app_directory']] = $row;
         $total_items++;
     }
     //-----------------------------------------
     // Get folder applications...
     //-----------------------------------------
     foreach (array('applications', 'applications_addon/ips', 'applications_addon/other') as $folder) {
         try {
             foreach (new DirectoryIterator(IPS_ROOT_PATH . $folder) as $file) {
                 if (!$file->isDot() and $file->isDir()) {
                     $_name = $file->getFileName();
                     if (substr($_name, 0, 1) != '.') {
                         $folders[$folder . '/' . $_name] = $_name;
                     }
                 }
             }
         } catch (Exception $e) {
         }
     }
     //-----------------------------------------
     // Installed Loop...
     //-----------------------------------------
     foreach ($_apps as $_app_path => $row) {
         $app_dir = $row['app_directory'];
         //-----------------------------------------
         // Enabled?
         //-----------------------------------------
         $row['_app_enabled'] = $row['app_enabled'] ? 'tick.png' : 'cross.png';
         /* Version numbers */
         $_a = ($app_dir == 'forums' or $app_dir == 'members') ? 'core' : $app_dir;
         $numbers = IPSSetUp::fetchAppVersionNumbers($_a);
         $row['_human_version'] = $numbers['latest'][1];
         $row['_long_version'] = $numbers['latest'][0];
         $row['_human_current'] = $numbers['current'][1];
         $row['_long_current'] = $numbers['current'][0];
         /* Exists? */
         if (!file_exists(IPSLib::getAppDir($app_dir))) {
             $row['_missing'] = 1;
         }
         $seen_count++;
         $application[$row['app_location']][] = $row;
     }
     /* Make sure they are in the proper order, hacky but it works :) */
     $__apps = array();
     $__apps['root'] = $application['root'] ? $application['root'] : array();
     $__apps['ips'] = $application['ips'] ? $application['ips'] : array();
     $__apps['other'] = $application['other'] ? $application['other'] : array();
     $application = $__apps;
     //-----------------------------------------
     // Uninstalled
     //-----------------------------------------
     foreach ($folders as $filepath => $_file) {
         if (!in_array($filepath, array_keys($_apps))) {
             $info = IPSSetUp::fetchXmlAppInformation($_file);
             /* OK, we're making no effort to conceal the secret behind the ipskey. It's an honourable setting - do not abuse it.
             			   We only mildly obfuscate it to stop copy and paste mistakes in information.xml
             			*/
             $okToGo = 0;
             if (strstr($filepath, 'applications_addon/ips') or strstr($filepath, 'applications/')) {
                 if (md5('ips_' . $_file) == $info['ipskey']) {
                     $okToGo = 1;
                 }
             } else {
                 if (strstr($filepath, 'applications_addon/other')) {
                     if (!$info['ipskey']) {
                         $okToGo = 1;
                     }
                 }
             }
             $uninstalled[$_file] = array('title' => $info['name'], 'author' => $info['author'], 'path' => $filepath, 'okToGo' => $okToGo, 'directory' => $_file);
         }
     }
     //-----------------------------------------
     // Show it...
     //-----------------------------------------
//.........这里部分代码省略.........
开发者ID:dalandis,项目名称:Visualization-of-Cell-Phone-Locations,代码行数:101,代码来源:applications.php


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