/** * @url GET installer * @param array $roleIds */ public function installer($roleIds = null) { try { if (Config::get('productionEnv')) { throw new Exception("Database reinstall not allowed in production environment", 403); } Database::createDB(); $db = Database::singleton(); $db->reinstallDB(); $session = Session::singleton(); $session->activateRoles($roleIds); return Notifications::getAll(); // Return all notifications } catch (Exception $e) { throw new RestException($e->getCode(), $e->getMessage()); } }
/** * Initializes the class by registering all model classes and creating the * database if it doesn't exist yet */ public function __construct() { spl_autoload_register('classAutoLoader'); Database::createDB(); $this->associator = new Associator(Database::getAllP2000(), Database::getAllNews()); }
/** * Initializes the class by registering all model classes and creating the * database if it doesn't exist yet */ public function __construct() { spl_autoload_register('classAutoLoader'); Database::createDB(); }