diff --git a/_config.php b/_config.php old mode 100644 new mode 100755 index 69fe792..b83cd86 --- a/_config.php +++ b/_config.php @@ -19,3 +19,8 @@ // EnvironmentCheckSuite::register('check', 'FileWriteableCheck("assets")', "Is assets/ writeable?"); // EnvironmentCheckSuite::register('check', 'FileWriteableCheck("' . TEMP_FOLDER . '")', "Is the temp folder writeable?"); +// Ensure compatibility with PHP 7.2 ("object" is a reserved word), +// with SilverStripe 3.6 (using Object) and SilverStripe 3.7 (using SS_Object) +if (!class_exists('SS_Object')) { + class_alias('Object', 'SS_Object'); +} diff --git a/code/EnvironmentCheckSuite.php b/code/EnvironmentCheckSuite.php old mode 100644 new mode 100755 index 34f0034..3047d1b --- a/code/EnvironmentCheckSuite.php +++ b/code/EnvironmentCheckSuite.php @@ -19,7 +19,7 @@ * * $result = EnvironmentCheckSuite::inst('health')->run(); */ -class EnvironmentCheckSuite extends Object +class EnvironmentCheckSuite extends SS_Object { /** * Name of this suite. @@ -121,7 +121,7 @@ class EnvironmentCheckSuite extends Object foreach ($this->checks as $check) { list($checkClass, $checkTitle) = $check; if (is_string($checkClass)) { - $checkInst = Object::create_from_string($checkClass); + $checkInst = SS_Object::create_from_string($checkClass); if ($checkInst instanceof EnvironmentCheck) { $output[] = array($checkInst, $checkTitle); } else {