Example #1
0
 /**
  *
  * 
  */
 public function __construct()
 {
     $connectionOptions = Options::of('database');
     try {
         $this->connection = new \PDO($connectionOptions['dsn'], $connectionOptions['user'], $connectionOptions['pass']);
         $this->connection->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
     } catch (PDOException $e) {
         $e->getMessage();
     }
 }
Example #2
0
 /**
  *
  * @return string
  */
 private function findModule()
 {
     $modules = Options::of('modules');
     $segments = $this->getUriSegments();
     if (empty($segments)) {
         return $this->findRoute($modules['default'], []);
     }
     $moduleSegment = array_shift($segments);
     $moduleExists = !empty($modules['modules'][$moduleSegment]);
     if ($moduleExists) {
         return $this->findRoute($modules['modules'][$moduleSegment], $segments);
     }
     return $this->notFound();
 }