本文整理汇总了PHP中TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtension方法的典型用法代码示例。如果您正苦于以下问题:PHP ExtensionManagementUtility::loadExtension方法的具体用法?PHP ExtensionManagementUtility::loadExtension怎么用?PHP ExtensionManagementUtility::loadExtension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\ExtensionManagementUtility
的用法示例。
在下文中一共展示了ExtensionManagementUtility::loadExtension方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: performUpdate
/**
* performs the action of the UpdateManager
*
* @param array &$dbQueries: queries done in this update
* @param mixed &$customMessages: custom messages
* @return bool whether everything went smoothly or not
*/
public function performUpdate(array &$dbQueries, &$customMessages)
{
if ($this->versionNumber >= 4004000 && !\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('statictemplates')) {
// check wether the table can be truncated or if sysext with tca has to be installed
if ($this->checkForUpdate($customMessages[])) {
try {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtension('statictemplates');
$customMessages[] = 'System Extension "statictemplates" was successfully loaded, static templates are now supported.';
$result = TRUE;
} catch (\RuntimeException $e) {
$result = FALSE;
}
return $result;
}
return TRUE;
}
}
示例2: loadExtensionThrowsExceptionIfExtensionIsLoaded
/**
* @test
* @expectedException \RuntimeException
*/
public function loadExtensionThrowsExceptionIfExtensionIsLoaded()
{
$extensionKey = $this->getUniqueId('test');
$packageManager = $this->createMockPackageManagerWithMockPackage($extensionKey);
ExtensionManagementUtility::setPackageManager($packageManager);
ExtensionManagementUtility::loadExtension($extensionKey);
}
示例3: executeLoadDbalExtension
/**
* Adds dbal and adodb to list of loaded extensions
*
* @return \TYPO3\CMS\Install\Status\StatusInterface
*/
protected function executeLoadDbalExtension()
{
if (!ExtensionManagementUtility::isLoaded('adodb')) {
ExtensionManagementUtility::loadExtension('adodb');
}
if (!ExtensionManagementUtility::isLoaded('dbal')) {
ExtensionManagementUtility::loadExtension('dbal');
}
/** @var $errorStatus \TYPO3\CMS\Install\Status\WarningStatus */
$warningStatus = $this->objectManager->get(\TYPO3\CMS\Install\Status\WarningStatus::class);
$warningStatus->setTitle('Loaded database abstraction layer');
return $warningStatus;
}
示例4: activateSaltedPasswords
/**
* Activates saltedpasswords.
*
* @return void
*/
protected function activateSaltedPasswords()
{
if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('rsaauth')) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtension('rsaauth');
}
if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('saltedpasswords')) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtension('saltedpasswords');
}
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager')->setLocalConfigurationValueByPath('EXT/extConf/saltedpasswords', 'a:2:{s:3:"FE.";a:2:{s:7:"enabled";s:1:"1";s:21:"saltedPWHashingMethod";s:28:"tx_saltedpasswords_salts_md5";}s:3:"BE.";a:2:{s:7:"enabled";s:1:"1";s:21:"saltedPWHashingMethod";s:28:"tx_saltedpasswords_salts_md5";}}');
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager')->setLocalConfigurationValueByPath('BE/loginSecurityLevel', 'rsa');
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager')->setLocalConfigurationValueByPath('FE/loginSecurityLevel', 'rsa');
}
示例5: loadExtension
/**
* Wrapper function for loading extensions
*
* @param string $extensionKey
* @return void
*/
protected function loadExtension($extensionKey)
{
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtension($extensionKey);
}