Пример #1
0
 /**
  * constructor : reads the config file an set up the variables
  *
  * @param string $file file name
  * @param string $enviroment name of enviroment to read variables
  *
  * @return void
  */
 protected function __construct(Context $context)
 {
     $this->context = $context;
     $file = $this->context->appPath . 'default/config/config.ini';
     ExceptionHelper::ensure(file_exists($file), 'Default config file not found');
     $this->options = self::getConfigArray($file, $this->context->enviroment, $this->context->appPath, $this->context->basePath, $this->context->publicURL);
 }
Пример #2
0
 /**
  * constructor : reads the $_SERVER variables and set up the server http
  * requires the constant BASE_PATH base directory where the app lives
  *
  * @return void
  */
 protected function __construct($basePath = null)
 {
     ExceptionHelper::ensure(!empty($basePath) || defined(BASE_PATH), 'Base path is not defined for the application');
     $this->__init(empty($basePath) ? BASE_PATH : $basePath);
 }