summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it_url.class8
1 files changed, 4 insertions, 4 deletions
diff --git a/it_url.class b/it_url.class
index 356c938..0e81354 100644
--- a/it_url.class
+++ b/it_url.class
@@ -583,9 +583,10 @@ static function get_cache($p = array())
EDC('getcache', "new", $filemtime, $p['url'], $path);
$url = new it_url;
- if ($success = $url->_get($p + ['checkonly' => true, 'filemtime' => EDC('nocache') ? null : $filemtime])) # => true means not modified (no new data fetched)
+ if ($data = $url->_get($p + ['checkonly' => true, 'filemtime' => EDC('nocache') ? null : $filemtime])) # => true means not modified (no new data fetched)
{
- $newfile = it_url::_atomicwrite($path, $p['assoc'] ? serialize($success) : $success);
+ $success = true;
+ $newfile = it_url::_atomicwrite($path, $p['assoc'] ? serialize($data) : $data);
if ($p['returnheaders'])
it::file_put_contents("$path.headers", '<?php return ' . var_export($url->headers, true) . ";\n");
}
@@ -648,7 +649,6 @@ static function get_cache($p = array())
$success = file_exists($path);
}
- $cachemiss = 1;
it_url::_unlock($path, $lock);
}
else
@@ -669,7 +669,7 @@ static function get_cache($p = array())
}
if (EDC('getcachelog'))
- it::log('debug', 'getcachelog', "miss=" . intval($cachemiss), $p['url']);
+ it::log('debug', 'getcachelog', $p['id'], $p['url'], $newfile ? "fetched=" . mb_substr($data, 0, 500) : "");
### EDC('getcache', $success, $path); # too verbose
return $success ? ($p['returnheaders'] ? array($path, $headers) : $path) : false;