示例#1
0
function handler_file($handler)
{
    if (str_contains('/', $handler)) {
        $pieces = explode('/', $handler);
        $handler_basename = array_pop($pieces);
    } else {
        $handler_basename = $handler;
    }
    return handler_dir($handler) . "{$handler_basename}.handler.php";
}
示例#2
0
function handler_templates_dir($handler)
{
    return handler_dir($handler) . 'templates' . DIRECTORY_SEPARATOR;
}
示例#3
0
function test_handler_file()
{
    should_return(handler_dir('foo') . "foo.handler.php", when_passed('foo'));
    should_return(handler_dir('foo/bar') . "bar.handler.php", when_passed('foo/bar'));
    should_return(handler_dir('foo/bar/baz') . "baz.handler.php", when_passed('foo/bar/baz'));
}