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:
Sam Minnee 2008-11-14 02:55:17 +00:00
parent daac81e7f1
commit f3543e670a
2 changed files with 7 additions and 4 deletions

View File

@ -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';
}

View File

@ -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;
}
/**