File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
lib/Phpfastcache/Drivers/Solr Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -270,11 +270,18 @@ public function getStats(): DriverStatistic
270270 }
271271 }
272272
273+ $ version = 'Unknown version ' ;
274+ if (method_exists ($ this ->instance , 'getVersion ' )) {
275+ $ version = $ this ->instance ::getVersion ();
276+ } elseif (defined ($ this ->instance ::class . '::VERSION ' )) {
277+ $ version = constant ($ this ->instance ::class . '::VERSION ' );
278+ }
279+
273280 return (new DriverStatistic ())
274281 ->setData (implode (', ' , array_keys ($ this ->itemInstances )))
275282 ->setInfo (sprintf (
276283 'Solarium %s and Solr %s for %s %s. %d document(s) stored in the "%s" core ' ,
277- $ this -> instance :: VERSION ,
284+ $ version ,
278285 $ serverSystemInfo ['lucene ' ]['solr-spec-version ' ] ?? '[unknown SOLR version] ' ,
279286 $ serverSystemInfo ['system ' ]['name ' ] ?? '[unknown OS] ' ,
280287 $ serverSystemInfo ['system ' ]['version ' ] ?? '[unknown OS version] ' ,
You can’t perform that action at this time.
0 commit comments