Exemple #1
0
 /**
  * The constructor
  * 
  * @throws \Exception
  */
 public function __construct()
 {
     if (self::$instance !== null) {
         throw new \Exception('App already constructed');
     }
     self::$instance =& $this;
     $this->container = new App\Container();
     $this->container->set('config', App\Config::class);
     $this->container->set('request', App\Request::class);
     $this->container->set('routes', App\Routes::class);
     $this->container->set('logger', App\Logger::class);
     $this->container->set('addons', App\Addons::class);
     $this->container->set('hooks', App\Hooks::class);
     $this->container->set('assets', App\Assets::class);
     $this->container->set('data', App\Data::class);
     $this->container->set('cache', App\Cache::class);
     $this->container->set('classes', App\Classes::class);
     $this->container->set('urls', App\Urls::class);
     $this->container->set('images', App\Images::class);
 }
Exemple #2
0
 /**
  * The constructor
  * 
  * @throws \Exception
  */
 public function __construct()
 {
     if (self::$instance !== null) {
         throw new \Exception('App already constructed');
     }
     self::$instance =& $this;
     $this->container = new App\Container();
     $this->container->set('app.config', App\Config::class);
     $this->container->set('app.request', App\Request::class);
     $this->container->set('app.routes', App\Routes::class);
     $this->container->set('app.logger', App\Logger::class);
     $this->container->set('app.addons', App\Addons::class);
     $this->container->set('app.hooks', App\Hooks::class);
     $this->container->set('app.assets', App\Assets::class);
     $this->container->set('app.data', App\Data::class);
     $this->container->set('app.cache', App\Cache::class);
     $this->container->set('app.classes', App\Classes::class);
     $this->container->set('app.urls', App\Urls::class);
     $this->container->set('app.images', App\Images::class);
     $this->defineProperty('config', ['get' => function () {
         return $this->container->get('app.config');
     }, 'readonly' => true]);
     $this->defineProperty('request', ['get' => function () {
         return $this->container->get('app.request');
     }, 'readonly' => true]);
     $this->defineProperty('routes', ['get' => function () {
         return $this->container->get('app.routes');
     }, 'readonly' => true]);
     $this->defineProperty('logger', ['get' => function () {
         return $this->container->get('app.logger');
     }, 'readonly' => true]);
     $this->defineProperty('addons', ['get' => function () {
         return $this->container->get('app.addons');
     }, 'readonly' => true]);
     $this->defineProperty('hooks', ['get' => function () {
         return $this->container->get('app.hooks');
     }, 'readonly' => true]);
     $this->defineProperty('assets', ['get' => function () {
         return $this->container->get('app.assets');
     }, 'readonly' => true]);
     $this->defineProperty('data', ['get' => function () {
         return $this->container->get('app.data');
     }, 'readonly' => true]);
     $this->defineProperty('cache', ['get' => function () {
         return $this->container->get('app.cache');
     }, 'readonly' => true]);
     $this->defineProperty('classes', ['get' => function () {
         return $this->container->get('app.classes');
     }, 'readonly' => true]);
     $this->defineProperty('urls', ['get' => function () {
         return $this->container->get('app.urls');
     }, 'readonly' => true]);
     $this->defineProperty('images', ['get' => function () {
         return $this->container->get('app.images');
     }, 'readonly' => true]);
 }