New cache system with subdirectories
This commit is contained in:
parent
e67062d9cf
commit
f17377e6de
7 changed files with 83 additions and 86 deletions
|
|
@ -823,15 +823,13 @@ function scale_external_images($s, $include_link = true, $scale_replace = false)
|
|||
$scaled = $mtch[1];
|
||||
$i = fetch_url($scaled);
|
||||
|
||||
$cache = get_config('system','itemcache');
|
||||
if (($cache != '') and is_dir($cache)) {
|
||||
$cachefile = $cache."/".hash("md5", $scaled);
|
||||
$cachefile = get_cachefile(hash("md5", $scaled));
|
||||
if ($cachefile != '')
|
||||
file_put_contents($cachefile, $i);
|
||||
}
|
||||
|
||||
// guess mimetype from headers or filename
|
||||
$type = guess_image_type($mtch[1],true);
|
||||
|
||||
|
||||
if($i) {
|
||||
$ph = new Photo($i, $type);
|
||||
if($ph->is_valid()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue