public function __construct($root = null, $runtime_config = null) { $this->config = new SmoothConfiguration(); if (!$root) { // Automatically determine the application root. $root = dirname($_SERVER['SCRIPT_FILENAME']); } $this->root = $root; $env = $runtime_config && $runtime_config['environment'] ? $runtime_config['environment'] : 'development'; $this->loadConfiguration($env); if ($runtime_config) { $this->config->merge($runtime_config); } $this->environment = $env; $router = $this->config->get('smooth/router', 'default'); $this->router = SmoothRouter::get($router, $this); }
public function __construct(SmoothApplication $application) { parent::__construct($application); $this->loadRoutes(); }