Пример #1
0
 function doBackup($store)
 {
     foreach ($this->_kindsToBackup as $kind) {
         $funcName = "_backup" . ucfirst($kind);
         if (method_exists($this, $funcName)) {
             $this->{$funcName}($store);
         } else {
             $this->_out->logWarning("don't know how to backup objects of type '{$kind}'");
         }
     }
 }
Пример #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)");
         }
     }
 }