diff options
author | Urban Müller | 2016-01-29 01:11:30 +0100 |
---|---|---|
committer | Urban Müller | 2016-01-29 01:11:30 +0100 |
commit | 80c5bcd3fcc43b692a3296e7d079e568fc4487b7 (patch) | |
tree | 91819f68ca7c7b5107e8644d4d8b4bfc21d2623e | |
parent | 7066055acc2b1b7c7160eb4e3b9c814569b7466e (diff) | |
download | itools-80c5bcd3fcc43b692a3296e7d079e568fc4487b7.tar.gz itools-80c5bcd3fcc43b692a3296e7d079e568fc4487b7.tar.bz2 itools-80c5bcd3fcc43b692a3296e7d079e568fc4487b7.zip |
execute php when fetching js/css files for checksum
-rw-r--r-- | itjs.class | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -198,15 +198,12 @@ 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, false)), 0, 10), array('ttl' => 60)); + return it_cache::get($key) ?: it_cache::put($key, substr(md5(self::filecontents($filenames, it::match('\.(js|css)', $fnlist))), 0, 10), array('ttl' => 60)); } /** |