Skip to content
Snippets Groups Projects
Commit 0b70d262 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Keep commented code to keep a chance for old php version to work.

parent 0559e29c
Branches
Tags
No related merge requests found
...@@ -44,14 +44,31 @@ include_once DOL_DOCUMENT_ROOT .'/core/lib/json.lib.php'; ...@@ -44,14 +44,31 @@ include_once DOL_DOCUMENT_ROOT .'/core/lib/json.lib.php';
* @param string $class Class name * @param string $class Class name
* @param string $member Name of property * @param string $member Name of property
* @return mixed Return value of static property * @return mixed Return value of static property
* @deprecated PHP 5.3 is now the minimum requirement, this is no longer necessary
*/ */
function getStaticMember($class, $member) function getStaticMember($class, $member)
{ {
if (isset($class::$member)) { // This part is deprecated. Uncomment if for php 5.2.*, and comment next isset class::member
return $class::$member; /*if (version_compare(phpversion(), '5.3.0', '<'))
{
if (is_object($class)) $class = get_class($class);
$classObj = new ReflectionClass($class);
$result = null;
$found=0;
foreach($classObj->getStaticProperties() as $prop => $value)
{
if ($prop == $member)
{
$result = $value;
$found++;
break;
}
} }
if ($found) return $result;
}*/
if (isset($class::$member)) return $class::$member;
dol_print_error('','Try to get a static member "'.$member.'" in class "'.$class.'" that does not exists or is not static.'); dol_print_error('','Try to get a static member "'.$member.'" in class "'.$class.'" that does not exists or is not static.');
return null; return null;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment