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


PHP ConfigurationManagerInterface::setConfiguration方法代码示例

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


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

示例1: initializeAction

 /**
  * Action initializer
  *
  * @return void
  */
 protected function initializeAction()
 {
     $pageId = (int) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');
     $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
     $persistenceConfiguration = ['persistence' => ['storagePid' => $pageId]];
     $this->configurationManager->setConfiguration(array_merge($frameworkConfiguration, $persistenceConfiguration));
 }
开发者ID:extcode,项目名称:cart,代码行数:12,代码来源:BeVariantSetController.php

示例2: build

 /**
  * Builds a CLI request object from a command line.
  *
  * The given command line may be a string (e.g. "myextension:foo do-that-thing --force") or
  * an array consisting of the individual parts. The array must not include the script
  * name (like in $argv) but start with command right away.
  *
  * @param mixed $commandLine The command line, either as a string or as an array
  * @param string $callingScript The calling script (usually ./typo3/cli_dispatch.phpsh)
  * @return \TYPO3\CMS\Extbase\Mvc\Cli\Request The CLI request as an object
  */
 public function build($commandLine = '', $callingScript = './typo3/cli_dispatch.phpsh extbase')
 {
     $request = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Cli\Request::class);
     $request->setCallingScript($callingScript);
     $request->setControllerObjectName(\TYPO3\CMS\Extbase\Command\HelpCommandController::class);
     $rawCommandLineArguments = is_array($commandLine) ? $commandLine : explode(' ', $commandLine);
     if (empty($rawCommandLineArguments)) {
         $request->setControllerCommandName('helpStub');
         return $request;
     }
     $commandIdentifier = trim(array_shift($rawCommandLineArguments));
     try {
         $command = $this->commandManager->getCommandByIdentifier($commandIdentifier);
         $this->configurationManager->setConfiguration(array('extensionName' => $command->getExtensionName()));
     } catch (\TYPO3\CMS\Extbase\Mvc\Exception\CommandException $exception) {
         $request->setArgument('exception', $exception);
         $request->setControllerCommandName('error');
         return $request;
     }
     $controllerObjectName = $command->getControllerClassName();
     $controllerCommandName = $command->getControllerCommandName();
     $request->setControllerObjectName($controllerObjectName);
     $request->setControllerCommandName($controllerCommandName);
     list($commandLineArguments, $exceedingCommandLineArguments) = $this->parseRawCommandLineArguments($rawCommandLineArguments, $controllerObjectName, $controllerCommandName);
     $request->setArguments($commandLineArguments);
     $request->setExceedingArguments($exceedingCommandLineArguments);
     return $request;
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:39,代码来源:RequestBuilder.php

示例3: initialize

 /**
  * Initializes configuration manager, object container and reflection service
  *
  * @param array $configuration
  * @return void
  */
 protected function initialize(array $configuration)
 {
     // initialize unconsumed Request and Response
     $this->request = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\Request');
     $this->response = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Cli\\Response');
     // initialize configuration
     $this->configurationManager->setContentObject(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer'));
     $this->configurationManager->setConfiguration($configuration);
     // configure object container
     $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
     if (isset($frameworkConfiguration['objects'])) {
         $objectContainer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\Container\\Container');
         foreach ($frameworkConfiguration['objects'] as $classNameWithDot => $classConfiguration) {
             if (isset($classConfiguration['className'])) {
                 $originalClassName = rtrim($classNameWithDot, '.');
                 $objectContainer->registerImplementation($originalClassName, $classConfiguration['className']);
             }
         }
     }
     // initialize reflection
     $reflectionService = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
     $reflectionService->setDataCache(\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->getCache('extbase_reflection'));
     if (!$reflectionService->isInitialized()) {
         $reflectionService->initialize();
     }
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:32,代码来源:TaskExecutor.php

示例4: initializeConfiguration

 /**
  * Initializes the Object framework.
  *
  * @param array $configuration
  * @return void
  * @see initialize()
  */
 public function initializeConfiguration($configuration)
 {
     $this->configurationManager = $this->objectManager->get(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::class);
     /** @var \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObject */
     $contentObject = isset($this->cObj) ? $this->cObj : \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class);
     $this->configurationManager->setContentObject($contentObject);
     $this->configurationManager->setConfiguration($configuration);
 }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:15,代码来源:Bootstrap.php

示例5: initializeAction

 /**
  * Action initializer
  *
  * @return void
  */
 protected function initializeAction()
 {
     # $this->pageId = (int)t3lib_div::_GP('id');
     $this->pageId = (int) $GLOBALS['TSFE']->id;
     $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
     $persistenceConfiguration = array('persistence' => array('storagePid' => $this->pageId));
     $this->configurationManager->setConfiguration(array_merge($frameworkConfiguration, $persistenceConfiguration));
     #debug($this->request->getArguments());
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:14,代码来源:TradeShowController.php

示例6: initializeAction

 protected function initializeAction()
 {
     if ($GLOBALS['TSFE'] === NULL) {
         $this->pageId = (int) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');
     } else {
         $this->pageId = $GLOBALS['TSFE']->id;
     }
     $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
     $persistenceConfiguration = array('persistence' => array('storagePid' => $this->pageId));
     $this->configurationManager->setConfiguration(array_merge($frameworkConfiguration, $persistenceConfiguration));
     $this->piVars = $this->request->getArguments();
 }
开发者ID:tritumRz,项目名称:contacts,代码行数:12,代码来源:CompanyController.php

示例7: initialize

 /**
  * A function for injecting dependencies. Should be called first
  * thing within the overridden 'execute' method.
  *
  * @param $extensionName
  * @param $pluginName
  */
 protected function initialize($extensionName, $pluginName)
 {
     $injectionService = GeneralUtility::makeInstance('CIC\\Cicbase\\Service\\InjectionService');
     $injectionService->doInjection($this);
     // Grab the settings array
     $this->configurationManager->setConfiguration(array('extensionName' => $extensionName, 'pluginName' => $pluginName));
     $this->settings = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS);
     if (!$this->settings) {
         $configuration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
         $settings = $configuration['plugin.']['tx_' . strtolower($extensionName) . '.']['settings.'];
         $this->settings = $this->typoscriptService->convertTypoScriptArrayToPlainArray($settings);
     }
 }
开发者ID:electricretina,项目名称:cicbase,代码行数:20,代码来源:AbstractTask.php

示例8: setPageUid

 /**
  * Set storage pid in BE
  *
  * Only needed when the class is called or injected in a BE context, e.g. a hook.
  * Without the generation of the TS is based upon the next root page (default
  * extbase behaviour) and repositories won't work as expected.
  *
  * @param $pageUid
  *
  * @return void
  */
 public function setPageUid($pageUid)
 {
     if (TYPO3_MODE === 'BE') {
         $currentPid['persistence']['storagePid'] = (int) $pageUid;
         $this->configurationManager->setConfiguration(array_merge($this->getFrameworkSettings(), $currentPid));
         GeneralUtility::_GETset((int) $pageUid, 'id');
     }
 }
开发者ID:dextar1,项目名称:t3extblog,代码行数:19,代码来源:SettingsService.php

示例9: checkStoragePid

 /**
  * Checks if the startingpoint via flexform is set and overrides the storagePid
  * if nothing is set, even the storagePid, it uses the current page as storagePid
  *
  * @return void
  */
 protected function checkStoragePid()
 {
     $extName = $this->request->getControllerExtensionName();
     $pluginName = $this->request->getPluginName();
     $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, $extName, $pluginName);
     // Override the storagePid
     if (!empty($this->settings['startingpoint'])) {
         $frameworkConfiguration['persistence']['storagePid'] = $this->settings['startingpoint'];
         $this->configurationManager->setConfiguration($frameworkConfiguration);
     } elseif (empty($frameworkConfiguration['persistence']['storagePid'])) {
         $frameworkConfiguration['persistence']['storagePid'] = $GLOBALS['TSFE']->id;
         $this->configurationManager->setConfiguration($frameworkConfiguration);
     }
 }
开发者ID:Tricept,项目名称:nn_address,代码行数:20,代码来源:ActionController.php

示例10: initializeExtbaseFramework

 /**
  * @return void
  */
 protected function initializeExtbaseFramework()
 {
     // initialize cache manager
     $this->cacheManager = $GLOBALS['typo3CacheManager'];
     // inject content object into the configuration manager
     $this->configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
     $contentObject = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
     $this->configurationManager->setContentObject($contentObject);
     $this->typoScriptService->makeTypoScriptBackup();
     // load extbase typoscript
     TypoScriptService::loadTypoScriptFromFile('EXT:extbase/ext_typoscript_setup.txt');
     TypoScriptService::loadTypoScriptFromFile('EXT:ap_ldap_auth/ext_typoscript_setup.txt');
     $this->configurationManager->setConfiguration($GLOBALS['TSFE']->tmpl->setup);
     $this->configureObjectManager();
     // initialize reflection
     $this->reflectionService = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
     $this->reflectionService->setDataCache($this->cacheManager->getCache('extbase_reflection'));
     if (!$this->reflectionService->isInitialized()) {
         $this->reflectionService->initialize();
     }
     // initialize persistence
     $this->persistenceManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager');
 }
开发者ID:LiaraAlis,项目名称:typo3-ap_ldap_auth,代码行数:26,代码来源:AbstractAuthenticationService.php


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