Beispiel #1
0
 public function getDebugInfo($out)
 {
     $SQL = '';
     if (DEVELOP_MODE) {
         $SQL = ', SQL: ' . count(\Wasp\DB::getQueryLog());
     }
     return str_replace('<!-- DEBUG-INFO -->', 'Exec: ' . round(microtime(true) - WASP_START_TIME, 3) . 's, Mem: ' . round(memory_get_peak_usage(true) / 1048576, 2) . 'Mb ' . $SQL, $out);
 }
Beispiel #2
0
    $php_cfg = cfg('config')->php;
    if ($php_cfg->count() > 0) {
        foreach ($php_cfg->toArray() as $key => $val) {
            $key = str_replace('__', '.', $key);
            @ini_set($key, $val);
        }
        unset($key, $val);
    }
    unset($php_cfg);
}
unset($DisabledFunctions);
require CORE_PATH . DIR_SEP . 'smarty_security.php';
require CORE_LIBRARY_DIR . DIR_SEP . 'ui.php';
$config = cfg('dbase');
$events = new \Illuminate\Events\Dispatcher();
if ($config->count() > 0) {
    $database = new \Illuminate\Database\Capsule\Manager();
    foreach ($config->toArray() as $key => $val) {
        $database->addConnection(['driver' => 'mysql', 'host' => $val->host, 'database' => $val->database, 'username' => $val->username, 'password' => $val->password, 'charset' => 'utf8', 'collation' => 'utf8_general_ci', 'prefix' => $val->prefix], strtolower($key));
    }
    $database->setAsGlobal();
    $database->bootEloquent();
    $database->setEventDispatcher($events);
    class_alias('\\Illuminate\\Database\\Capsule\\Manager', '\\Wasp\\DB');
    class_alias('\\Illuminate\\Database\\Schema\\Builder', '\\Wasp\\Schema');
    require CORE_LIBRARY_DIR . DIR_SEP . 'model.php';
    if (DEVELOP_MODE) {
        \Wasp\DB::enableQueryLog();
    }
}
app()->execute();