/** * Create a new application * @param string|array params [if string, expect root directory, else array of directories, and configuration] * @param \Exedra\Exedra exedra instance */ public function __construct($params) { parent::__construct(); $this->services['provider'] = new \Exedra\Provider\Registry($this); // default the namespace as [App] if (isset($params['namespace'])) { $this->namespace = $params['namespace']; } $this->setUpPath(is_array($params) ? $params : array('path.root' => $params)); $this->setUp(); }
public function __construct(\Exedra\Application $app, \Exedra\Middleware\Registry $middlewareRegistry, \Exedra\Routing\Finding $finding, \Exedra\Runtime\Response $response) { parent::__construct(); $this->app = $app; $this->middlewareRegistry = $middlewareRegistry; $this->services['finding'] = $finding; $this->services['response'] = $response; // initiate services $this->initializeServices(); // initiate service registry $this->setUp(); // Initiate execution handles/middlewares $this->handle(); }