Пример #1
0
 public function unlock()
 {
     if (!flock($this->_file, LOCK_UN)) {
         $this->_output->logDebug(">>>NOTICE! FAILED to release lock");
         return false;
     }
     ftruncate($this->_file, 0);
     fclose($this->_file);
     $this->_output->logDebug(">>>File unlocked");
     return true;
 }
Пример #2
0
 /**
  * @return void
  */
 protected function _initAutoload()
 {
     self::$out->logDebug("initializing class autoloading");
     spl_autoload_register(function ($className) {
         $path = str_replace("_", "/", $className);
         $path[0] = strtolower($path[0]);
         if (!@(include_once $path . '.php')) {
             return false;
         }
         return true;
     });
     // load classes from extensions
     foreach ($this->_options['engine']['extensions'] as $path) {
         if (file_exists($path . '/_init.php')) {
             self::$out->logNotice("extending functionality with drivers from '{$path}'");
             /** @noinspection PhpIncludeInspection */
             require_once $path . '/_init.php';
         } else {
             self::$out->logWarning("no extension found in '{$path}' (_init.php missing)");
         }
     }
 }