/** * Method records some objects into Service Locator * * @param $config */ public function __construct($config) { $sl = Service::getInstance(); $sl->set('security', new Security()); $sl->set('request', new Request()); $this->config = (include_once Service::get('security')->change_slashes($config)); $sl->set('session', new Session()); $sl->set('router', new Router($this->config['routes'])); $sl->set('app', $this); try { $sl->set('db', new \PDO($this->config['pdo']['dsn'], $this->config['pdo']['user'], $this->config['pdo']['password'])); } catch (\PDOException $e) { echo $e->getMessage(); die; } }