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