Skip to content

Commit 772ab3d

Browse files
committed
bug symfony#23213 Fixed composer resources between web/cli (iltar)
This PR was merged into the 3.3 branch. Discussion ---------- Fixed composer resources between web/cli | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no (reverts one) | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#23212 | License | MIT | Doc PR | ~ This is a possible fix for the flawed module check for the composer resource. As this is the easiest fix, I've created a PR ready to be merged. Commits ------- 9e04712 Fixed composer resources between web/cli
2 parents 1d304d2 + 9e04712 commit 772ab3d

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

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

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,13 @@
1818
*/
1919
class ComposerResource implements SelfCheckingResourceInterface, \Serializable
2020
{
21-
private $versions;
2221
private $vendors;
2322

24-
private static $runtimeVersion;
2523
private static $runtimeVendors;
2624

2725
public function __construct()
2826
{
2927
self::refresh();
30-
$this->versions = self::$runtimeVersion;
3128
$this->vendors = self::$runtimeVendors;
3229
}
3330

@@ -51,36 +48,23 @@ public function isFresh($timestamp)
5148
{
5249
self::refresh();
5350

54-
if (self::$runtimeVersion !== $this->versions) {
55-
return false;
56-
}
57-
5851
return self::$runtimeVendors === $this->vendors;
5952
}
6053

6154
public function serialize()
6255
{
63-
return serialize(array($this->versions, $this->vendors));
56+
return serialize($this->vendors);
6457
}
6558

6659
public function unserialize($serialized)
6760
{
68-
list($this->versions, $this->vendors) = unserialize($serialized);
61+
$this->vendors = unserialize($serialized);
6962
}
7063

7164
private static function refresh()
7265
{
73-
if (null !== self::$runtimeVersion) {
74-
return;
75-
}
76-
77-
self::$runtimeVersion = array();
7866
self::$runtimeVendors = array();
7967

80-
foreach (get_loaded_extensions() as $ext) {
81-
self::$runtimeVersion[$ext] = phpversion($ext);
82-
}
83-
8468
foreach (get_declared_classes() as $class) {
8569
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
8670
$r = new \ReflectionClass($class);

0 commit comments

Comments
 (0)