mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Added isset($_SERVER['HTTP_HOST']) checks to Director->isDev() and Director->isTest() - these environment variables are not available in CLI mode, and show up as PHP notices in a default cli-script/sake execution
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@66302 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e4bcce061c
commit
647c25ca14
@ -703,7 +703,7 @@ class Director {
|
|||||||
if(self::$environment_type) return self::$environment_type == 'dev';
|
if(self::$environment_type) return self::$environment_type == 'dev';
|
||||||
|
|
||||||
// Check if we are running on one of the development servers
|
// Check if we are running on one of the development servers
|
||||||
if(in_array($_SERVER['HTTP_HOST'], Director::$dev_servers)) {
|
if(isset($_SERVER['HTTP_HOST']) && in_array($_SERVER['HTTP_HOST'], Director::$dev_servers)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -728,7 +728,7 @@ class Director {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if we are running on one of the test servers
|
// Check if we are running on one of the test servers
|
||||||
if(in_array($_SERVER['HTTP_HOST'], Director::$test_servers)) {
|
if(isset($_SERVER['HTTP_HOST']) && in_array($_SERVER['HTTP_HOST'], Director::$test_servers)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user