Ejemplo n.º 1
0
 /**
  *
  */
 protected function getCurrentService()
 {
     $appId = 0;
     if (Config::getOption("environment") === "development") {
         $appId = Config::getOption("appId");
     }
     $applications = new Applications();
     $application = $applications->getServiceConfig($appId);
     return $application;
 }
Ejemplo n.º 2
0
 /**
  * performs the load
  *
  * @return	void
  */
 public static function load()
 {
     $loader = new Loader();
     spl_autoload_register(array($loader, 'autoload'));
     $config = new Config();
     $config->load();
     $router = new Router();
     $request = new Request();
     $router->setRoutes($config->get('routes'));
     $currentRoute = $router->getCurrent($request->getGet('qs'));
     $action = $router->route($currentRoute);
     $controllerName = '\\API\\Controller\\' . $action['controller'];
     $controller = new $controllerName();
     $controller->setConfig($config);
     if (method_exists($controller, $action['method'])) {
         $method = $action['method'];
         $controller->{$method}($action['params']);
     }
     // if
 }