diff options
author | Urban Müller | 2020-02-24 14:36:37 +0100 |
---|---|---|
committer | Urban Müller | 2020-02-24 14:36:37 +0100 |
commit | 61f113ed37870a1d5865b5bd0ba09ed1b7f4e415 (patch) | |
tree | 604f455b897519722af2c072711e095afce08e6d /it_url.class | |
parent | c986c094762318f93e30e1f17d8bb87e277f8dc8 (diff) | |
download | itools-61f113ed37870a1d5865b5bd0ba09ed1b7f4e415.tar.gz itools-61f113ed37870a1d5865b5bd0ba09ed1b7f4e415.tar.bz2 itools-61f113ed37870a1d5865b5bd0ba09ed1b7f4e415.zip |
rename $result which is not result of function
Diffstat (limited to 'it_url.class')
-rw-r--r-- | it_url.class | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/it_url.class b/it_url.class index 94ac466..a08237a 100644 --- a/it_url.class +++ b/it_url.class @@ -497,14 +497,14 @@ static function get_cache($p = array()) EDC('getcache', "new", $filemtime, $p['url'], $path); $url = new it_url; - if ($result = $url->get($p + array('filemtime' => EDC('nocache') ? null : $filemtime))) # => true means not modified (no new data fetched) + if ($success = $url->get($p + array('filemtime' => EDC('nocache') ? null : $filemtime))) # => true means not modified (no new data fetched) { - $newfile = it_url::_atomicwrite($path, $result); + $newfile = it_url::_atomicwrite($path, $success); if ($p['returnheaders']) it::file_put_contents("$path.headers", '<?php return ' . var_export($url->headers, true) . ";\n"); } else if ($p['keepfailed']) - $result = $fileexists; + $success = $fileexists; else @unlink($path); # Expired and failed to get @@ -514,11 +514,11 @@ static function get_cache($p = array()) { # Wait for file currently being transferred EDC('getcache', "wait", $p['url'], $path); - $result = it_url::_waitforlockedfile($path, $p); + $success = it_url::_waitforlockedfile($path, $p); # If file could no be fetched by other thread but exists and we are in keepfailed mode then return old file - if (!$result && $p['keepfailed']) - $result = $fileexists; + if (!$success && $p['keepfailed']) + $success = $fileexists; } } @@ -526,14 +526,14 @@ static function get_cache($p = array()) { # Get file from cache EDC('getcache', "cached", $p['url'], $path); - $result = true; # Up to date + $success = true; # Up to date } # Read headers before $path is modified for preprocessing if ($p['returnheaders']) $headers = @include("$path.headers"); - if ($result && $p['preprocess']) + if ($success && $p['preprocess']) { $srcpath = $path; $path .= substr(md5(serialize($p['preprocess'])), 0, 2); @@ -554,12 +554,12 @@ static function get_cache($p = array()) else call_user_func($p['preprocess'], $srcpath, $dstpath); - if (!($result = @filesize($dstpath) && @rename($dstpath, $path))) + if (!($success = @filesize($dstpath) && @rename($dstpath, $path))) { @unlink($dstpath); if (!$p['keepfailed']) @unlink($path); - $result = file_exists($path); + $success = file_exists($path); } $cachemiss = 1; @@ -569,7 +569,7 @@ static function get_cache($p = array()) { # Wait for file currently being processed EDC('getcache', "processwait", $p['url'], $path); - $result = it_url::_waitforlockedfile($path, $p); + $success = it_url::_waitforlockedfile($path, $p); } } } @@ -585,8 +585,8 @@ static function get_cache($p = array()) if (EDC('getcachelog')) it::log('debug', 'getcachelog', "miss=" . intval($cachemiss), $p['url']); - ### EDC('getcache', $result, $path); # too verbose - return $result ? ($p['returnheaders'] ? array($path, $headers) : $path) : false; + ### EDC('getcache', $success, $path); # too verbose + return $success ? ($p['returnheaders'] ? array($path, $headers) : $path) : false; } /** |