Skip to content
This repository was archived by the owner on Aug 15, 2023. It is now read-only.

Commit c17941e

Browse files
author
Georg Ringer
committed
[TASK] Restructure CommandController
1 parent 6ef4612 commit c17941e

File tree

5 files changed

+122
-23
lines changed

5 files changed

+122
-23
lines changed

Classes/Command/ApiCommandController.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,6 @@
3030
*/
3131
class Tx_Coreapi_Command_ApiCommandController extends Tx_Extbase_MVC_Controller_CommandController {
3232

33-
/**
34-
* Clear all caches
35-
*
36-
* @return void
37-
*/
38-
public function clearAllCacheCommand() {
39-
$this->objectManager->get('Tx_Coreapi_Service_CacheApiService')->clearAllCaches();
40-
$this->outputLine('All caches have been cleared.');
41-
}
42-
43-
/**
44-
* Clear configuration cache (temp_CACHED_..)
45-
*
46-
* @return void
47-
*/
48-
public function clearConfigurationCacheCommand() {
49-
$this->objectManager->get('Tx_Coreapi_Service_CacheApiService')->clearConfigurationCache();
50-
$this->outputLine('Configuration Cache has been cleared.');
51-
}
52-
5333
/**
5434
* Database compare
5535
*
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
/***************************************************************
3+
* Copyright notice
4+
*
5+
* (c) 2012 Georg Ringer <[email protected]>
6+
* All rights reserved
7+
*
8+
* This script is part of the TYPO3 project. The TYPO3 project is
9+
* free software; you can redistribute it and/or modify
10+
* it under the terms of the GNU General Public License as published by
11+
* the Free Software Foundation; either version 2 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* The GNU General Public License can be found at
15+
* http://www.gnu.org/copyleft/gpl.html.
16+
*
17+
* This script is distributed in the hope that it will be useful,
18+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
* GNU General Public License for more details.
21+
*
22+
* This copyright notice MUST APPEAR in all copies of the script!
23+
***************************************************************/
24+
25+
/**
26+
* API Command Controller
27+
*
28+
* @package TYPO3
29+
* @subpackage tx_coreapi
30+
*/
31+
class Tx_Coreapi_Command_CacheApiCommandController extends Tx_Extbase_MVC_Controller_CommandController {
32+
33+
/**
34+
* Clear all caches
35+
*
36+
* @return void
37+
*/
38+
public function clearAllCacheCommand() {
39+
$this->objectManager->get('Tx_Coreapi_Service_CacheApiService')->clearAllCaches();
40+
$this->outputLine('All caches have been cleared.');
41+
}
42+
43+
/**
44+
* Clear configuration cache (temp_CACHED_..)
45+
*
46+
* @return void
47+
*/
48+
public function clearConfigurationCacheCommand() {
49+
$this->objectManager->get('Tx_Coreapi_Service_CacheApiService')->clearConfigurationCache();
50+
$this->outputLine('Configuration Cache has been cleared.');
51+
}
52+
53+
}
54+
55+
?>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
/***************************************************************
3+
* Copyright notice
4+
*
5+
* (c) 2012 Georg Ringer <[email protected]>
6+
* All rights reserved
7+
*
8+
* This script is part of the TYPO3 project. The TYPO3 project is
9+
* free software; you can redistribute it and/or modify
10+
* it under the terms of the GNU General Public License as published by
11+
* the Free Software Foundation; either version 2 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* The GNU General Public License can be found at
15+
* http://www.gnu.org/copyleft/gpl.html.
16+
*
17+
* This script is distributed in the hope that it will be useful,
18+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
* GNU General Public License for more details.
21+
*
22+
* This copyright notice MUST APPEAR in all copies of the script!
23+
***************************************************************/
24+
25+
/**
26+
* Site API Command Controller
27+
*
28+
* @package TYPO3
29+
* @subpackage tx_coreapi
30+
*/
31+
class Tx_Coreapi_Command_SiteApiCommandController extends Tx_Extbase_MVC_Controller_CommandController {
32+
33+
/**
34+
* Site info
35+
*
36+
* Basic information about the system
37+
*
38+
* @return void
39+
*/
40+
public function infoCommand() {
41+
// todo
42+
43+
}
44+
45+
/**
46+
* Create a sys news
47+
*
48+
* Sys news record is displayed at the login page
49+
*
50+
* @param string $header Header text
51+
* @param string $text Basic text
52+
* @return void
53+
*/
54+
public function createSysNewsCommand($header, $text = '') {
55+
56+
}
57+
58+
}
59+
60+
?>

ext_autoload.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
$extensionClassesPath = $extensionPath . 'Classes/';
77
return array(
88
'tx_coreapi_command_apicommandcontroller' => $extensionClassesPath . 'Command/ApiCommandController.php',
9+
'tx_coreapi_command_siteapicommandcontroller' => $extensionClassesPath . 'Command/SiteApiCommandController.php',
10+
'tx_coreapi_command_cacheapicommandcontroller' => $extensionClassesPath . 'Command/CacheApiCommandController.php',
911
'tx_coreapi_service_cacheapiservice' => $extensionClassesPath . 'Service/CacheApiService.php',
1012
'tx_coreapi_service_databaseapiservice' => $extensionClassesPath . 'Service/DatabaseApiService.php',
1113
'tx_coreapi_service_extensionapiservice' => $extensionClassesPath . 'Service/ExtensionApiService.php',

ext_localconf.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?php
22
if (!defined ('TYPO3_MODE')) die ('Access denied.');
33

4-
//if (TYPO3_MODE === 'BE') {
5-
// register setup command
4+
if (TYPO3_MODE === 'BE') {
5+
// Register commands
66
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = 'Tx_Coreapi_Command_ApiCommandController';
7-
//}
7+
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = 'Tx_Coreapi_Command_CacheApiCommandController';
8+
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = 'Tx_Coreapi_Command_SiteApiCommandController';
9+
}
810

911
?>

0 commit comments

Comments
 (0)