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


PHP I2CE::allSystemsAreGoGo方法代码示例

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


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

示例1: _updateSite

 protected static function _updateSite($site_module_file, $verbose_errors = true)
 {
     $config = I2CE::getConfig();
     $status = I2CE::allSystemsAreGoGo($site_module_file, true);
     I2CE::raiseError("Updating site for {$site_module_file}: {$status}");
     if (substr($status, 0, 11) == 'in_progress') {
         if (array_key_exists('HTTP_HOST', $_SERVER)) {
             if (array_key_exists('restart', $_GET)) {
                 $status = 'restart_' . substr($status, 12);
             }
         } else {
             if (I2CE::getRuntimeVariable('force-restart')) {
                 $status = 'restart_' . substr($status, 12);
             }
         }
     }
     switch ($status) {
         case 'done':
             return true;
         case 'no_site':
             I2CE::raiseError("Cannot determine the site");
             return false;
         case 'restart_install':
         case 'needs_install':
             $config->__set("/config/site/installation", 'in_progress_install');
             if (!self::install($site_module_file, substr($status, 0, 7) == 'restart', $verbose_errors)) {
                 I2CE::raiseError("Unseting at " . $config->getPath());
                 if (isset($config->config) && isset($config->config->site) && isset($config->config->site->installation)) {
                     unset($config->config->site->installation);
                 }
                 I2CE::raiseError("Installation of the site failed", E_USER_ERROR);
                 return false;
             }
             return !I2CE::hasWarnings();
         case 'restart_reinstall':
         case 'needs_reinstall':
             $config->__set("/config/site/installation", 'in_progress_reinstall');
             if (!self::reinstall($site_module_file, substr($status, 0, 7) == 'restart', $verbose_errors)) {
                 I2CE::raiseError("Reintiaizliation of site to new file {$site_module_file} failed", E_USER_ERROR);
                 return false;
             }
             return !I2CE::hasWarnings();
         case 'restart_reenable':
         case 'needs_reenable':
             $config->__set("/config/site/installation", 'in_progress_reenable');
             I2CE::setupFileSearch(array("CLASSES" => "./", 'MODULES' => array(dirname($site_module_file), dirname(dirname(__FILE__)))), true);
             if ($config->setIfIsSet($site_module, '/config/site/module')) {
                 I2CE::raiseError("Somehow the site module {$site_module} was disabled.  Attempting to enable");
                 $mod_factory = I2CE_ModuleFactory::instance();
                 $mod_factory->resetStoredLoadedPaths();
                 //$mod_factory->loadPaths(null,'CLASSES'); //make sure all of our classes are loaded.
                 //somehow the site module got disabled.  this could happen, for example, if the paths got screwed up.  lets try and correct things
                 if (!self::_updateModules($site_module)) {
                     I2CE::raiseError("Renabling failed for {$site_module} ", E_USER_ERROR);
                     return false;
                 }
                 return !I2CE::hasWarnings();
             }
             I2CE::raiseError("Lost the site module");
             return false;
         case 'restart_upgrade':
         case 'needs_upgrade':
             $config->__set("/config/site/installation", 'in_progress_upgrade');
             $mod_factory = I2CE_ModuleFactory::instance();
             $mod_factory->resetStoredLoadedPaths();
             //$mod_factory->loadPaths(null,'CLASSES'); //make sure all of our classes are loaded.
             I2CE::setupFileSearch(array("CLASSES" => "./", 'MODULES' => array(dirname($site_module_file), dirname(dirname(__FILE__)))), true);
             if (!self::updateOutOfDateConfigFiles()) {
                 I2CE::raiseError("Error in checking configuration files", E_USER_ERROR);
                 return false;
             }
             $config->__set("/I2CE/update/times/last", time());
             return !I2CE::hasWarnings();
             //Ireturn true;
         //Ireturn true;
         case 'in_progress_reenable':
         case 'in_progress_upgrade':
         case 'in_progress_install':
         case 'in_progress_reinstall':
             if (array_key_exists('HTTP_HOST', $_SERVER)) {
                 I2CE::raiseError("System update is already in progress");
                 $url = $_SERVER['REQUEST_URI'];
                 if (!array_key_exists('restart', $_GET)) {
                     if (strlen($_SERVER['QUERY_STRING']) > 0) {
                         $url .= '&restart';
                     } else {
                         $url .= '?restart';
                     }
                 }
                 echo "<br/>Site update in progress.  <a href='{$url}'>Restart</a>?";
                 $msg = "Site update in progress. Restart?";
                 echo "<script type='text/javascript'>if (confirm('{$msg}')) {setTimeout(function() {window.location= '{$url}';},500)}</script>";
                 //reload the requested page after 5 seconds
                 flush();
             } else {
                 I2CE::raiseError("System update is already in progress.  To force the restart add  --force-restart=1");
             }
             return false;
         default:
             I2CE::raiseError("Unrecognized site status: {$status}");
//.........这里部分代码省略.........
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:101,代码来源:I2CE_Updater.php


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