コード例 #1
0
ファイル: Config.php プロジェクト: andrixh/rotor
 protected static function Init()
 {
     if (static::$instance === null) {
         static::$instance = new ConfigManager(Path::Create($_SERVER['DOCUMENT_ROOT'])->append('../config/'), Environment::get());
     }
 }
コード例 #2
0
ファイル: Asset_old.php プロジェクト: andrixh/rotor
 public function findSource()
 {
     if ($this->external) {
         $this->sourcePath = $this->name;
         _u();
         return;
     }
     $envPrefix = '.' . Environment::get();
     if ($this->type == self::SCRIPT) {
         $possibleExtensions = [$envPrefix . '.js', '.js'];
         $extfind = "#\\.js\$#";
     } else {
         if ($this->type == self::STYLE) {
             $possibleExtensions = [$envPrefix . '.css', '.css', $envPrefix . '.less', '.less', $envPrefix . '.scss', '.scss'];
             $extfind = '#\\.css$#';
         }
     }
     $baseName = $this->config->sourcePath . '/' . $this->type . '/' . $this->name;
     foreach ($possibleExtensions as $extreplace) {
         $testfile = preg_replace($extfind, $extreplace, $baseName);
         if (file_exists($testfile)) {
             $this->sourcePath = $testfile;
             $this->sourceTime = filemtime($testfile);
             break;
         }
     }
 }