Example #1
0
function make_file_standalone($file)
{
    mkdir_deep('standalone/' . dirname($file));
    return copy($file, 'standalone/' . $file);
}
Example #2
0
        if ($data = @file_get_contents($originUrl . $params['path'])) {
            mkdir_deep($originPath);
            file_put_contents($originPath, $data);
            $isNotExists = false;
            break;
        }
    }
    if ($isNotExists) {
        error404();
    }
}
if ($params['type'] !== 'origin') {
    $Image = new Image();
    $Image->set($originPath);
    $Image->{$params['type']}(intval($params['width']), intval($params['height']));
    mkdir_deep($requestUrl);
    $Image->output($requestUrl, intval($params['quality']));
    $Image->destroy();
}
header('Content-type: image/jpeg');
@readfile($requestUrl);
/*
 * ディレクトリ作成
 */
function mkdir_deep($path)
{
    $dirs = explode('/', dirname($path));
    $path = '';
    foreach ($dirs as $dir) {
        $path .= $dir;
        if (!is_dir($path)) {