Skip to content

Commit 7a9875c

Browse files
committed
bug #22965 [Cache] Ignore missing annotations.php (ro0NL)
This PR was squashed before being merged into the 3.3 branch (closes #22965). Discussion ---------- [Cache] Ignore missing annotations.php | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes (different in 3.2) | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!--highly recommended for new features--> Avoids the following notices if cache is not warmed up (i.e. `cache:clear --no-warmup` > hit the browser). ``` Warning: include(<base-path>/app/cache/<env>/annotations.php): failed to open stream: No such file or directory Warning: include(): Failed opening '<base-path>/app/cache/<env>/annotations.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') ``` Commits ------- e8f70c7 [Cache] Ignore missing annotations.php
2 parents 9cd68ee + e8f70c7 commit 7a9875c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Cache/Traits/PhpArrayTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,6 @@ public function clear()
126126
*/
127127
private function initialize()
128128
{
129-
$this->values = @(include $this->file) ?: array();
129+
$this->values = file_exists($this->file) ? (include $this->file ?: array()) : array();
130130
}
131131
}

0 commit comments

Comments
 (0)