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


PHP ConfigurationManager::injectEnvironment方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     $package1 = $this->getMock('TYPO3\\Flow\\Package\\PackageInterface');
     $package1->expects($this->any())->method('getPackageKey')->will($this->returnValue('Foo.Package1'));
     $package1->expects($this->any())->method('getConfigurationPath')->will($this->returnValue(__DIR__ . '/../Fixture/Roles/Foo.Package1/'));
     $package2 = $this->getMock('TYPO3\\Flow\\Package\\PackageInterface');
     $package2->expects($this->any())->method('getPackageKey')->will($this->returnValue('Package2'));
     $package2->expects($this->any())->method('getConfigurationPath')->will($this->returnValue(__DIR__ . '/../Fixture/Roles/Package2/'));
     $this->configurationManager = new \TYPO3\Flow\Configuration\ConfigurationManager(new \TYPO3\Flow\Core\ApplicationContext('Testing'));
     $this->configurationManager->setPackages(array($package1->getPackageKey() => $package1, $package2->getPackageKey() => $package2));
     $this->configurationManager->injectConfigurationSource(new \TYPO3\Flow\Configuration\Source\YamlSource());
     $mockEnvironment = $this->getMock('TYPO3\\Flow\\Utility\\Environment', array(), array(), '', FALSE);
     $this->configurationManager->injectEnvironment($mockEnvironment);
     $this->policyService = $this->getAccessibleMock('TYPO3\\Flow\\Security\\Policy\\PolicyService', array('setAclsForEverybodyRole'), array(), '', FALSE);
     $this->policyService->injectConfigurationManager($this->configurationManager);
     $this->policyService->_set('policy', $this->configurationManager->getConfiguration(\TYPO3\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_POLICY));
 }
开发者ID:sokunthearith,项目名称:Intern-Project-Week-2,代码行数:17,代码来源:RoleHandlingTest.php

示例2: getCachePath

 /**
  * @param \Mrimann\CoMo\Domain\Model\Repository $repository
  * @return string path to the cache directory for this repository
  */
 protected function getCachePath(\Mrimann\CoMo\Domain\Model\Repository $repository)
 {
     $applicationContext = new \TYPO3\Flow\Core\ApplicationContext('Development');
     $environment = new \TYPO3\Flow\Utility\Environment($applicationContext);
     // Fiddle out the path to the temporary directory, depending on the Flow-Context
     $this->configurationManager->injectEnvironment($environment);
     $this->settings = $this->configurationManager->getConfiguration('Settings', 'Mrimann.CoMo');
     $environment->setTemporaryDirectoryBase($this->settings['cacheBasePath']);
     $workingBaseDirectory = $environment->getPathToTemporaryDirectory();
     // Create the working directory for this repository
     $workingDirectory = $workingBaseDirectory . 'Mrimann.CoMo/' . $repository->getIdentity();
     if (!is_dir($workingDirectory)) {
         mkdir($workingDirectory, 0777, TRUE);
     }
     return $workingDirectory;
 }
开发者ID:mrimann,项目名称:como,代码行数:20,代码来源:MetaDataExtractorCommandController.php


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