Classes/Console/Command/BackendCommandController.php
public function lockCommand($redirectUrl = null)
    {
        if (@is_file(PATH_typo3conf . 'LOCK_BACKEND')) {
            $this->outputLine('<warning>Backend is already locked.</warning>');
            $this->quit(0);
        }
        \TYPO3\CMS\Core\Utility\GeneralUtility::writeFile(PATH_typo3conf . 'LOCK_BACKEND', (string)$redirectUrl);
        if (!@is_file(PATH_typo3conf . 'LOCK_BACKEND')) {
            $this->outputLine('<error>Could not create lock file \'typo3conf/LOCK_BACKEND\'.</error>');
            $this->quit(2);
        } else {
            $this->outputLine('<info>Backend has been locked. Access is denied for every user until it is unlocked again.</info>');
            if ($redirectUrl !== null) {
                $this->outputLine('Any access to the backend will be redirected to: \'' . $redirectUrl . '\'');
            }
        }
    }
public function lockCommand($redirectUrl = null)
    {
        if (@is_file(PATH_typo3conf . 'LOCK_BACKEND')) {
            $this->outputLine('<warning>Backend is already locked.</warning>');
            $this->quit(0);
        }
        \TYPO3\CMS\Core\Utility\GeneralUtility::writeFile(PATH_typo3conf . 'LOCK_BACKEND', (string)$redirectUrl);
        if (!@is_file(PATH_typo3conf . 'LOCK_BACKEND')) {
            $this->outputLine('<error>Could not create lock file \'typo3conf/LOCK_BACKEND\'.</error>');
            $this->quit(2);
        } else {
            $this->outputLine('<info>Backend has been locked. Access is denied for every user until it is unlocked again.</info>');
            if ($redirectUrl !== null) {
                $this->outputLine('Any access to the backend will be redirected to: \'' . $redirectUrl . '\'');
            }
        }
    }
Lock backend

Deny backend access for <b>every</b> user (including admins).

@param string $redirectUrl URL to redirect to when the backend is accessed
@see typo3_console:backend:unlock