TYPO3 CMS  TYPO3_8-7
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  */
20 
24 class UnlockBackendCommand extends Command
25 {
29  protected function configure()
30  {
31  $this->setDescription('Unlock the TYPO3 Backend');
32  }
33 
40  protected function execute(InputInterface $input, OutputInterface $output)
41  {
42  $io = new SymfonyStyle($input, $output);
43  $io->title($this->getDescription());
44  $lockFile = $this->getLockFileName();
45  if (@is_file($lockFile)) {
46  unlink($lockFile);
47  if (@is_file($lockFile)) {
48  $io->caution('Could not remove lock file "' . $lockFile . '"!');
49  } else {
50  $io->success('Removed lock file "' . $lockFile . '".');
51  }
52  } else {
53  $io->note('No lock file "' . $lockFile . '" was found.' . LF . 'Hence no lock can be removed.');
54  }
55  }
56 
62  protected function getLockFileName()
63  {
64  return PATH_typo3conf . 'LOCK_BACKEND';
65  }
66 }
execute(InputInterface $input, OutputInterface $output)