예제 #1
0
파일: index.php 프로젝트: 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.';
    };
});