Move generating cache key from files from OC_Minimizer to OC_Cache
This commit is contained in:
parent
5aec26a37c
commit
a7806076b1
|
@ -144,4 +144,13 @@ class OC_Cache {
|
|||
return self::$isFast;
|
||||
}
|
||||
|
||||
static public function generateCacheKeyFromFiles($files) {
|
||||
$key = '';
|
||||
sort($files);
|
||||
foreach($files as $file) {
|
||||
$stat = stat($file);
|
||||
$key .= $file.$stat['mtime'].$stat['size'];
|
||||
}
|
||||
return md5($key);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,14 +2,11 @@
|
|||
|
||||
abstract class OC_Minimizer {
|
||||
public function generateETag($files) {
|
||||
$etag = '';
|
||||
sort($files);
|
||||
$fullpath_files = array();
|
||||
foreach($files as $file_info) {
|
||||
$file = $file_info[0] . '/' . $file_info[2];
|
||||
$stat = stat($file);
|
||||
$etag .= $file.$stat['mtime'].$stat['size'];
|
||||
$fullpath_files[] = $file_info[0] . '/' . $file_info[2];
|
||||
}
|
||||
return md5($etag);
|
||||
return OC_Cache::generateCacheKeyFromFiles($fullpath_files);
|
||||
}
|
||||
|
||||
abstract public function minimizeFiles($files);
|
||||
|
|
Loading…
Reference in New Issue