1818 */
1919class 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