mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merged revisions 46139 via svnmerge from
svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2.1 ........ r46139 | aoneil | 2007-12-03 11:28:34 +1300 (Mon, 03 Dec 2007) | 2 lines #1942 - Object::uninherited() fix for PHP 5.1.2 ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@46814 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
6b66c9beff
commit
fa9a258bd2
@ -310,9 +310,14 @@ class Object {
|
|||||||
$val = $this->stat($name);
|
$val = $this->stat($name);
|
||||||
$val2 = null;
|
$val2 = null;
|
||||||
try {
|
try {
|
||||||
$reflection = new ReflectionClass(get_parent_class($this));
|
// The reflection doesn't work properly in 5.1.2
|
||||||
$property = $reflection->getProperty($name);
|
if(phpversion() == '5.1.2') {
|
||||||
$val2 = $property->getValue();
|
$val2 = eval('return ' . get_parent_class($this) . "::\$$name;");
|
||||||
|
} else {
|
||||||
|
$reflection = new ReflectionClass(get_parent_class($this));
|
||||||
|
$property = $reflection->getProperty($name);
|
||||||
|
$val2 = $property->getValue();
|
||||||
|
}
|
||||||
} catch(Exception $exc) {
|
} catch(Exception $exc) {
|
||||||
// do nothing.. the property doesn't exists!
|
// do nothing.. the property doesn't exists!
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user