Completed
Push — master ( ac2321...c5f521 )
by Tim
15:25
created

ext_update::main()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 15
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
1
<?php
2
3
use SJBR\StaticInfoTables\Cache\ClassCacheManager;
4
use SJBR\StaticInfoTables\Utility\DatabaseUpdateUtility;
5
6
class ext_update {
7
8
	/**
9
	 * Main function, returning the HTML content
10
	 *
11
	 * @return string HTML
12
	 */
13
	function main() {
14
		$content = '';
15
		$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
16
17
		/** @var ClassCacheManager $classCacheManager */
18
		$classCacheManager = $objectManager->get('SJBR\\StaticInfoTables\\Cache\\ClassCacheManager');
19
		$classCacheManager->reBuild();
20
21
		/** @var DatabaseUpdateUtility $databaseUpdateUtility */
22
		$databaseUpdateUtility = $objectManager->get('SJBR\\StaticInfoTables\\Utility\\DatabaseUpdateUtility');
23
		$databaseUpdateUtility->doUpdate('static_info_tables_zh');
24
25
		$content .= '<p>' . \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('updateLanguageLabels', 'StaticInfoTables') . ' static_info_tables_zh.</p>';
26
		return $content;
27
	}
28
29
	function access() {
30
		return TRUE;
31
	}
32
}