Skip to content

Commit

Permalink
[UPDATE] Use GeneralUtility::makeInstance instead of TYPO3\CMS\Extbas…
Browse files Browse the repository at this point in the history
…e\Object\ObjectManager
  • Loading branch information
manuelselbach committed Sep 12, 2023
1 parent 17bf653 commit 12aa584
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions class.ext_update.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

declare(strict_types=1);

namespace Mselbach\StaticInfoTablesFr;

/***************************************************************
Expand All @@ -24,12 +27,10 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

use Mselbach\StaticInfoTablesFr\Extension;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use SJBR\StaticInfoTables\Cache\ClassCacheManager;
use SJBR\StaticInfoTables\Utility\DatabaseUpdateUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;

/**
* Class for updating the db
Expand All @@ -44,20 +45,19 @@ class ext_update
public function main()
{
$content = '';
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);

// Clear the class cache
/** @var ClassCacheManager $classCacheManager */
$classCacheManager = $objectManager->get(ClassCacheManager::class);
$classCacheManager = GeneralUtility::makeInstance(ClassCacheManager::class);
$classCacheManager->reBuild();

// Update the database
/** @var DatabaseUpdateUtility $databaseUpdateUtility */
$databaseUpdateUtility = $objectManager->get(DatabaseUpdateUtility::class);
$databaseUpdateUtility = GeneralUtility::makeInstance(DatabaseUpdateUtility::class);
$databaseUpdateUtility->doUpdate(Extension::EXTENSION_KEY);

$updateLanguageLabels = LocalizationUtility::translate('updateLanguageLabels', 'StaticInfoTables');
return '<p>' . $updateLanguageLabels . ' '. Extension::EXTENSION_KEY . '</p>';
return '<p>' . $updateLanguageLabels . ' ' . Extension::EXTENSION_KEY . '</p>';
}

/**
Expand Down

0 comments on commit 12aa584

Please sign in to comment.