當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。