diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5f1c193719e..bdaabfa0c2d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -145,6 +145,31 @@ if (! function_exists('json_decode')) } } +/** + * Enter description here ... + * + * @param string $class + * @param string $member + * @return void + */ +function getStaticMember($class, $member) +{ + if (is_object($class)) $class = get_class($class); + $classObj = new ReflectionClass($class); + $result = null; + + foreach($classObj->getStaticProperties() as $prop => $value) + { + if($prop == $member) + { + $result = $value; + break; + } + } + + return $result; +} + /** * Return a DoliDB instance (database handler). diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 9ac1f1eac7f..05f9a556d43 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -284,8 +284,8 @@ if (! empty($force_install_message)) include_once($dir."/".$file); // Version min of database - $versionbasemin=$class::$versionmin; - $note='('.$class::$label.' >= '.versiontostring($versionbasemin).')'; + $versionbasemin=getStaticMember($class, 'versionmin'); + $note='('.getStaticMember($class, 'label').' >= '.versiontostring($versionbasemin).')'; // Switch to mysql if mysqli is not present if ($defaultype=='mysqli' && !function_exists('mysqli_connect')) $defaultype = 'mysql';