예제 #1
0
function route($route = null, $params = [])
{
    return $route == null ? Router::active() : Router::url($route, $params);
}
예제 #2
0
\CoreWine\View\Engine::ini(PATH_APP . "/cache/views");
\CoreWine\DataBase\DB::connect($config['database']);
# Compile
\CoreWine\View\Engine::compile(PATH_APP, 'Resources/views');
foreach (\Kernel\Manager::$list as $name => $dir) {
    \CoreWine\View\Engine::compile(PATH_APP, "Resources/" . $name . "/views", $name);
}
\CoreWine\DataBase\ORM\SchemaBuilder::setFields(include PATH_CONFIG . '/orm.php');
# Load all sources
\Kernel\Manager::loadAll(PATH_SRC);
foreach (\Kernel\Manager::$list as $name => $dir) {
    \CoreWine\View\Engine::compile(PATH_SRC, $name . "/Resources/views", $name);
}
Cfg::set('app.drive.public', __DIR__ . "/../" . Cfg::get('app.public'));
Cfg::set('app.drive', __DIR__ . "/../");
# File Path
\CoreWine\DataBase\ORM\Field\File\Schema::setDefaultFilePath(Cfg::get('app.drive') . Cfg::get('app.public') . "uploads/");
# Web Path
\CoreWine\DataBase\ORM\Field\File\Schema::setDefaultWebPath(Cfg::get('app.web') . "uploads/");
\CoreWine\View\Engine::translates();
if (php_sapi_name() == "cli") {
    return;
}
\Kernel\Manager::callControllersRoutes();
\CoreWine\Http\Router::setRequest();
\Kernel\Manager::callControllersChecks();
$response = \CoreWine\Http\Router::load();
if (empty($response)) {
    die("Current Router must return a Response");
}
$response->send();