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


PHP ClassLoader::setDebug方法代码示例

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


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

示例1: init

 /**
  * Inicializovat system
  *
  * @param string      $root            relativni cesta do korenoveho adresare
  * @param string|null $configFile      cesta ke konfiguracnimu skriptu nebo null(= vychozi)
  * @param bool        $envChanges      provest zmeny v prostredi (error reporting, locale, header, ...) 1/0
  * @param bool        $lightMode       odlehceny mod (pouze pripojeni k db, bez session, nastaveni, lokalizace, atd) 1/0
  * @param bool        $databaseEnabled inicializovat pripojeni k databazi 1/0
  * @param bool        $runCron         automaticky spustit cron, je-li aktivovan 1/0
  */
 public static function init($root, $configFile = null, $envChanges = true, $lightMode = false, $databaseEnabled = true, $runCron = true)
 {
     if (self::$initialized) {
         throw new BadMethodCallException();
     }
     $initialized = true;
     self::$start = microtime(true);
     /* ----  konfigurace  ---- */
     if (null === $configFile) {
         self::$configFile = $root . 'config.php';
     } else {
         self::$configFile = $configFile;
     }
     self::$envChanges = $envChanges;
     self::$lightMode = $lightMode;
     self::$databaseEnabled = $databaseEnabled;
     self::$imageError = $root . 'remote/image_error.png';
     // soubor s nastavenim
     require self::$configFile;
     // doplneni konfigurace (kvuli kompatibilite)
     if (!isset($locale)) {
         $locale = array('czech', 'utf8', 'cz_CZ');
     }
     if (!isset($timezone)) {
         $timezone = 'Europe/Prague';
     }
     if (!isset($geo)) {
         $geo = array(50.5, 14.26, 90.583333);
     }
     if (!isset($port)) {
         // pokud neni uveden $port, muze byt definovan jako soucast $server (server:port)
         if (false !== ($serverColonPos = strpos($server, ':'))) {
             $port = (int) substr($server, $serverColonPos + 1);
             $server = substr($server, 0, $serverColonPos);
         } else {
             $port = ini_get('mysqli.default_port');
         }
     }
     // systemove konstanty
     define('_indexroot', $root);
     define('_core', '1');
     define('_nl', "\n");
     define('_sessionprefix', md5($server . $database . $user . $prefix) . '-');
     if (!defined('_administration')) {
         define('_administration', 0);
     }
     define('_dev', isset($dev) ? $dev : true);
     // vyvojovy mod 1/0
     define('_systemstate', 0);
     // 0 = beta, 1 = rc, 2 = stable
     define('_systemstate_revision', 0);
     // revize systemu
     define('_systemversion', '7.5.5');
     // verze systemu
     define('_mysql_prefix', $prefix);
     define('_mysql_db', $database);
     define('_upload_dir', _indexroot . 'upload/');
     define('_plugin_dir', _indexroot . 'plugins/common/');
     define('_tmp_dir', _indexroot . 'data/tmp/');
     define('_void_file', _indexroot . 'data/void.nodelete');
     define('_geo_latitude', $geo[0]);
     define('_geo_longitude', $geo[1]);
     define('_geo_zenith', $geo[2]);
     /* ----  autoloader  ---- */
     require _indexroot . 'require/class/class_loader.php';
     self::$classLoader = new ClassLoader();
     self::$classLoader->setDebug(_dev)->registerClassMap(array('AdminBread' => _indexroot . 'require/class/admin_bread.php', 'Color' => _indexroot . 'require/class/color.php', 'DBDump' => _indexroot . 'require/class/dbdump.php', 'KZip' => _indexroot . 'require/class/kzip.php', 'KZipStream' => _indexroot . 'require/class/kzip.php', 'TreeManager' => _indexroot . 'require/class/tree_manager.php', 'TreeReader' => _indexroot . 'require/class/tree_reader.php', 'LangPack' => _indexroot . 'require/class/lang_pack.php', 'FileCache' => _indexroot . 'require/class/file_cache.php'))->register();
     /* ----  upravy PHP prostredi  ---- */
     if ($envChanges) {
         // kontrola verze PHP a pritomnosti rozsireni
         if (version_compare(PHP_VERSION, '5.1.0', '<')) {
             _systemFailure('Je vyžadováno PHP 5.1.0 nebo novější.');
         }
         if (!extension_loaded('mbstring')) {
             _systemFailure('Chybí PHP rozšíření <code>mbstring</code> (Multibyte String Functions).');
         }
         if (!extension_loaded('mysqli')) {
             _systemFailure('Chybí PHP rozšíření <code>mysqli</code>, které je potřebné pro práci s databází.');
         }
         // kontrola a nastaveni $_SERVER['REQUEST_URI']
         if (!isset($_SERVER['REQUEST_URI'])) {
             if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
                 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
             } elseif (isset($_SERVER['HTTP_REQUEST_URI'])) {
                 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_REQUEST_URI'];
             } else {
                 if (isset($_SERVER['SCRIPT_NAME'])) {
                     $_SERVER['HTTP_REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
                 } else {
                     $_SERVER['HTTP_REQUEST_URI'] = $_SERVER['PHP_SELF'];
//.........这里部分代码省略.........
开发者ID:sunlight-cms,项目名称:sunlight-cms-7,代码行数:101,代码来源:load.php


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