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


PHP IPSSetUp::fetchXmlAppVersions方法代码示例

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


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

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

示例6: _getAppVersions

 /**
  * Get application versions
  *
  * @return	@e void		[Outputs to screen]
  */
 protected function _getAppVersions()
 {
     /* Init vars */
     $i = intval($this->request['i']);
     $app = trim($this->request['chosenApp']);
     $versions = array();
     /* Load setup library & get versions */
     require_once IPS_ROOT_PATH . 'setup/sources/base/setup.php';
     /*noLibHook*/
     $_versions = IPSSetUp::fetchXmlAppVersions($app);
     krsort($_versions);
     /* Setup our default 'no version' value */
     $versions[] = array(0, $this->lang->words['h_any_version']);
     foreach ($_versions as $long => $human) {
         if ($long < 30000 && in_array($app, array('core', 'forums', 'members'))) {
             continue;
         }
         $versions[] = array($long, $human);
     }
     /* Return data ;o */
     $minVersions = $this->registry->output->formDropdown("minVersion[{$i}]", $versions);
     $maxVersions = $this->registry->output->formDropdown("maxVersion[{$i}]", $versions);
     $this->returnHtml("{$this->lang->words['a_min']}: {$minVersions}<br /><br />{$this->lang->words['a_max']}: {$maxVersions}");
 }
开发者ID:ConnorChristie,项目名称:GrabViews,代码行数:29,代码来源:hooks.php

示例7: fetchVersionNumber

 /**
  * Little function to return the version number data
  *
  * Handy to use when dealing with IN_DEV, etc
  * Uses the constant where available
  *
  * @access	public
  * @param	string  App ( Default 'core')
  * @return	array  array( 'long' => x, 'human' => x )
  */
 public static function fetchVersionNumber($app = 'core')
 {
     if (!defined(IPB_VERSION) or !defined(IPB_LONG_VERSION)) {
         require_once IPS_ROOT_PATH . 'setup/sources/base/setup.php';
         $XMLVersions = IPSSetUp::fetchXmlAppVersions($app);
         $tmp = $XMLVersions;
         krsort($tmp);
         foreach ($tmp as $long => $human) {
             $return = array('long' => $long, 'human' => $human);
             break;
         }
     } else {
         $return = array('long' => IPB_LONG_VERSION, 'human' => IPB_VERSION);
     }
     return $return;
 }
开发者ID:dalandis,项目名称:Visualization-of-Cell-Phone-Locations,代码行数:26,代码来源:core.php

示例8: checkHookRequirements

 /**
  * Check if the hook meets all the requirements
  * 
  * @param	mixed	$hook	Can be an hook ID or an array of the hook data
  * @return	@e array Errors found
  */
 public function checkHookRequirements($hook)
 {
     /* Init vars */
     $hookData = array();
     $reqsData = array();
     $errors = array();
     /* We already have some data? */
     if (is_array($hook) && count($hook)) {
         $hookData = $hook;
     } elseif (is_int($hook)) {
         $hookData = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $hook));
     }
     /* Requirements are still serialized? */
     if (IPSLib::isSerialized($hookData['hook_requirements'])) {
         $hookData['hook_requirements'] = unserialize($hookData['hook_requirements']);
     }
     /* Make our var shorter... */
     $reqsData =& $hookData['hook_requirements'];
     /* Old data? - @todo: remove this check around 3.3(4?) */
     if (!isset($reqsData['required_applications']['core']) && isset($reqsData['hook_ipb_version_min']) && ($reqsData['hook_ipb_version_min'] > 0 || $reqsData['hook_ipb_version_max'] > 0)) {
         $reqsData['hook_ipb_version_min'] = $reqsData['hook_ipb_version_min'] < 30000 ? 30000 : $reqsData['hook_ipb_version_min'];
         $reqsData['required_applications']['core'] = array('min_version' => intval($reqsData['hook_ipb_version_min']), 'max_version' => intval($reqsData['hook_ipb_version_max']));
     }
     //-----------------------------------------
     // Let's start checking requirements
     //-----------------------------------------
     /* PHP */
     if ($reqsData['hook_php_version_min'] or $reqsData['hook_php_version_max']) {
         if ($reqsData['hook_php_version_min'] and version_compare(PHP_VERSION, $reqsData['hook_php_version_min'], '<') == true) {
             $errors['php_min'] = sprintf($this->lang->words['h_phpold'], $reqsData['hook_php_version_min']);
         }
         if ($reqsData['hook_php_version_max'] and version_compare(PHP_VERSION, $reqsData['hook_php_version_max'], '>') == true) {
             $errors['php_max'] = sprintf($this->lang->words['h_phpnew'], $reqsData['hook_php_version_max']);
         }
     }
     /* Additional applications */
     if (is_array($reqsData['required_applications']) && count($reqsData['required_applications'])) {
         /* Get the setup class */
         require_once IPS_ROOT_PATH . 'setup/sources/base/setup.php';
         /*noLibHook*/
         /* Loop through all apps */
         foreach ($reqsData['required_applications'] as $appKey => $appData) {
             /* Versions file doesn't exist? */
             if (!is_file(IPSLib::getAppDir($appKey) . '/xml/versions.xml')) {
                 $errors[$appKey . '_app'] = sprintf($this->lang->words['hook_require_appnotfound'], $appData['app_name']);
             } elseif (!IPSLib::appIsInstalled($appKey)) {
                 $errors[$appKey . '_app'] = sprintf($this->lang->words['hook_require_appdisabled'], ipsRegistry::$applications[$appKey]['app_title']);
             } elseif ($appData['min_version'] or $appData['max_version']) {
                 /* Fetch and check versions */
                 if (!isset($this->cachedVersions[$appKey])) {
                     $this->cachedVersions[$appKey] = IPSSetUp::fetchXmlAppVersions($appKey);
                 }
                 $versions = $this->cachedVersions[$appKey];
                 if (is_array($versions) && count($versions)) {
                     if (!isset($this->cachedUpgradeInfo[$appKey])) {
                         $_key = in_array($appKey, array('forums', 'members')) ? 'core' : $appKey;
                         $this->cachedUpgradeInfo[$_key] = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'upgrade_history', 'where' => "upgrade_app='{$_key}'", 'order' => 'upgrade_version_id DESC', 'limit' => array(1)));
                         /* Extra caching for the three core apps */
                         if (in_array($appKey, array('core', 'forums', 'members'))) {
                             $this->cachedUpgradeInfo['core'] = $this->cachedUpgradeInfo[$_key];
                             $this->cachedUpgradeInfo['forums'] = $this->cachedUpgradeInfo[$_key];
                             $this->cachedUpgradeInfo['members'] = $this->cachedUpgradeInfo[$_key];
                         }
                     }
                     /* Do we meet tha requirements? */
                     if ($appData['min_version'] and $this->cachedUpgradeInfo[$appKey]['upgrade_version_id'] < $appData['min_version']) {
                         $errors[$appKey . '_min'] = sprintf($this->lang->words['hook_require_tooold'], isset($versions[$appData['min_version']]) ? $versions[$appData['min_version']] : $appData['min_version']);
                     }
                     if ($appData['max_version'] and $this->cachedUpgradeInfo[$appKey]['upgrade_version_id'] > $appData['max_version']) {
                         $errors[$appKey . '_max'] = sprintf($this->lang->words['hook_require_toonew'], isset($versions[$appData['max_version']]) ? $versions[$appData['max_version']] : $appData['max_version']);
                     }
                 }
             }
         }
     }
     return $errors;
 }
开发者ID:ConnorChristie,项目名称:GrabViews,代码行数:83,代码来源:hooks.php

示例9: _checkRequirements

 /**
  * Check if you meet hook requirements
  *
  * @access	private
  * @return	void		[Outputs to screen]
  */
 private function _checkRequirements()
 {
     $id = intval($this->request['id']);
     if (!$id) {
         $this->registry->output->showError($this->lang->words['h_norequirements'], 11112);
     }
     $hookData = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'core_hooks', 'where' => 'hook_id=' . $id));
     if (!$hookData['hook_id']) {
         $this->registry->output->showError($this->lang->words['h_norequirements'], 11113);
     }
     $hookData['hook_requirements'] = unserialize($hookData['hook_requirements']);
     $hookIpbBad = false;
     $hookPhpBad = false;
     /* Ensure we match at least 3.0.0 */
     $hookData['hook_requirements']['hook_ipb_version_min'] = $hookData['hook_requirements']['hook_ipb_version_min'] < 30000 ? 30000 : $hookData['hook_requirements']['hook_ipb_version_min'];
     if ($hookData['hook_requirements']['hook_ipb_version_min'] or $hookData['hook_requirements']['hook_ipb_version_max']) {
         /* Get the setup class */
         require IPS_ROOT_PATH . "setup/sources/base/setup.php";
         /* Fetch numbers */
         $versions = IPSSetUp::fetchXmlAppVersions('core');
         $currentIPB = (int) IPB_LONG_VERSION;
         if ($hookData['hook_requirements']['hook_ipb_version_min'] and $currentIPB < $hookData['hook_requirements']['hook_ipb_version_min']) {
             $hookIpbBad = $this->lang->words['h_tooold'];
         }
         if ($hookData['hook_requirements']['hook_ipb_version_max'] and $currentIPB > $hookData['hook_requirements']['hook_ipb_version_max']) {
             $hookIpbBad = $this->lang->words['h_toonew'];
         }
         foreach ($versions as $long => $human) {
             if ($hookData['hook_requirements']['hook_ipb_version_min'] <= $long) {
                 $hookData['hook_requirements']['hook_ipb_version_min'] = $human;
                 break;
             }
         }
         krsort($versions);
         foreach ($versions as $long => $human) {
             if ($hookData['hook_requirements']['hook_ipb_version_max'] >= $long) {
                 $hookData['hook_requirements']['hook_ipb_version_max'] = $human;
                 break;
             }
         }
     }
     if ($hookData['hook_requirements']['hook_php_version_min'] or $hookData['hook_requirements']['hook_php_version_max']) {
         if ($hookData['hook_requirements']['hook_php_version_min'] and version_compare(PHP_VERSION, $hookData['hook_requirements']['hook_php_version_min'], '<') == true) {
             $hookPhpBad = $this->lang->words['h_phpold'];
         }
         if ($hookData['hook_requirements']['hook_php_version_max'] and version_compare(PHP_VERSION, $hookData['hook_requirements']['hook_php_version_max'], '>') == true) {
             $hookPhpBad = $this->lang->words['h_phpnew'];
         }
     }
     /* Output */
     $this->registry->output->html .= $this->html->hookRequirements($hookData, $hookIpbBad, $hookPhpBad);
 }
开发者ID:dalandis,项目名称:Visualization-of-Cell-Phone-Locations,代码行数:58,代码来源:hooks.php

示例10: fetchSession

 /**
  * Fetch a session
  *
  * @access	public
  * @param	int			Session ID
  * @param	bool		Parse data
  * @return	mixed 		Array of data, or false
  */
 public function fetchSession($diffSessionID, $parse = false)
 {
     $session = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'skin_merge_session', 'where' => 'merge_id=' . $diffSessionID));
     if ($session['merge_id'] and $parse === true) {
         /* Fetch set up class */
         require_once IPS_ROOT_PATH . "setup/sources/base/setup.php";
         /*noLibHook*/
         /* Fetch version numbers */
         $versions = IPSSetUp::fetchXmlAppVersions('core');
         /* Prep dates */
         $session['_date'] = ipsRegistry::getClass('class_localization')->getDate($session['merge_date'], 'TINY');
         /* Prep version numbers */
         $session['_oldHumanVersion'] = $versions[$session['merge_old_version']];
         $session['_newHumanVersion'] = $versions[$session['merge_new_version']];
         /* Skin data */
         $session['_skinData'] = $this->fetchSkinData($session['merge_set_id']);
         /* Title */
         $session['_title'] = $this->fetchReportTitle($session);
     }
     return $session['merge_id'] ? $session : FALSE;
 }
开发者ID:ConnorChristie,项目名称:GrabViews,代码行数:29,代码来源:skinDifferences.php

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


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