コード例 #1
0
ファイル: _init.php プロジェクト: tenebras/kalibri
    require_once 'Kalibri/Config.php';
    require_once 'Kalibri/Controller/Base.php';
    require_once 'Kalibri/Uri.php';
    require_once 'Kalibri/Router.php';
    require_once 'Kalibri/Benchmark.php';
}
// Register autoloader
spl_autoload_register(function ($className) {
    if (@(include_once str_replace('\\', '/', $className) . '.php')) {
        return true;
    }
    // Not loaded yet, try to load helper
    return \Kalibri::autoload()->helper($className);
});
\Kalibri::config(new \Kalibri\Config());
\Kalibri::benchmark(new \Kalibri\Benchmark())->start('kalibri-total');
function tr($key, array $params = null, $language = null)
{
    return \Kalibri::l10n()->tr($key, $params, $language);
}
function url($path, $subdomain = null)
{
    return \Kalibri\Helper\Url::site($path, $subdomain);
}
function k_ob_get_end($flush = false)
{
    $output = ob_get_clean();
    ob_end_clean();
    if ($flush) {
        echo $output;
    }
コード例 #2
0
ファイル: Debug.php プロジェクト: tenebras/kalibri
 public static function getPanel()
 {
     $view = new \Kalibri\View('Debug/panel');
     $view->marks = \Kalibri::benchmark()->getMarks(true);
     return $view->render(true);
 }