Example #1
0
File: XS.php Project: h3len/Project
 public function __construct($file)
 {
     if (strlen($file) < 255 && !is_file($file)) {
         $file2 = XS_LIB_ROOT . '/../app/' . $file . '.ini';
         if (is_file($file2)) {
             $file = $file2;
         }
     }
     $this->loadIniFile($file);
     self::$_lastXS = $this;
 }
Example #2
0
 /**
  * 构造函数
  * 特别说明一个小技巧, 参数 $file 可以直接是配置文件的内容, 还可以是仅仅是文件名,
  * 如果只是文件名会自动查找 XS_LIB_ROOT/../app/$file.ini
  * @param string $file 要加载的项目配置文件
  */
 public function __construct($file)
 {
     if (strlen($file) < 255 && !is_file($file)) {
         $appRoot = getenv('XS_APP_ROOT');
         if ($appRoot === false) {
             $appRoot = defined('XS_APP_ROOT') ? XS_APP_ROOT : XS_LIB_ROOT . '/../app';
         }
         $file2 = $appRoot . '/' . $file . '.ini';
         if (is_file($file2)) {
             $file = $file2;
         }
     }
     $this->loadIniFile($file);
     self::$_lastXS = $this;
 }