예제 #1
0
 /**
  * Load configurations from file in /Private/Config/
  * @param string $configName
  * @return bool
  */
 private function load($configName)
 {
     // check if always loaded
     if (Obj::isArray($this->data) && array_key_exists($configName, $this->data)) {
         return true;
     }
     // try to load from file
     $configFile = ucfirst(Str::lowerCase($configName)) . '.php';
     if (File::exist('/Private/Config/' . $configFile)) {
         $this->data[$configName] = File::inc('/Private/Config/' . $configFile, true);
         return true;
     }
     return false;
 }
예제 #2
0
 /**
  * Get default server information and prepare chmod info
  */
 public function before()
 {
     $this->phpVersion = phpversion();
     $this->pdo = extension_loaded('pdo');
     $this->gd = extension_loaded('gd') && function_exists('gd_info');
     // autoload is disabled, lets get chmod file & dirs from console app data
     File::inc('/Apps/Controller/Console/Main.php');
     $this->_chmodDirs = Main::$installDirs;
     // for each file or directory in list - check permissions
     foreach ($this->_chmodDirs as $object) {
         if (Str::endsWith('.php', $object)) {
             // sounds like a file
             $this->chmodCheck[$object] = File::exist($object) && File::writable($object);
         } else {
             $this->chmodCheck[$object] = Directory::exist($object) && Directory::writable($object);
         }
     }
 }