mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #738 from simonwelsh/lsb-53-30
FIX Removes version checking for LSB in Object::static_lookup()
This commit is contained in:
commit
93cdb83ac8
@ -274,8 +274,6 @@ abstract class Object {
|
|||||||
* Get the value of a static property of a class, even in that property is declared protected (but not private), without any inheritance,
|
* Get the value of a static property of a class, even in that property is declared protected (but not private), without any inheritance,
|
||||||
* merging or parent lookup if it doesn't exist on the given class.
|
* merging or parent lookup if it doesn't exist on the given class.
|
||||||
*
|
*
|
||||||
* If using PHP 5.4, we can do this using $foo::$bar syntax. PHP 5.3 uses ReflectionClass to get the static properties instead.
|
|
||||||
*
|
|
||||||
* @static
|
* @static
|
||||||
* @param $class - The class to get the static from
|
* @param $class - The class to get the static from
|
||||||
* @param $name - The property to get from the class
|
* @param $name - The property to get from the class
|
||||||
@ -283,7 +281,7 @@ abstract class Object {
|
|||||||
* @return any - The value of the static property $name on class $class, or $default if that property is not defined
|
* @return any - The value of the static property $name on class $class, or $default if that property is not defined
|
||||||
*/
|
*/
|
||||||
public static function static_lookup($class, $name, $default = null) {
|
public static function static_lookup($class, $name, $default = null) {
|
||||||
if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4 && is_subclass_of($class, 'Object')) {
|
if (is_subclass_of($class, 'Object')) {
|
||||||
if (isset($class::$$name)) {
|
if (isset($class::$$name)) {
|
||||||
$parent = get_parent_class($class);
|
$parent = get_parent_class($class);
|
||||||
if (!$parent || !isset($parent::$$name) || $parent::$$name !== $class::$$name) return $class::$$name;
|
if (!$parent || !isset($parent::$$name) || $parent::$$name !== $class::$$name) return $class::$$name;
|
||||||
|
@ -17,7 +17,7 @@ class MySQLDatabaseTest extends SapphireTest {
|
|||||||
'MultiEnum3' => 'MultiEnum("A, B, C, D","A, B")',
|
'MultiEnum3' => 'MultiEnum("A, B, C, D","A, B")',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
$this->markTestSkipped('This test requires the Config API to be immutable');
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,7 +27,6 @@ class MySQLDatabaseTest extends SapphireTest {
|
|||||||
function testFieldsDontRerequestChanges() {
|
function testFieldsDontRerequestChanges() {
|
||||||
// These are MySQL specific :-S
|
// These are MySQL specific :-S
|
||||||
if(DB::getConn() instanceof MySQLDatabase) {
|
if(DB::getConn() instanceof MySQLDatabase) {
|
||||||
|
|
||||||
$db = DB::getConn();
|
$db = DB::getConn();
|
||||||
DB::quiet();
|
DB::quiet();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user