Check if the cached js file exists

Fixes #8705

If the file does not exist (for whatever reason). It is never cached. No
matter what the depscache etc tell you.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-03-07 12:55:05 +01:00
parent 3867a74f0d
commit 34b86edc34
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 8 additions and 1 deletions

View File

@ -104,13 +104,20 @@ class JSCombiner {
* @return bool
*/
protected function isCached($fileName, ISimpleFolder $folder) {
$fileName = str_replace('.json', '.js', $fileName) . '.deps';
$fileName = str_replace('.json', '.js', $fileName);
if (!$folder->fileExists($fileName)) {
return false;
}
$fileName = $fileName . '.deps';
try {
$deps = $this->depsCache->get($folder->getName() . '-' . $fileName);
if ($deps === null || $deps === '') {
$depFile = $folder->getFile($fileName);
$deps = $depFile->getContent();
}
// check again
if ($deps === null || $deps === '') {
$this->logger->info('JSCombiner: deps file empty: ' . $fileName);