$actionSegs = $request->getActionSegments(); if (isset($actionSegs[0]) && $actionSegs[0] === 'install') { return $this->_processActionRequest($request); } } // Should they be accessing the installer? if (!$isInstalled) { if (!$isCpRequest) { throw new ServiceUnavailableHttpException(); } // Redirect to the installer if Dev Mode is enabled if (YII_DEBUG) { $url = UrlHelper::url('install'); $this->getResponse()->redirect($url); $this->end(); }
} else { // In case PHP is already setting one header_remove('X-Powered-By'); } // Process install requests if (($response = $this->_processInstallRequest($request)) !== null) { return $response; } // Check if the app path has changed. If so, run the requirements check again. if (($response = $this->_processRequirementsCheck($request)) !== null) { $this->_unregisterDebugModule();
{ try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
} // Load and run Craft define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production'); /** @var craft\web\Application $app */ $app = require CRAFT_VENDOR_PATH.'/craftcms/cms/bootstrap/web.php'; $app->run();