src/Maintenance/Maintenance.php
public function isMaintenanceMode($ipAddress = null) {
		if ($ipAddress) {
			$this->enableDebugModeForWhitelist($ipAddress);
		}

		if (!file_exists($this->file)) {
			return false;
		}

		$content = file_get_contents($this->file);
		if ($content === false) {
			return false;
		}

		if ($content > 0 && $content < time()) {
			$this->setMaintenanceMode(false);
			return false;
		}

		if ($ipAddress) {
			$file = TMP . 'maintenanceOverride-' . $this->_slugIp($ipAddress) . '.txt';
			if (file_exists($file)) {
				Configure::write('Maintenance.overwrite', $ipAddress);
				return false;
			}
		}
		return true;
	}
public function isMaintenanceMode($ipAddress = null) {
		if ($ipAddress) {
			$this->enableDebugModeForWhitelist($ipAddress);
		}

		if (!file_exists($this->file)) {
			return false;
		}

		$content = file_get_contents($this->file);
		if ($content === false) {
			return false;
		}

		if ($content > 0 && $content < time()) {
			$this->setMaintenanceMode(false);
			return false;
		}

		if ($ipAddress) {
			$file = TMP . 'maintenanceOverride-' . $this->_slugIp($ipAddress) . '.txt';
			if (file_exists($file)) {
				Configure::write('Maintenance.overwrite', $ipAddress);
				return false;
			}
		}
		return true;
	}
public function isMaintenanceMode ( $ ipAddress = null ) { if ( $ ipAddress ) { $ this -> enableDebugModeForWhitelist ( $ ipAddress ) ; } if ( ! file_exists ( $ this -> file ) ) { return false ; } $ content = file_get_contents ( $ this -> file ) ; if ( $ content === false ) { return false ; } if ( $ content > 0 && $ content < time ( ) ) { $ this -> setMaintenanceMode ( false ) ; return false ; } if ( $ ipAddress ) { $ file = TMP . 'maintenanceOverride-' . $ this -> _slugIp ( $ ipAddress ) . '.txt' ; if ( file_exists ( $ file ) ) { Configure :: write ( 'Maintenance.overwrite' , $ ipAddress ) ; return false ; } } return true ; }
Check if maintenance mode is on.

If overwritable, it will set Configure value 'Maintenance.overwrite' with the
corresponding IP so the SetupComponent can trigger a warning message here.

@param string|null $ipAddress If passed it allows access when it matches whitelisted IPs.
@return bool Success
Check if maintenance mode is on .