summaryrefslogtreecommitdiff
path: root/itjs.class
diff options
context:
space:
mode:
authorChristian Schneider2016-01-29 08:34:12 +0100
committerChristian Schneider2016-01-29 08:34:12 +0100
commitb3e0bc32f74878216fe09c846d30f375e082ff9a (patch)
tree9e9f27849d7dd204da00dcf4231856beae7baa35 /itjs.class
parent0b595fbd0d1db23b311c9b155455ac09d2ae9f44 (diff)
downloaditools-b3e0bc32f74878216fe09c846d30f375e082ff9a.tar.gz
itools-b3e0bc32f74878216fe09c846d30f375e082ff9a.tar.bz2
itools-b3e0bc32f74878216fe09c846d30f375e082ff9a.zip
Revert 0b595fb/80c5bcd as they break map.search.ch/api/map.js
Diffstat (limited to 'itjs.class')
-rw-r--r--itjs.class5
1 files changed, 4 insertions, 1 deletions
diff --git a/itjs.class b/itjs.class
index 67027eb..0a57465 100644
--- a/itjs.class
+++ b/itjs.class
@@ -198,12 +198,15 @@ static function checksum($fnlist, $p = array())
foreach (is_array($fnlist) ? $fnlist : itjs::filenames($fnlist) as $filename)
$filenames[] = !file_exists($filename) && file_exists($t = it::replace(array('^/www/[^/]*' => "/www/lib.search.ch"), $filename)) ? $t : $filename;
+ if (preg_grep('/jquery(build)\.js/', $filenames)) # jquery files may be included invisibly
+ $filenames = array_merge($filenames, array("/www/lib.search.ch/var/jquery-ui/dist/minified/core.min.js", "/www/lib.search.ch/var/jquery/dist/jquery.min.js"));
+
$key = "itjs_" . md5(join("", it::map('"$v" . @filemtime("$v")', $filenames)));
if ($filenames && $p['short_expire'] && (time() - max(@array_map('filemtime', $filenames)) < 60))
return "-"; # trigger short expire, our file may not yet be up to date on other slaves
else if ($filenames)
- return it_cache::get($key) ?: it_cache::put($key, substr(md5(self::filecontents($filenames, it::match('\.(js|css)', join("", $filenames)))), 0, 10), array('ttl' => 60));
+ return it_cache::get($key) ?: it_cache::put($key, substr(md5(self::filecontents($filenames, false)), 0, 10), array('ttl' => 60));
}
/**