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:
Andrew O'Neil 2007-12-13 22:33:25 +00:00
parent 6b66c9beff
commit fa9a258bd2

View File

@ -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!
} }