Skip to content

Commit b584425

Browse files
mazhalaiisitnikov
authored andcommitted
MAGETWO-53777: [Github] Magento 2.1 RC1 - Error when running CLI upgrade command #4795
- adding check to see if file exists.
1 parent 0530a78 commit b584425

File tree

1 file changed

+9
-2
lines changed
  • lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader

1 file changed

+9
-2
lines changed

lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
use Magento\Framework\ObjectManager\ConfigLoaderInterface;
1010

11+
/**
12+
* Class Compiled returns configuration cache information
13+
*/
1114
class Compiled implements ConfigLoaderInterface
1215
{
1316
/**
@@ -25,8 +28,12 @@ public function load($area)
2528
if (isset($this->configCache[$area])) {
2629
return $this->configCache[$area];
2730
}
28-
$this->configCache[$area] = \unserialize(\file_get_contents(self::getFilePath($area)));
29-
return $this->configCache[$area];
31+
$filePath = self::getFilePath($area);
32+
if (\file_exists($filePath)) {
33+
$this->configCache[$area] = \unserialize(\file_get_contents($filePath));
34+
return $this->configCache[$area];
35+
}
36+
return [];
3037
}
3138

3239
/**

0 commit comments

Comments
 (0)