18
18
*/
19
19
class ComposerResource implements SelfCheckingResourceInterface, \Serializable
20
20
{
21
- private $ versions ;
22
21
private $ vendors ;
23
22
24
- private static $ runtimeVersion ;
25
23
private static $ runtimeVendors ;
26
24
27
25
public function __construct ()
28
26
{
29
27
self ::refresh ();
30
- $ this ->versions = self ::$ runtimeVersion ;
31
28
$ this ->vendors = self ::$ runtimeVendors ;
32
29
}
33
30
@@ -51,36 +48,23 @@ public function isFresh($timestamp)
51
48
{
52
49
self ::refresh ();
53
50
54
- if (self ::$ runtimeVersion !== $ this ->versions ) {
55
- return false ;
56
- }
57
-
58
51
return self ::$ runtimeVendors === $ this ->vendors ;
59
52
}
60
53
61
54
public function serialize ()
62
55
{
63
- return serialize (array ( $ this ->versions , $ this -> vendors ) );
56
+ return serialize ($ this ->vendors );
64
57
}
65
58
66
59
public function unserialize ($ serialized )
67
60
{
68
- list ( $ this ->versions , $ this -> vendors ) = unserialize ($ serialized );
61
+ $ this ->vendors = unserialize ($ serialized );
69
62
}
70
63
71
64
private static function refresh ()
72
65
{
73
- if (null !== self ::$ runtimeVersion ) {
74
- return ;
75
- }
76
-
77
- self ::$ runtimeVersion = array ();
78
66
self ::$ runtimeVendors = array ();
79
67
80
- foreach (get_loaded_extensions () as $ ext ) {
81
- self ::$ runtimeVersion [$ ext ] = phpversion ($ ext );
82
- }
83
-
84
68
foreach (get_declared_classes () as $ class ) {
85
69
if ('C ' === $ class [0 ] && 0 === strpos ($ class , 'ComposerAutoloaderInit ' )) {
86
70
$ r = new \ReflectionClass ($ class );
0 commit comments