Esempio n. 1
0
 public function loadRoutes()
 {
     try {
         $routes = Config::getInstance()->load($this->routesFile);
     } catch (InvalidFileException $e) {
         throw new InvalidRoutesFileException($e->getMessage());
     }
     $this->routes = $routes;
     return $this;
 }
Esempio n. 2
0
 public function loadServices()
 {
     try {
         $services = Config::getInstance()->load($this->getServicesFile());
     } catch (InvalidFileException $e) {
         throw new InvalidServicesFileException($e->getMessage());
     }
     $this->setServices($services);
     return $this;
 }
Esempio n. 3
0
 public function loadControllers($controllerFile = '')
 {
     $this->register(new ServiceControllerServiceProvider());
     if ($controllerFile === '') {
         $controllerFile = $this->getAppConfig()['core']['configDir'] . $this->getAppConfig()['core']['controllersFile'];
     }
     try {
         $this->setControllers(Config::getInstance()->load($controllerFile));
     } catch (InvalidFileException $e) {
         throw new InvalidControllersFileException($e->getMessage());
     }
     return $this;
 }
Esempio n. 4
0
 /**
  * @expectedException Flint\Exception\InvalidFileException
  * @expectedExceptionMessage Config can't be loaded, file does not exist: fake
  */
 public function testLoadInvalidFileThrowsException()
 {
     $fakeFile = 'fake';
     Config::getInstance()->load($fakeFile);
 }
Esempio n. 5
0
<?php

require_once __DIR__ . "/../vendor/autoload.php";
use FlintExample\ExampleApp, Flint\Config;
$config = Config::getInstance()->load(__DIR__ . "/../app/config.php");
$app = ExampleApp::getInstance($config);
$app->run();