-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
class.ext_update.php
42 lines (34 loc) · 1.47 KB
/
class.ext_update.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
declare(strict_types=1);
/*
* This file is part of the "Static Info Tables (CS)" extension for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* Max Rösch <[email protected]>, Leuchtfeuer Digital Marketing
*/
namespace Bitmotion\StaticInfoTablesCs;
use SJBR\StaticInfoTables\Cache\ClassCacheManager;
use SJBR\StaticInfoTables\Utility\DatabaseUpdateUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
class ext_update
{
public function main(): string
{
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
// Clear the class cache and update the database
$objectManager->get(ClassCacheManager::class)->reBuild();
$objectManager->get(DatabaseUpdateUtility::class)->doUpdate(Extension::EXTENSION_KEY);
return sprintf(
'<div class="callout callout-info"><div class="media"><div class="media-left"><span class="fa-stack fa-lg callout-icon"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-info fa-stack-1x"></i></span></div><div class="media-body"><div class="callout-body"><p>%s</p></div></div></div></div>',
LocalizationUtility::translate('updateLanguageLabels', 'StaticInfoTables', [Extension::EXTENSION_KEY])
);
}
public function access(): bool
{
return true;
}
}