mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX #3066: Fix ?isDev=1 option
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@65923 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
daac81e7f1
commit
f3543e670a
@ -677,8 +677,6 @@ class Director {
|
||||
* For information about environment types, see {@link Director::set_environment_type()}.
|
||||
*/
|
||||
static function isDev() {
|
||||
if(self::$environment_type) return self::$environment_type == 'dev';
|
||||
|
||||
// Use ?isDev=1 to get development access on the live server
|
||||
if(isset($_GET['isDev'])) {
|
||||
if(Security::database_is_ready()) {
|
||||
@ -688,8 +686,10 @@ class Director {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(isset($_SESSION['isDev']) && $_SESSION['isDev']) return true;
|
||||
|
||||
if(self::$environment_type) return self::$environment_type == 'dev';
|
||||
|
||||
// Check if we are running on one of the development servers
|
||||
if(in_array($_SERVER['HTTP_HOST'], Director::$dev_servers)) {
|
||||
@ -710,6 +710,8 @@ class Director {
|
||||
* For information about environment types, see {@link Director::set_environment_type()}.
|
||||
*/
|
||||
static function isTest() {
|
||||
if(self::isDev()) return false;
|
||||
|
||||
if(self::$environment_type) {
|
||||
return self::$environment_type == 'test';
|
||||
}
|
||||
|
@ -132,7 +132,8 @@ class DB {
|
||||
* @return boolean
|
||||
*/
|
||||
static function isActive() {
|
||||
return DB::$globalConn->isActive();
|
||||
if(DB::$globalConn) return DB::$globalConn->isActive();
|
||||
else return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user