2 namespace TYPO3\CMS\Lowlevel;
26 'setBElock' =>
'Set the Backend Lock',
27 'clearBElock' =>
'Clears the Backend Lock',
37 parent::__construct();
39 $this->cli_options[] = array(
'--redirect=[URL]',
'For toolkey "setBElock": The URL to which the redirection will occur.');
41 $this->
cli_help[
'name'] =
'lowlevel_admin -- Various functions for administration and maintenance of TYPO3 from the command line';
42 $this->
cli_help[
'synopsis'] =
'toolkey ###OPTIONS###';
43 $this->
cli_help[
'description'] =
'The \'toolkey\' keywords are:
46 ', array_keys($this->adminModules));
47 $this->
cli_help[
'examples'] =
'/.../cli_dispatch.phpsh lowlevel_admin setBElock --redirect=http://url_which_explains_why.com/';
48 $this->
cli_help[
'author'] =
'Kasper Skaarhoej, (c) 2009';
65 $GLOBALS[
'BE_USER']->user[
'admin'] = 1;
66 $GLOBALS[
'BE_USER']->setWorkspace(0);
68 $analysisType = (string)$this->cli_args[
'_DEFAULT'][1];
75 switch ((
string)$analysisType) {
77 if (@is_file((PATH_typo3conf .
'LOCK_BACKEND'))) {
78 $this->
cli_echo(
'A lockfile already exists. Overwriting it...
82 \TYPO3\CMS\Core\Utility\GeneralUtility::writeFile(PATH_typo3conf .
'LOCK_BACKEND', $lockFileContent);
83 $this->
cli_echo(
'Wrote lock-file to \'' . PATH_typo3conf .
'LOCK_BACKEND\' with content \'' . $lockFileContent .
'\'');
86 if (@is_file((PATH_typo3conf .
'LOCK_BACKEND'))) {
87 unlink(PATH_typo3conf .
'LOCK_BACKEND');
88 if (@is_file((PATH_typo3conf .
'LOCK_BACKEND'))) {
89 $this->
cli_echo(
'ERROR: Could not remove lock file \'' . PATH_typo3conf .
'LOCK_BACKEND\'!!
92 $this->
cli_echo(
'Removed lock file \'' . PATH_typo3conf .
'LOCK_BACKEND\'
96 $this->
cli_echo(
'No lock file \'' . PATH_typo3conf .
'LOCK_BACKEND\' was found; hence no lock can be removed.\'
101 $this->
cli_echo(
'Unknown toolkey, \'' . $analysisType .
'\'');