Beispiel #1
0
 /**
  * Create a new Application instance.
  *
  * @api
  *
  * @param string $namespace (optional) namespace with trailing backslash
  * @param string $file_root (optional) location to the file root of the application, if null it will be guessed
  */
 public function __construct($namespace = '\\', $file_root = null)
 {
     // we want our own error handler
     set_error_handler(__CLASS__ . '::errorHandler');
     self::$NAMESPACE = $namespace;
     if ($file_root === null) {
         // guess for default composer installation
         self::$FILE_ROOT = dirname(dirname(dirname(dirname(__DIR__))));
     } else {
         self::$FILE_ROOT = $file_root;
     }
     self::$FILE_ROOT = rtrim(self::$FILE_ROOT, '/') . '/';
     self::$WEB_ROOT = self::$FILE_ROOT . 'public/';
     self::$CACHE_ROOT = self::$FILE_ROOT . 'tmp/';
     self::$INSTANCE = $this;
     //var_dump(\FeM\sPof\model\DBConnection::getInstance());
     if (!\FeM\sPof\model\DBConnection::isOnline()) {
         die(_('No Datebase connection.'));
     }
 }