‪TYPO3CMS  9.5
UnlockBackendCommand.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 use Symfony\Component\Console\Command\Command;
17 use Symfony\Component\Console\Input\InputInterface;
18 use Symfony\Component\Console\Output\OutputInterface;
19 use Symfony\Component\Console\Style\SymfonyStyle;
21 
25 class ‪UnlockBackendCommand extends Command
26 {
30  protected function ‪configure()
31  {
32  $this->setDescription('Unlock the TYPO3 Backend');
33  }
34 
41  protected function ‪execute(InputInterface $input, OutputInterface ‪$output)
42  {
43  $io = new SymfonyStyle($input, ‪$output);
44  $io->title($this->getDescription());
45  $lockFile = $this->‪getLockFileName();
46  if (@is_file($lockFile)) {
47  unlink($lockFile);
48  if (@is_file($lockFile)) {
49  $io->caution('Could not remove lock file "' . $lockFile . '"!');
50  } else {
51  $io->success('Removed lock file "' . $lockFile . '".');
52  }
53  } else {
54  $io->note('No lock file "' . $lockFile . '" was found.' . LF . 'Hence no lock can be removed.');
55  }
56  }
57 
63  protected function ‪getLockFileName()
64  {
65  return ‪Environment::getLegacyConfigPath() . '/LOCK_BACKEND';
66  }
67 }
‪TYPO3\CMS\Backend\Command\UnlockBackendCommand\configure
‪configure()
Definition: UnlockBackendCommand.php:30
‪TYPO3\CMS\Backend\Command\UnlockBackendCommand\execute
‪execute(InputInterface $input, OutputInterface $output)
Definition: UnlockBackendCommand.php:41
‪TYPO3\CMS\Backend\Command
Definition: LockBackendCommand.php:2
‪TYPO3\CMS\Backend\Command\UnlockBackendCommand
Definition: UnlockBackendCommand.php:26
‪$output
‪$output
Definition: annotationChecker.php:113
‪TYPO3\CMS\Backend\Command\UnlockBackendCommand\getLockFileName
‪string getLockFileName()
Definition: UnlockBackendCommand.php:63
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:39
‪TYPO3\CMS\Core\Core\Environment\getLegacyConfigPath
‪static string getLegacyConfigPath()
Definition: Environment.php:256