Exemplo n.º 1
0
//! Set the default logfile for the logger
App::set("LOGFILE", "app.log");
//! Load the main configuration of the web service like app assets or routing configuration
App::f3()->config('./conf/globals.cfg');
App::f3()->config('./conf/routes.cfg');
App::f3()->config('./conf/rest.cfg');
App::f3()->config('./conf/redirects.cfg');
App::f3()->config('./conf/db.cfg');
App::f3()->config('./conf/ips.cfg');
//! Configure ReST Routing Objects
App::configureRest();
//! Define the app as configured
App::$configured = TRUE;
App::log(App::SEVERITY_TRACE, "Configured App via configuration files");
//! Autogenerate Scaffold Files
Scaffold::instance()->execute("./conf/scaffold.cfg");
//! Instanciate the database connection
App::set('DB', new DB\SQL('mysql:host=' . App::get("dbhost") . ';port=' . App::get("dbport") . ';dbname=' . App::get("dbname"), App::get("dbuser"), App::get("dbpass")));
App::log(App::SEVERITY_TRACE, "Connected to database at host " . App::get("dbhost"));
//! Convert array required properties to array if they are not present as array
if (!is_array(App::get("INCLUDEJS"))) {
    App::set("INCLUDEJS", [App::get("INCLUDEJS")]);
}
if (!is_array(App::get("INCLUDECSS"))) {
    App::set("INCLUDECSS", [App::get("INCLUDECSS") => "all"]);
}
if (!is_array(App::get("ipaccess.allowedips"))) {
    App::set("ipaccess.allowedips", [App::get("ipaccess.allowedips")]);
}
//! Prepare the compression for CSS files
$css = [];