当前位置: 首页>>代码示例>>PHP>>正文


PHP ExtensionManagementUtility::unloadExtension方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Core\Utility\ExtensionManagementUtility::unloadExtension方法的典型用法代码示例。如果您正苦于以下问题:PHP ExtensionManagementUtility::unloadExtension方法的具体用法?PHP ExtensionManagementUtility::unloadExtension怎么用?PHP ExtensionManagementUtility::unloadExtension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Core\Utility\ExtensionManagementUtility的用法示例。


在下文中一共展示了ExtensionManagementUtility::unloadExtension方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: executeAction

 /**
  * Uninstall one or multiple extensions
  * Extension keys are read from get vars, more than one extension has to be comma separated
  * Cache is cleared "hard" after uninstalling
  *
  * @return string "OK"
  */
 protected function executeAction()
 {
     $getVars = Utility\GeneralUtility::_GET('install');
     if (isset($getVars['uninstallExtension']) && isset($getVars['uninstallExtension']['extensions'])) {
         $extensionsToUninstall = Utility\GeneralUtility::trimExplode(',', $getVars['uninstallExtension']['extensions']);
         foreach ($extensionsToUninstall as $extension) {
             if (Utility\ExtensionManagementUtility::isLoaded($extension)) {
                 Utility\ExtensionManagementUtility::unloadExtension($extension);
             }
         }
     }
     return 'OK';
 }
开发者ID:Mr-Robota,项目名称:TYPO3.CMS,代码行数:20,代码来源:UninstallExtension.php

示例2: executeAction

 /**
  * Uninstall one or multiple extensions
  * Extension keys are read from get vars, more than one extension has to be comma separated
  *
  * @return string "OK" on success, the error message otherwise
  */
 protected function executeAction()
 {
     $getVars = GeneralUtility::_GET('install');
     if (isset($getVars['uninstallExtension']) && isset($getVars['uninstallExtension']['extensions'])) {
         $extensionsToUninstall = GeneralUtility::trimExplode(',', $getVars['uninstallExtension']['extensions']);
         foreach ($extensionsToUninstall as $extension) {
             if (ExtensionManagementUtility::isLoaded($extension)) {
                 try {
                     ExtensionManagementUtility::unloadExtension($extension);
                 } catch (\Exception $e) {
                     return $e->getMessage();
                 }
             }
         }
     }
     return 'OK';
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:23,代码来源:UninstallExtension.php

示例3: unloadExtensionCallsPackageManagerToDeactivatePackage

 /**
  * @test
  */
 public function unloadExtensionCallsPackageManagerToDeactivatePackage()
 {
     $packageName = $this->getUniqueId('foo');
     /** @var PackageManager|\PHPUnit_Framework_MockObject_MockObject $packageManager */
     $packageManager = $this->getMock(PackageManager::class, array('isPackageActive', 'deactivatePackage'));
     $packageManager->expects($this->any())->method('isPackageActive')->will($this->returnValue(TRUE));
     $packageManager->expects($this->once())->method('deactivatePackage')->with($packageName);
     ExtensionManagementUtility::setPackageManager($packageManager);
     ExtensionManagementUtility::unloadExtension($packageName);
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:13,代码来源:ExtensionManagementUtilityTest.php

示例4: unloadExtensionCallsPackageManagerToDeactivatePackage

 /**
  * @test
  */
 public function unloadExtensionCallsPackageManagerToDeactivatePackage()
 {
     $packageName = $this->getUniqueId('foo');
     $packageManager = $this->getMock('TYPO3\\CMS\\Core\\Package\\PackageManager', array('isPackageActive', 'deactivatePackage'));
     $packageManager->expects($this->any())->method('isPackageActive')->will($this->returnValue(TRUE));
     $packageManager->expects($this->once())->method('deactivatePackage')->with($packageName);
     ExtensionManagementUtility::setPackageManager($packageManager);
     ExtensionManagementUtility::unloadExtension($packageName);
 }
开发者ID:KarlDennisMatthaei1923,项目名称:PierraaDesign,代码行数:12,代码来源:ExtensionManagementUtilityTest.php

示例5: executeUnloadDbalExtension

 /**
  * Remove dbal and adodb from list of loaded extensions
  *
  * @return \TYPO3\CMS\Install\Status\StatusInterface
  */
 protected function executeUnloadDbalExtension()
 {
     if (ExtensionManagementUtility::isLoaded('adodb')) {
         ExtensionManagementUtility::unloadExtension('adodb');
     }
     if (ExtensionManagementUtility::isLoaded('dbal')) {
         ExtensionManagementUtility::unloadExtension('dbal');
     }
     // @TODO: Remove configuration from TYPO3_CONF_VARS['EXTCONF']['dbal']
     /** @var $errorStatus \TYPO3\CMS\Install\Status\WarningStatus */
     $warningStatus = $this->objectManager->get(\TYPO3\CMS\Install\Status\WarningStatus::class);
     $warningStatus->setTitle('Removed database abstraction layer');
     return $warningStatus;
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:19,代码来源:DatabaseConnect.php

示例6: prepareExtensionForImport

 /**
  * Prepares an extension for import from TER
  * Uninstalls the extension if it is already loaded (case: update)
  * and reloads the caches.
  *
  * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
  * @return void
  */
 protected function prepareExtensionForImport(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension)
 {
     if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extension->getExtensionKey())) {
         \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::unloadExtension($extension->getExtensionKey());
         $this->installUtility->reloadCaches();
     }
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:15,代码来源:DownloadController.php

示例7: unloadExtension

 /**
  * Wrapper function for unloading extensions
  *
  * @param string $extensionKey
  * @return void
  */
 protected function unloadExtension($extensionKey)
 {
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::unloadExtension($extensionKey);
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:10,代码来源:InstallUtility.php


注:本文中的TYPO3\CMS\Core\Utility\ExtensionManagementUtility::unloadExtension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。