Example #1
0
    return implode(DIRECTORY_SEPARATOR, $parts);
}
define('SMOOTH_ROOT', dirname(__FILE__));
function smooth_path()
{
    $parts = func_get_args();
    return path_join(SMOOTH_ROOT, call_user_func_array('path_join', $parts));
}
function _smooth_get_lib_path($library)
{
    return path_join(SMOOTH_ROOT, 'lib', 'smooth', "{$library}.php");
}
function _smooth_transform_path($path)
{
    return str_replace('/', DIRECTORY_SEPARATOR, $path);
}
function smooth_load()
{
    $libs = func_get_args();
    if (DIRECTORY_SEPARATOR != '/') {
        $libs = array_map('_smooth_transform_path', $libs);
    }
    $paths = array_map('_smooth_get_lib_path', $libs);
    foreach ($paths as $path) {
        require_once $path;
    }
}
// Let's get this started!
require_once smooth_path('support', 'yaml.php');
require_once smooth_path('lib', 'smooth.php');
Example #2
0
 private function handleException($request, $exception)
 {
     $page_title = $title = get_class($exception) . ' at ' . $request->request_uri;
     $subtitle = $exception->getMessage();
     @header('Content-Type: text/html; charset=utf-8');
     include smooth_path('templates', 'error.php');
 }