Update base.php

This commit is contained in:
Namhyeon Go 2018-05-28 15:52:35 +09:00 committed by GitHub
parent 66c2b9797c
commit 177fe78877
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -224,6 +224,25 @@ if(!function_exists("check_function_exists")) {
}
}
if(!function_exists("get_property_value")) {
function get_property_value($prop, $obj, $ac=false) {
$result = null;
if(property_exists($obj, $prop)) {
if($ac) {
$reflection = new ReflectionClass($obj);
$property = $reflection->getProperty($prop);
$property->setAccessible($ac);
$result = $property->getValue($obj);
} else {
$result = $obj->{$prop};
}
}
return $result;
}
}
$scope = array();
set_scope("loaded", array(