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


PHP I2CE::hasWarnings方法代码示例

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


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

示例1: install

 /**
  * Worker function for  the first time installation.  Absolutely nothing has been done yet.
  * @param string $site_module_file The site module file  
  * @param boolean $verbose_errors.  defaults to true.  
  */
 protected static function install($site_module_file, $restart, $verbose_errors = true)
 {
     $db = MDB2::singleton();
     I2CE::raiseError("Beginning new installation");
     I2CE::longExecution();
     I2CE::getFileSearch()->addPath('MODULES', dirname(dirname(__FILE__)), 'EVEN_HIGHER');
     $configurator = new I2CE_Configurator(I2CE::getConfig());
     $site_module = $configurator->processConfigFile($site_module_file, false, $verbose_errors, true);
     I2CE::raiseError("Site module is: {$site_module}");
     //we don't want to process the site config data at the moment, just the meta data
     if (!(is_string($site_module) && strlen($site_module) > 0)) {
         I2CE::raiseError("Installation Failed for site.  Invalid configuration file {$site_module_file}.  No name given.", E_USER_ERROR);
         return false;
     }
     I2CE::raiseError("Enabling I2CE");
     I2CE::raiseError("Setting site module to {$site_module}");
     I2CE::getConfig()->config->site->module = $site_module;
     $mod_factory = I2CE_ModuleFactory::instance();
     $success = self::_updateModules('I2CE');
     if (!$success) {
         I2CE::raiseError("Installation Failed for I2CE", E_USER_ERROR);
         return false;
     }
     if (I2CE::getConfig()->setIfIsSet($site_module, '/config/site/module')) {
         I2CE::getConfig()->config->data->{$site_module}->file = I2CE_FileSearch::relativePath($site_module_file);
     } else {
         I2CE::raiseError("Site is not set");
         return false;
     }
     I2CE::getConfig()->config->I2CE->update->times->last = time();
     I2CE::setupFileSearch(array("CLASSES" => "./", 'MODULES' => array(dirname(dirname(__FILE__)), dirname($site_module_file))), true);
     $mod_factory->resetStoredLoadedPaths();
     if ($restart) {
         //make sure all of our classes are loaded in case this was a restart
         $mod_factory->loadPaths(null, 'CLASSES');
     } else {
         $mod_factory->loadPaths('I2CE', array('CLASSES', 'MODULES'), true);
     }
     I2CE::raiseError("Begining initializiation of site {$site_module}", E_USER_NOTICE);
     if (!self::_updateModules($site_module)) {
         I2CE::raiseError("Site Module Installation Failed", E_USER_ERROR);
         return false;
     }
     //we got through I2CE's installation
     if ($db->in_transaction) {
         I2CE::raiseError("Warning: ending installation still in transaction -- committing");
         $db->commit();
     }
     if (I2CE::hasWarnings()) {
         I2CE::raiseError("Your site was not initialized. Please refer to the warning messages above.");
         flush();
         return false;
     } else {
         if (array_key_exists('HTTP_HOST', $_SERVER)) {
             $url = array_key_exists('REQUEST_URI', $_SERVER) ? $_SERVER['REQUEST_URI'] : "/";
             I2CE::raiseError("Congratulations, your site has been initialized. You may <a href='{$url}'>continue</a> onto the site.");
             echo "<script type='text/javascript'>window.location= '{$url}';</script>";
             //reload the requested page.
             flush();
         }
         return true;
     }
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:68,代码来源:I2CE_Updater.php


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