Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

Commit666dc41

Browse files
committed
bug#18312 [ClassLoader] Fix storing not-found classes in APC cache (nicolas-grekas)
This PR was merged into the 2.3 branch.Discussion----------[ClassLoader] Fix storing not-found classes in APC cache| Q | A| ------------- | ---| Branch? | 2.3| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -Commits-------106ed06 [ClassLoader] Fix storing not-found classes in APC cache
2 parentsbbf00d2 +106ed06 commit666dc41

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

‎src/Symfony/Component/ClassLoader/ApcClassLoader.php‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,10 @@ public function loadClass($class)
122122
*/
123123
publicfunctionfindFile($class)
124124
{
125-
if (false ===$file =apcu_fetch($this->prefix.$class)) {
126-
apcu_store($this->prefix.$class,$file =$this->decorated->findFile($class));
125+
$file =apcu_fetch($this->prefix.$class,$success);
126+
127+
if (!$success) {
128+
apcu_store($this->prefix.$class,$file =$this->decorated->findFile($class) ?:null);
127129
}
128130

129131
return$file;

‎src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ public function __construct($prefix)
8787
*/
8888
publicfunctionfindFile($class)
8989
{
90-
if (false ===$file =apcu_fetch($this->prefix.$class)) {
91-
apcu_store($this->prefix.$class,$file =parent::findFile($class));
90+
$file =apcu_fetch($this->prefix.$class,$success);
91+
92+
if (!$success) {
93+
apcu_store($this->prefix.$class,$file =parent::findFile($class) ?:null);
9294
}
9395

9496
return$file;

‎src/Symfony/Component/ClassLoader/DebugClassLoader.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function unregister()
7474
*/
7575
publicfunctionfindFile($class)
7676
{
77-
return$this->classFinder->findFile($class);
77+
return$this->classFinder->findFile($class) ?:null;
7878
}
7979

8080
/**

‎src/Symfony/Component/ClassLoader/WinCacheClassLoader.php‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,10 @@ public function loadClass($class)
123123
*/
124124
publicfunctionfindFile($class)
125125
{
126-
if (false ===$file =wincache_ucache_get($this->prefix.$class)) {
127-
wincache_ucache_set($this->prefix.$class,$file =$this->decorated->findFile($class),0);
126+
$file =wincache_ucache_get($this->prefix.$class,$success);
127+
128+
if (!$success) {
129+
wincache_ucache_set($this->prefix.$class,$file =$this->decorated->findFile($class) ?:null,0);
128130
}
129131

130132
return$file;

‎src/Symfony/Component/ClassLoader/XcacheClassLoader.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function findFile($class)
126126
if (xcache_isset($this->prefix.$class)) {
127127
$file =xcache_get($this->prefix.$class);
128128
}else {
129-
$file =$this->decorated->findFile($class);
129+
$file =$this->decorated->findFile($class) ?:null;
130130
xcache_set($this->prefix.$class,$file);
131131
}
132132

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp