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

Commit 5d53d78

Browse files
committed
Merge pull request #16 from georgringer/master
If a news is created, the field cruser_id should be filled with the uid of the cli user.
2 parents 843eb73 + c541fc9 commit 5d53d78

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

Classes/Command/ExtensionApiCommandController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ public function listInstalledCommand($type = '') {
113113
$description = wordwrap($description, self::MAXIMUM_LINE_LENGTH - 43, PHP_EOL . str_repeat(' ', 43), TRUE);
114114
$this->outputLine('%-2s%-40s %s', array(' ', $title, $description));
115115
}
116+
117+
$this->outputLine('%-2s%-40s', array(' ', str_repeat('-', self::MAXIMUM_LINE_LENGTH - 3)));
118+
$this->outputLine(' Total: ' . count($extensions) . ' extensions');
116119
}
117120

118121
/**

Classes/Service/SiteApiService.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function getSiteInfo() {
4343

4444
$this->getDiskUsage($data);
4545
$this->getDatabaseInformation($data);
46+
$this->getCountOfExtensions($data);
4647

4748
return $data;
4849
}
@@ -64,6 +65,7 @@ public function createSysNews($header, $text) {
6465
'content' => $text,
6566
'tstamp' => $GLOBALS['EXEC_TIME'],
6667
'crdate' => $GLOBALS['EXEC_TIME'],
68+
'cruser_id' => $GLOBALS['BE_USER']->user['uid']
6769
));
6870
}
6971

@@ -95,6 +97,19 @@ protected function getDatabaseInformation(&$data) {
9597
$data['Database size'] = $value;
9698
}
9799

100+
/**
101+
* Get count of local installed extensions
102+
*
103+
* @param array $data
104+
* @return void
105+
*/
106+
protected function getCountOfExtensions(&$data) {
107+
/** @var Tx_Coreapi_Service_ExtensionApiService $extensionService */
108+
$extensionService = t3lib_div::makeInstance('Tx_Coreapi_Service_ExtensionApiService');
109+
$extensions = $extensionService->getInstalledExtensions('L');
110+
$data['Count local installed extensions'] = count($extensions);
111+
}
112+
98113
}
99114

100115
?>

ext_autoload.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
'tx_coreapi_command_siteapicommandcontroller' => $extensionClassesPath . 'Command/SiteApiCommandController.php',
1010
'tx_coreapi_command_cacheapicommandcontroller' => $extensionClassesPath . 'Command/CacheApiCommandController.php',
1111
'tx_coreapi_service_cacheapiservice' => $extensionClassesPath . 'Service/CacheApiService.php',
12+
'tx_coreapi_service_siteapiservice' => $extensionClassesPath . 'Service/SiteApiService.php',
1213
'tx_coreapi_service_databaseapiservice' => $extensionClassesPath . 'Service/DatabaseApiService.php',
1314
'tx_coreapi_service_extensionapiservice' => $extensionClassesPath . 'Service/ExtensionApiService.php',
1415
);

0 commit comments

Comments
 (0)