8000 Merge branch '4.1' · symfony/symfony@1abfb2c · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1abfb2c

Browse files
Merge branch '4.1'
* 4.1: [Cache] Improve resiliency when calling doFetch() in AbstractTrait [Messenger] Fixed MessengerPass::guessHandledClasses return type Fixing GlobResource when inside phar archive
2 parents 683bbf9 + 389fa4d commit 1abfb2c

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,11 @@ public function clear()
109109
try {
110110
if ($cleared = $this->versioningIsEnabled) {
111111
$namespaceVersion = 2;
112-
foreach ($this->doFetch(array('@'.$this->namespace)) as $v) {
113-
$namespaceVersion = 1 + (int) $v;
112+
try {
113+
foreach ($this->doFetch(array('@'.$this->namespace)) as $v) {
114+
$namespaceVersion = 1 + (int) $v;
115+
}
116+
} catch (\Exception $e) {
114117
}
115118
$namespaceVersion .= ':';
116119
$cleared = $this->doSave(array('@'.$this->namespace => $namespaceVersion), 0);
@@ -236,8 +239,11 @@ private function getId($key)
236239
{
237240
if ($this->versioningIsEnabled && '' === $this->namespaceVersion) {
238241
$this->namespaceVersion = '1:';
239-
foreach ($this->doFetch(array('@'.$this->namespace)) as $v) {
240-
$this->namespaceVersion = $v;
242+
try {
243+
foreach ($this->doFetch(array('@'.$this->namespace)) as $v) {
244+
$this->namespaceVersion = $v;
245+
}
246+
} catch (\Exception $e) {
241247
}
242248
}
243249

src/Symfony/Component/Config/Resource/GlobResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function getIterator()
9393
return;
9494
}
9595

96-
if (false === strpos($this->pattern, '/**/') && (defined('GLOB_BRACE') || false === strpos($this->pattern, '{'))) {
96+
if (0 !== strpos($this->prefix, 'phar://') && false === strpos($this->pattern, '/**/') && (defined('GLOB_BRACE') || false === strpos($this->pattern, '{'))) {
9797
foreach (glob($this->prefix.$this->pattern, defined('GLOB_BRACE') ? GLOB_BRACE : 0) as $path) {
9898
if ($this->recursive && is_dir($path)) {
9999
$files = iterator_to_array(new \RecursiveIteratorIterator(

0 commit comments

Comments
 (0)
0