diff options
author | Urban Müller | 2018-06-27 15:13:03 +0200 |
---|---|---|
committer | Urban Müller | 2018-06-27 15:13:03 +0200 |
commit | 84fe0c2eaa7deb0681cfc8746434044a2fae53c6 (patch) | |
tree | f42b265a85d66262da30be905fa0d3e7d310a6e1 /it_url.class | |
parent | 3fc0d00f21b44d44ee1cf0513235e1b51340a290 (diff) | |
download | itools-84fe0c2eaa7deb0681cfc8746434044a2fae53c6.tar.gz itools-84fe0c2eaa7deb0681cfc8746434044a2fae53c6.tar.bz2 itools-84fe0c2eaa7deb0681cfc8746434044a2fae53c6.zip |
reapply "use safer it:: variants of file funcs", was not the culprit in jussi downtimes
This reverts commit 99b7fc8dc08da090bb7f00c2882e1daeec4434ba.
Diffstat (limited to 'it_url.class')
-rw-r--r-- | it_url.class | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/it_url.class b/it_url.class index 8a78075..d3aa6df 100644 --- a/it_url.class +++ b/it_url.class @@ -447,7 +447,7 @@ function get_cache($p = array()) { $newfile = it_url::_atomicwrite($path, $result); if ($p['returnheaders']) - file_put_contents("$path.headers", '<?php return ' . var_export($url->headers, true) . ";\n"); + it::file_put_contents("$path.headers", '<?php return ' . var_export($url->headers, true) . ";\n"); } else if ($p['keepfailed']) $result = $fileexists; @@ -541,7 +541,7 @@ function get_cache($p = array()) */ function get_cache_contents($p) { - return ($fn = self::get_cache($p)) ? file_get_contents($fn) : it::error((array)$p['it_error'] + ['title' => $p['safety'] == 0 ? false : "failed getting " . it_url::absolute($p['url']), 'body' => $p]); + return ($fn = self::get_cache($p)) ? it::file_get_contents($fn) : it::error((array)$p['it_error'] + ['title' => $p['safety'] == 0 ? false : "failed getting " . it_url::absolute($p['url']), 'body' => $p]); } /** @@ -573,7 +573,7 @@ static function _expired($path, $maxage) static function _lock($path) { $force = EDC('nocache') || (($mtime = @filemtime("$path.lock")) && (time() - $mtime > 30)); # expire forgotten locks - return @fopen("$path.lock", $force ? "w" : "x"); + return @it::fopen("$path.lock", $force ? "w" : "x"); } /** @@ -625,7 +625,7 @@ static function _atomicwrite($path, $data) else if ($data !== false) { $tmpname = tempnam(dirname($path), "writetmp"); - fputs($cachetmp = fopen($tmpname, "w"), $data); + fputs($cachetmp = it::fopen($tmpname, "w"), $data); fclose($cachetmp); chmod($tmpname, 0664); $result = rename($tmpname, $path); |