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


PHP ExtensionManagementUtility::setPackageManager方法代码示例

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


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

示例1: extensionStaticsAreProcessedIfExplicitlyRequested

 /**
  * @test
  */
 public function extensionStaticsAreProcessedIfExplicitlyRequested()
 {
     $identifier = $this->getUniqueId('test');
     $GLOBALS['TYPO3_LOADED_EXT'] = array($identifier => array('ext_typoscript_setup.txt' => ExtensionManagementUtility::extPath('core', 'Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.txt'), 'ext_typoscript_constants.txt' => ''));
     $mockPackage = $this->getMock(\TYPO3\CMS\Core\Package\Package::class, array('getPackagePath'), array(), '', false);
     $mockPackage->expects($this->any())->method('getPackagePath')->will($this->returnValue(''));
     $mockPackageManager = $this->getMock(\TYPO3\CMS\Core\Package\PackageManager::class, array('isPackageActive', 'getPackage'));
     $mockPackageManager->expects($this->any())->method('isPackageActive')->will($this->returnValue(true));
     $mockPackageManager->expects($this->any())->method('getPackage')->will($this->returnValue($mockPackage));
     ExtensionManagementUtility::setPackageManager($mockPackageManager);
     $this->templateService->setProcessExtensionStatics(true);
     $this->templateService->runThroughTemplates(array(), 0);
     $this->assertTrue(in_array('test.Core.TypoScript = 1', $this->templateService->config));
     ExtensionManagementUtility::setPackageManager(GeneralUtility::makeInstance(\TYPO3\CMS\Core\Package\PackageManager::class));
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:18,代码来源:TemplateServiceTest.php

示例2: configureBackendLoginSecurity

 /**
  * @test
  * @dataProvider configureBackendLoginSecurityLocalconfiguration
  * @param string $current
  * @param string $setting
  * @param bool $isPackageActive
  * @param bool $hasLocalConfig
  */
 public function configureBackendLoginSecurity($current, $setting, $isPackageActive, $hasLocalConfig)
 {
     /** @var $silentConfigurationUpgradeServiceInstance SilentConfigurationUpgradeService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
     $silentConfigurationUpgradeServiceInstance = $this->getAccessibleMock(SilentConfigurationUpgradeService::class, array('dummy'), array(), '', false);
     /** @var $packageManager PackageManager|\PHPUnit_Framework_MockObject_MockObject */
     $packageManager = $this->getMock(PackageManager::class, array(), array(), '', false);
     $packageManager->expects($this->any())->method('isPackageActive')->will($this->returnValue($isPackageActive));
     ExtensionManagementUtility::setPackageManager($packageManager);
     $currentLocalConfiguration = array(array('BE/loginSecurityLevel', $current));
     $closure = function () {
         throw new \RuntimeException('Path does not exist in array', 1341397869);
     };
     $this->createConfigurationManagerWithMockedMethods(array('getLocalConfigurationValueByPath', 'setLocalConfigurationValueByPath'));
     if ($hasLocalConfig) {
         $this->configurationManager->expects($this->once())->method('getLocalConfigurationValueByPath')->will($this->returnValueMap($currentLocalConfiguration));
     } else {
         $this->configurationManager->expects($this->once())->method('getLocalConfigurationValueByPath')->will($this->returnCallback($closure));
     }
     $this->configurationManager->expects($this->once())->method('setLocalConfigurationValueByPath')->with($this->equalTo('BE/loginSecurityLevel'), $this->equalTo($setting));
     $this->setExpectedException(RedirectException::class);
     $silentConfigurationUpgradeServiceInstance->_set('configurationManager', $this->configurationManager);
     $silentConfigurationUpgradeServiceInstance->_call('configureBackendLoginSecurity');
 }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:31,代码来源:SilentConfigurationUpgradeServiceTest.php

示例3: initializePackageManagement

 /**
  * Initializes the package system and loads the package configuration and settings
  * provided by the packages.
  *
  * @param string $packageManagerClassName Define an alternative package manager implementation (usually for the installer)
  * @return Bootstrap
  * @internal This is not a public API method, do not use in own extensions
  */
 public function initializePackageManagement($packageManagerClassName)
 {
     /** @var \TYPO3\CMS\Core\Package\PackageManager $packageManager */
     $packageManager = new $packageManagerClassName();
     $this->setEarlyInstance(\TYPO3\CMS\Core\Package\PackageManager::class, $packageManager);
     ExtensionManagementUtility::setPackageManager($packageManager);
     $packageManager->injectCoreCache($this->getEarlyInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('cache_core'));
     $dependencyResolver = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Package\DependencyResolver::class);
     $dependencyResolver->injectDependencyOrderingService(GeneralUtility::makeInstance(\TYPO3\CMS\Core\Service\DependencyOrderingService::class));
     $packageManager->injectDependencyResolver($dependencyResolver);
     $packageManager->initialize();
     GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Package\PackageManager::class, $packageManager);
     return $this;
 }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:22,代码来源:Bootstrap.php

示例4: 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

示例5: tryToLoadExtLocalconfAndExtTablesOfExtensionsCallsWriteCurrentExtensionToFile

 /**
  * @test
  */
 public function tryToLoadExtLocalconfAndExtTablesOfExtensionsCallsWriteCurrentExtensionToFile()
 {
     // tryToLoadExtLocalconfAndExtTablesOfExtensions() triggers a call to ExtensionManagementUtility::loadBaseTca
     // that works on our UnitTestPackageManager to do things. This package manager needs to be mocked here to
     // not trigger unwanted side effects.
     $packageManager = $this->getMock(\TYPO3\CMS\Core\Package\PackageManager::class, array(), array(), '', false);
     $packageManager->expects($this->any())->method('getActivePackages')->will($this->returnValue(array()));
     ExtensionManagementUtility::setPackageManager($packageManager);
     $extension = array('demo1' => array('type' => 'L', 'ext_tables.php' => PATH_typo3 . 'sysext/install/Tests/Unit/Controller/Action/Ajax/Fixtures/demo1/ext_tables.php'));
     $extensionCompatibilityTesterMock = $this->getAccessibleMock(\TYPO3\CMS\Install\Controller\Action\Ajax\ExtensionCompatibilityTester::class, array('loadExtLocalconfForExtension', 'writeCurrentExtensionToFile', 'loadExtTablesForExtension', 'removeCurrentExtensionFromFile'), array());
     $extensionCompatibilityTesterMock->expects($this->atLeastOnce())->method('writeCurrentExtensionToFile')->with('demo1');
     $extensionCompatibilityTesterMock->_call('tryToLoadExtLocalconfAndExtTablesOfExtensions', $extension);
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:16,代码来源:ExtensionCompatibilityTesterTest.php

示例6: 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

示例7: initializePackageManagement

 /**
  * Initializes the package system and loads the package configuration and settings
  * provided by the packages.
  *
  * @param string $packageManagerClassName Define an alternative package manager implementation (usually for the installer)
  * @return void
  */
 public function initializePackageManagement($packageManagerClassName = 'Helhum\\Typo3Console\\Package\\UncachedPackageManager')
 {
     require __DIR__ . '/../Package/UncachedPackageManager.php';
     $packageManager = new \Helhum\Typo3Console\Package\UncachedPackageManager();
     $this->setEarlyInstance($this->packageManagerInstanceName, $packageManager);
     Utility\ExtensionManagementUtility::setPackageManager($packageManager);
     // @deprecated in 6.2, will be removed in 7.0
     if (is_callable(array($packageManager, 'injectClassLoader'))) {
         $packageManager->injectClassLoader($this->getEarlyInstance('TYPO3\\CMS\\Core\\Core\\ClassLoader'));
     }
     $dependencyResolver = Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Package\\DependencyResolver');
     // required since 7.4
     if (is_callable(array($dependencyResolver, 'injectDependencyOrderingService'))) {
         $dependencyResolver->injectDependencyOrderingService(Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Service\\DependencyOrderingService'));
     }
     $packageManager->injectDependencyResolver($dependencyResolver);
     $packageManager->initialize($this);
     Utility\GeneralUtility::setSingletonInstance('TYPO3\\CMS\\Core\\Package\\PackageManager', $packageManager);
 }
开发者ID:kraftb,项目名称:typo3_console,代码行数:26,代码来源:ConsoleBootstrap.php

示例8: tearDown

 public function tearDown()
 {
     ExtensionManagementUtility::setPackageManager(new PackageManager());
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:4,代码来源:ContentTypesToTextMediaUpdateTest.php

示例9: initializePackageManagement

 /**
  * Initializes the package system and loads the package configuration and settings
  * provided by the packages.
  *
  * @param string $packageManagerClassName Define an alternative package manager implementation (usually for the installer)
  * @return Bootstrap
  * @internal This is not a public API method, do not use in own extensions
  */
 public function initializePackageManagement($packageManagerClassName)
 {
     /** @var \TYPO3\CMS\Core\Package\PackageManager $packageManager */
     $packageManager = new $packageManagerClassName();
     $this->setEarlyInstance('TYPO3\\Flow\\Package\\PackageManager', $packageManager);
     Utility\ExtensionManagementUtility::setPackageManager($packageManager);
     $packageManager->injectClassLoader($this->getEarlyInstance('TYPO3\\CMS\\Core\\Core\\ClassLoader'));
     $packageManager->injectCoreCache($this->getEarlyInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->getCache('cache_core'));
     $packageManager->injectDependencyResolver(Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Package\\DependencyResolver'));
     $packageManager->initialize($this);
     Utility\GeneralUtility::setSingletonInstance('TYPO3\\CMS\\Core\\Package\\PackageManager', $packageManager);
     return $this;
 }
开发者ID:samuweiss,项目名称:TYPO3-Site,代码行数:21,代码来源:Bootstrap.php

示例10: initializePackageManagement

 /**
  * Initializes the package system and loads the package configuration and settings
  * provided by the packages.
  *
  * @param string $packageManagerClassName Define an alternative package manager implementation (usually for the installer)
  * @return void
  */
 public function initializePackageManagement($packageManagerClassName = 'Helhum\\Typo3Console\\Package\\UncachedPackageManager')
 {
     require __DIR__ . '/../Package/UncachedPackageManager.php';
     $packageManager = new \Helhum\Typo3Console\Package\UncachedPackageManager();
     $this->setEarlyInstance('TYPO3\\Flow\\Package\\PackageManager', $packageManager);
     Utility\ExtensionManagementUtility::setPackageManager($packageManager);
     $packageManager->injectClassLoader($this->getEarlyInstance('TYPO3\\CMS\\Core\\Core\\ClassLoader'));
     $packageManager->injectDependencyResolver(Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Package\\DependencyResolver'));
     $packageManager->initialize($this);
     Utility\GeneralUtility::setSingletonInstance('TYPO3\\CMS\\Core\\Package\\PackageManager', $packageManager);
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:18,代码来源:ConsoleBootstrap.php


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