예제 #1
0
function _outputFile($_file)
{
    Kurogo::log(LOG_DEBUG, "Output file {$_file}", 'kurogo');
    if ($file = Watchdog::safePath($_file)) {
        CacheHeaders($file);
        header('Content-type: ' . mime_type($file));
        readfile($file);
        exit;
    }
    _404();
}
예제 #2
0
function buildFileList($checkFiles)
{
    $foundFiles = array();
    foreach ($checkFiles['files'] as $entry) {
        if (is_array($entry)) {
            $foundFiles = array_merge($foundFiles, buildFileList($entry));
        } else {
            if ($entry && Watchdog::safePath($entry)) {
                $foundFiles[] = $entry;
            }
        }
        if ($checkFiles['include'] == 'any' && count($foundFiles)) {
            break;
        }
    }
    return $foundFiles;
}