Ejemplo n.º 1
0
Archivo: index.php Proyecto: hfw/h
<?php

namespace H;

include_once '../vendor/autoload.php';
H::init();
error_reporting(E_ALL);
H::get('/', function () {
    return 'hello world';
});
H::get('/cache', function () {
    return new V(['this' => 'view/time.phtml', 'cache' => new C('time', function (V $view) {
        return $view->buffer();
    }, 10)]);
});
H::get('/cache/flush', function () {
    return function () {
        echo 'Flushed all ' . C::flush() . ' cache files.';
    };
});
H::get('/cache/prune', function () {
    return function () {
        echo 'Pruned ' . C::prune(10) . ' stale cache files.';
    };
});