문제

I am trying to create an instance of 't3lib_install' And if my investigation is correct , t3lib_install is removed from typo3 core.

So can any one of you guys please help me to find out the replacement for this class .

    $instObj = t3lib_div::makeInstance('t3lib_install');
    $instObj->allowUpdateLocalConf = 1;
    $instObj->updateIdentity = 'xxxxxx';
    // Get lines from localconf file
    $lines = $instObj->writeToLocalconf_control();
    $instObj->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'EXT\'][\'extConf\'][\'xxxxxx\']', 
    serialize($LocalconfValues));
    $instObj->writeToLocalconf_control($lines);
도움이 되었습니까?

해결책

Thanks for the tip .

$this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
$instObj = $this->objectManager->get('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
$lines = $instObj->getLocalConfigurationFileLocation();
// Get lines from Localconfiguration.php file
$localConfigurationArray = require $lines;
$instObj->removeLocalConfigurationKeysByPath( array( 'EXT/extConf/extension_key' ) ) ;
$instObj->setLocalConfigurationValueByPath( 'EXT/extConf/extension_key' ,      serialize($LocalconfValues) );

By this way we can overwrite values stored in Localconfiguration.php

다른 팁

The install tool was rewritten so there is no identical class with another name.

I think what you're looking for is TYPO3\CMS\Core\Configuration\ConfigurationManager which allows you to modify the local configuration:

https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Configuration/ConfigurationManager.php

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top