}
// Makes sure that the uploaded files are compatible with the current database schema
if (!$this->getUpdates()->getIsCraftSchemaVersionCompatible()) {
$this->_unregisterDebugModule();
if ($request->getIsCpRequest()) {
$version = $this->getInfo()->version;
throw new HttpException(200, Craft::t('app', 'Craft CMS does not support backtracking to this version. Please update to Craft CMS {version} or later.', [
'version' => $version,
]));
}
throw new ServiceUnavailableHttpException();
}
// getIsCraftDbMigrationNeeded will return true if we’re in the middle of a manual or auto-update for Craft itself.
// If we’re in maintenance mode and it’s not a site request, show the manual update template.
{
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();
define('CRAFT_CP', true);
}
// Load and run Craft
/** @var craft\web\Application $app */
$app = require CRAFT_VENDOR_PATH . '/craftcms/cms/bootstrap/web.php';
$app->run();