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

Commit 865c5bd

Browse files
committed
[TASK] first implementation
1 parent 4b37d0e commit 865c5bd

File tree

7 files changed

+141
-0
lines changed

7 files changed

+141
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
class Tx_Coreapi_Controller_ApiCommandController extends Tx_Extbase_MVC_Controller_CommandController {
4+
5+
/**
6+
* Clear all caches
7+
*
8+
* @return string
9+
*/
10+
public function clearAllCacheCommand() {
11+
$this->objectManager->get('Tx_Coreapi_Service_CacheApiService')->clearAllCaches();
12+
return 'OK';
13+
}
14+
15+
/**
16+
* Clear configuration cache (temp_CACHED_..)
17+
*
18+
* @return string
19+
*/
20+
public function clearConfigurationCacheCommand() {
21+
$this->objectManager->get('Tx_Coreapi_Service_CacheApiService')->clearConfigurationCache();
22+
return 'OK';
23+
}
24+
}
25+
26+
?>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
class Tx_Coreapi_Service_CacheApiService {
4+
5+
/**
6+
* @var t3lib_TCEmain
7+
*/
8+
protected $tce;
9+
10+
/**
11+
*
12+
*/
13+
public function initializeObject() {
14+
$this->tce = t3lib_div::makeInstance('t3lib_TCEmain');
15+
$this->tce->start(Array(), Array());
16+
}
17+
18+
/**
19+
* Clear all caches
20+
*/
21+
public function clearAllCaches() {
22+
$this->tce->clear_cacheCmd('all');
23+
}
24+
25+
/**
26+
*
27+
*/
28+
public function clearPageCache() {
29+
$this->tce->clear_cacheCmd('pages');
30+
}
31+
32+
/**
33+
*
34+
*/
35+
public function clearConfigurationCache() {
36+
$this->tce->clear_cacheCmd('temp_cached');
37+
}
38+
39+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
class Tx_Coreapi_Service_DatabaseApiService {
4+
5+
/*
6+
site:info Provides some basic site status
7+
8+
site:importDatabaseTable Imports a given database table (e.g. a static table)
9+
10+
site:upgrade Upgrades a TYPO3 site to the most recent release
11+
site:upgradeDatabase Executes the database compare task and executes the required changes.
12+
site:upgradeWizard Executes the upgrade wizards.
13+
14+
user:list Provides a basic list of available backend users
15+
*/
16+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
class Tx_Coreapi_Service_ExtensionApiService {
4+
5+
/*
6+
7+
extension Provides some basic information on the site's extension status
8+
extension:info Fetches the latest (or provided) version of an extension from TER
9+
extension:list Lists all available extensions of a site
10+
extension:search Searches for an extension in the TER
11+
extension:fetch Fetches the latest (or provided) version of an extension from TER
12+
extension:install Installs the latest (or provided) version of an extension
13+
extension:uninstall Uninstalls an extension
14+
extension:refresh Refreshes the local cache of all extensions available in TER
15+
16+
*/
17+
}

ext_emconf.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
$EM_CONF[$_EXTKEY] = array(
4+
'title' => 'coreapi',
5+
'description' => 'coreapi',
6+
'category' => 'plugin',
7+
'author' => 'Tobias Liebig',
8+
'author_email' => '[email protected]',
9+
'author_company' => '',
10+
'shy' => '',
11+
'priority' => '',
12+
'module' => '',
13+
'state' => 'alpha',
14+
'internal' => '',
15+
'uploadfolder' => '1',
16+
'createDirs' => '',
17+
'modify_tables' => '',
18+
'clearCacheOnLoad' => 0,
19+
'lockType' => '',
20+
'version' => '0.0.1',
21+
'constraints' => array(
22+
'depends' => array(
23+
'cms' => '',
24+
'extbase' => '',
25+
'fluid' => '',
26+
),
27+
'conflicts' => array(
28+
),
29+
'suggests' => array(
30+
),
31+
),
32+
);
33+
34+
?>

ext_icon.gif

177 Bytes
Loading

ext_localconf.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
if (!defined ('TYPO3_MODE')) die ('Access denied.');
3+
4+
if (TYPO3_MODE === 'BE') {
5+
// register setup command
6+
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = 'Tx_Coreapi_Controller_ApiCommandController';
7+
}
8+
9+
?>

0 commit comments

Comments
 (0)