mirror of
https://github.com/silverstripe/silverstripe-environmentcheck
synced 2024-10-22 17:05:40 +02:00
Merge pull request #57 from firebrandhq/add-php7.2-ss37-support
Ensure compatibility with SS 3.7 & PHP 7.2
This commit is contained in:
commit
4ea39828c1
5
_config.php
Normal file → Executable file
5
_config.php
Normal file → Executable file
@ -19,3 +19,8 @@
|
|||||||
// EnvironmentCheckSuite::register('check', 'FileWriteableCheck("assets")', "Is assets/ writeable?");
|
// EnvironmentCheckSuite::register('check', 'FileWriteableCheck("assets")', "Is assets/ writeable?");
|
||||||
// EnvironmentCheckSuite::register('check', 'FileWriteableCheck("' . TEMP_FOLDER . '")', "Is the temp folder 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');
|
||||||
|
}
|
||||||
|
4
code/EnvironmentCheckSuite.php
Normal file → Executable file
4
code/EnvironmentCheckSuite.php
Normal file → Executable file
@ -19,7 +19,7 @@
|
|||||||
*
|
*
|
||||||
* $result = EnvironmentCheckSuite::inst('health')->run();
|
* $result = EnvironmentCheckSuite::inst('health')->run();
|
||||||
*/
|
*/
|
||||||
class EnvironmentCheckSuite extends Object
|
class EnvironmentCheckSuite extends SS_Object
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Name of this suite.
|
* Name of this suite.
|
||||||
@ -121,7 +121,7 @@ class EnvironmentCheckSuite extends Object
|
|||||||
foreach ($this->checks as $check) {
|
foreach ($this->checks as $check) {
|
||||||
list($checkClass, $checkTitle) = $check;
|
list($checkClass, $checkTitle) = $check;
|
||||||
if (is_string($checkClass)) {
|
if (is_string($checkClass)) {
|
||||||
$checkInst = Object::create_from_string($checkClass);
|
$checkInst = SS_Object::create_from_string($checkClass);
|
||||||
if ($checkInst instanceof EnvironmentCheck) {
|
if ($checkInst instanceof EnvironmentCheck) {
|
||||||
$output[] = array($checkInst, $checkTitle);
|
$output[] = array($checkInst, $checkTitle);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user