public function __construct() { $this->db = Database::getInstance(); $this->request = new Request(); $this->session = new Session(); $this->cookie = new Cookie(); $this->user = new UserModel(); $this->identity = new Identity(); }
public function __construct() { Database::setInstance(DB_USERNAME, DB_PASSWORD, DB_NAME, DB_HOST); Scanner::setInstance(); $adminDri = scandir("../Areas/Admin/Controllers"); $defaultDir = scandir("../Controllers"); //gets all anotations for each area $adminAnnotations = Scanner::getInstance()->GetClassesAnnotations($adminDri); $baseAnnotations = Scanner::getInstance()->GetClassesAnnotations($defaultDir); if (count($adminAnnotations) === 0 && count($baseAnnotations) === 0) { $this->customValidations = array(); } else { if (count($adminAnnotations) === 0) { $this->customValidations = $baseAnnotations; } else { if (count($baseAnnotations) === 0) { $this->customValidations = $baseAnnotations; } else { $this->customValidations = array_merge($baseAnnotations, $adminAnnotations); } } } $this->run(); }
public function __construct() { $this->dbh = Database::getInstance()->getConn(); }