• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Config\ConfigFactoryInterface类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Drupal\Core\Config\ConfigFactoryInterface的典型用法代码示例。如果您正苦于以下问题:PHP ConfigFactoryInterface类的具体用法?PHP ConfigFactoryInterface怎么用?PHP ConfigFactoryInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: setUp

  /**
   * {@inheritdoc}
   */
  public function setUp() {
    parent::setUp();

    $this->aliasProcessor = $this->getMockBuilder('Drupal\Core\PathProcessor\PathProcessorAlias')
      ->disableOriginalConstructor()
      ->getMock();

    $this->languageManager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
    $this->languageManager->expects($this->any())
      ->method('getCurrentLanguage')
      ->willReturn(new Language(Language::$defaultValues));

    $this->pathValidator = $this->getMock('Drupal\Core\Path\PathValidatorInterface');

    $this->subPathautoSettings = $this->getMock('Drupal\Core\Config\ConfigBase');

    $this->configFactory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface');
    $this->configFactory->expects($this->any())
      ->method('get')
      ->with('subpathauto.settings')
      ->willReturn($this->subPathautoSettings);

    $this->sut = new PathProcessor($this->aliasProcessor, $this->languageManager, $this->configFactory);
    $this->sut->setPathValidator($this->pathValidator);
  }
开发者ID:eloiv,项目名称:botafoc.cat,代码行数:28,代码来源:SubPathautoTest.php


示例2: __construct

 /**
  * Constructs a 'Disqus Comment Count' view field plugin.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Session\AccountInterface $current_user
  *   The current user.
  * @param \Drupal\disqus\DisqusCommentManager $disqus_manager
  *   The disqus comment manager object.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The config factory.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, AccountInterface $current_user, DisqusCommentManager $disqus_manager, ConfigFactoryInterface $config_factory)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->currentUser = $current_user;
     $this->disqusManager = $disqus_manager;
     $this->config = $config_factory->get('disqus.settings');
 }
开发者ID:nB-MDSO,项目名称:mdso-d8blog,代码行数:23,代码来源:DisqusCommentCount.php


示例3: __construct

 /**
  * Creates a SpoolStorage object.
  *
  * @param \Drupal\Core\Database\Connection $connection
  *   The database connection.
  * @param \Drupal\Core\Lock\LockBackendInterface $lock
  *   The lock.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The config factory.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface
  *   The module handler.
  */
 public function __construct(Connection $connection, LockBackendInterface $lock, ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler)
 {
     $this->connection = $connection;
     $this->lock = $lock;
     $this->config = $config_factory->get('simplenews.settings');
     $this->moduleHandler = $module_handler;
 }
开发者ID:aritnath1990,项目名称:simplenewslatest,代码行数:19,代码来源:SpoolStorage.php


示例4: __construct

 /**
  * Constructs the secure login service.
  */
 public function __construct(ConfigFactoryInterface $config_factory, EventDispatcherInterface $event_dispatcher, RequestStack $request_stack)
 {
     $this->config = $config_factory->get('securelogin.settings');
     $this->eventDispatcher = $event_dispatcher;
     $this->requestStack = $request_stack;
     $this->request = $this->requestStack->getCurrentRequest();
 }
开发者ID:Wylbur,项目名称:gj,代码行数:10,代码来源:SecureLoginManager.php


示例5: __construct

 /**
  *  Constructs a new unroutedUrlAssembler object.
  *
  * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
  *   A request stack object.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config
  *    The config factory.
  * @param \Drupal\Core\PathProcessor\OutboundPathProcessorInterface $path_processor
  *   The output path processor.
  */
 public function __construct(RequestStack $request_stack, ConfigFactoryInterface $config, OutboundPathProcessorInterface $path_processor)
 {
     $allowed_protocols = $config->get('system.filter')->get('protocols') ?: ['http', 'https'];
     UrlHelper::setAllowedProtocols($allowed_protocols);
     $this->requestStack = $request_stack;
     $this->pathProcessor = $path_processor;
 }
开发者ID:brstde,项目名称:gap1,代码行数:17,代码来源:UnroutedUrlAssembler.php


示例6: __construct

 /**
  * Constructs Disqus comments destination plugin.
  *
  * @param array $configuration
  *   A configuration array containing information about the plugin instance.
  * @param string $plugin_id
  *   The plugin_id for the plugin instance.
  * @param mixed $plugin_definition
  *   The plugin implemetation definition.
  * @param \Drupal\migrate\Entity\MigrationInterface $migration
  *   The migration.
  * @param \Psr\Log\LoggerInterface $logger
  *   A logger instance.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The config factory.
  * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query
  *   The entity query factory.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, LoggerInterface $logger, ConfigFactoryInterface $config_factory, QueryFactory $entity_query)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition, $migration);
     $this->logger = $logger;
     $this->config = $config_factory->get('disqus.settings');
     $this->entityQuery = $entity_query;
 }
开发者ID:hugronaphor,项目名称:cornel,代码行数:25,代码来源:DisqusComment.php


示例7: __construct

 public function __construct(Client $http_client, LoggerChannelInterface $logger, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config)
 {
     $this->httpClient = $http_client;
     $this->logger = $logger;
     $this->moduleHandler = $module_handler;
     $this->config = $config->get('nodejs.config')->get();
 }
开发者ID:edwardchan,项目名称:d8-drupalvm,代码行数:7,代码来源:Nodejs.php


示例8: __construct

 /**
  * Constructs dropzone upload controller route controller.
  *
  * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
  *   The request stack.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config
  *   Config factory.
  * @param \Drupal\Core\Transliteration\PhpTransliteration $transliteration
  *   Transliteration service.
  */
 public function __construct(RequestStack $request_stack, ConfigFactoryInterface $config, TransliterationInterface $transliteration)
 {
     $this->request = $request_stack->getCurrentRequest();
     $tmp_override = $config->get('dropzonejs.settings')->get('tmp_dir');
     $this->temporaryUploadLocation = $tmp_override ?: $config->get('system.file')->get('path.temporary');
     $this->transliteration = $transliteration;
 }
开发者ID:DrupalTV,项目名称:DrupalTV,代码行数:17,代码来源:UploadHandler.php


示例9: __construct

 /**
  * Constructs a FinishResponseSubscriber object.
  *
  * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
  *   The language manager object for retrieving the correct language code.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   A config factory for retrieving required config objects.
  * @param \Drupal\Core\PageCache\RequestPolicyInterface $request_policy
  *   A policy rule determining the cacheability of a request.
  * @param \Drupal\Core\PageCache\ResponsePolicyInterface $response_policy
  *   A policy rule determining the cacheability of a response.
  */
 public function __construct(LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, RequestPolicyInterface $request_policy, ResponsePolicyInterface $response_policy)
 {
     $this->languageManager = $language_manager;
     $this->config = $config_factory->get('system.performance');
     $this->requestPolicy = $request_policy;
     $this->responsePolicy = $response_policy;
 }
开发者ID:anyforsoft,项目名称:csua_d8,代码行数:19,代码来源:FinishResponseSubscriber.php


示例10: __construct

 /**
  * Constructs a DevelEventSubscriber object.
  */
 public function __construct(ConfigFactoryInterface $config, AccountInterface $account, ModuleHandlerInterface $module_handler, UrlGeneratorInterface $url_generator)
 {
     $this->config = $config->get('devel.settings');
     $this->account = $account;
     $this->moduleHandler = $module_handler;
     $this->urlGenerator = $url_generator;
 }
开发者ID:penguinclub,项目名称:penguinweb_drupal8,代码行数:10,代码来源:DevelEventSubscriber.php


示例11: __construct

 /**
  * Constructs an EntityComparisonBase object.
  *
  * @param DiffBuilderManager $diffBuilderManager
  *   The diff field builder plugin manager.
  * @param EntityManagerInterface $entityManager
  *   Entity Manager service.
  * @param ConfigFactoryInterface $configFactory
  *   The configuration factory.
  */
 public function __construct(DiffBuilderManager $diffBuilderManager, EntityManagerInterface $entityManager, ConfigFactoryInterface $configFactory)
 {
     $this->entityManager = $entityManager;
     $this->config = $configFactory->get('diff.settings');
     $this->pluginsConfig = $configFactory->get('diff.plugins');
     $this->diffBuilderManager = $diffBuilderManager;
 }
开发者ID:sedurzu,项目名称:ildeposito8,代码行数:17,代码来源:DiffEntityParser.php


示例12: __construct

 /**
  * Constructs a new NgLightbox service.
  *
  * @param \Drupal\Core\Path\PathMatcherInterface $path_matcher
  *   Patch matcher services for comparing the lightbox patterns.
  * @param \Drupal\Core\Path\AliasManagerInterface $alias_manager
  *   Alias manager so we can also test path aliases.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The config factory so we can get the lightbox settings.
  */
 public function __construct(PathMatcherInterface $path_matcher, AliasManagerInterface $alias_manager, ConfigFactoryInterface $config_factory, AdminContext $admin_context)
 {
     $this->pathMatcher = $path_matcher;
     $this->aliasManager = $alias_manager;
     $this->config = $config_factory->get('ng_lightbox.settings');
     $this->adminContext = $admin_context;
 }
开发者ID:318io,项目名称:318-io,代码行数:17,代码来源:NgLightbox.php


示例13: __construct

 /**
  * Constructs an Importer object.
  *
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The factory for configuration objects.
  * @param \Drupal\aggregator\Plugin\AggregatorPluginManager $fetcher_manager
  *   The aggregator fetcher plugin manager.
  * @param \Drupal\aggregator\Plugin\AggregatorPluginManager $parser_manager
  *   The aggregator parser plugin manager.
  * @param \Drupal\aggregator\Plugin\AggregatorPluginManager $processor_manager
  *   The aggregator processor plugin manager.
  */
 public function __construct(ConfigFactoryInterface $config_factory, AggregatorPluginManager $fetcher_manager, AggregatorPluginManager $parser_manager, AggregatorPluginManager $processor_manager)
 {
     $this->fetcherManager = $fetcher_manager;
     $this->processorManager = $processor_manager;
     $this->parserManager = $parser_manager;
     $this->config = $config_factory->get('aggregator.settings');
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:19,代码来源:ItemsImporter.php


示例14: __construct

 /**
  * @param ConfigFactoryInterface $config
  * @param \Drupal\Core\Access\AccessManager $access_manager
  *   The access manager service.
  * @param \Drupal\Core\Session\AccountInterface $account
  *   The account object.
  * @param \Drupal\Core\Routing\RouteProviderInterface $route_provider
  *   The route provider service.
  */
 public function __construct(ConfigFactoryInterface $config, AccessManager $access_manager, AccountInterface $account, RouteProviderInterface $route_provider)
 {
     $this->config = $config->get('globalredirect.settings');
     $this->accessManager = $access_manager;
     $this->account = $account;
     $this->routeProvider = $route_provider;
 }
开发者ID:Progressable,项目名称:openway8,代码行数:16,代码来源:RedirectChecker.php


示例15: __construct

 /**
  * Constructs a NegotiationConfigureForm object.
  *
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The factory for configuration objects.
  * @param \Drupal\language\ConfigurableLanguageManagerInterface $language_manager
  *   The language manager.
  * @param \Drupal\language\LanguageNegotiatorInterface $negotiator
  *   The language negotiation methods manager.
  * @param \Drupal\block\BlockManagerInterface $block_manager
  *   The block manager, or NULL if not available.
  */
 public function __construct(ConfigFactoryInterface $config_factory, ConfigurableLanguageManagerInterface $language_manager, LanguageNegotiatorInterface $negotiator, BlockManagerInterface $block_manager = NULL)
 {
     $this->languageTypes = $config_factory->get('language.types');
     $this->languageManager = $language_manager;
     $this->negotiator = $negotiator;
     $this->blockManager = $block_manager;
 }
开发者ID:alnutile,项目名称:drunatra,代码行数:19,代码来源:NegotiationConfigureForm.php


示例16: __construct

 /**
  * Constructs the MailManager object.
  *
  * @param \Traversable $namespaces
  *   An object that implements \Traversable which contains the root paths
  *   keyed by the corresponding namespace to look for plugin implementations.
  * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
  *   Cache backend instance to use.
  * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
  *   The module handler to invoke the alter hook with.
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The configuration factory.
  */
 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory)
 {
     parent::__construct('Plugin/Mail', $namespaces, $module_handler, 'Drupal\\Core\\Annotation\\Mail');
     $this->alterInfo('mail_backend_info');
     $this->setCacheBackend($cache_backend, 'mail_backend_plugins');
     $this->mailConfig = $config_factory->get('system.mail');
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:20,代码来源:MailManager.php


示例17: __construct

 /**
  * Constructs a XmlSitemapGenerator object.
  *
  * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
  *   The config factory object.
  * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
  *   The entity manager handler.
  * @param \Drupal\Core\State\StateInterface $state
  *   The state handler.
  */
 public function __construct(ConfigFactoryInterface $config_factory, EntityManagerInterface $entity_manager, StateInterface $state, LanguageManagerInterface $language_manager)
 {
     $this->config = $config_factory->getEditable('xmlsitemap.settings');
     $this->entityManager = $entity_manager;
     $this->state = $state;
     $this->languageManager = $language_manager;
 }
开发者ID:jeroenos,项目名称:jeroenos_d8.mypressonline.com,代码行数:17,代码来源:XmlSitemapGenerator.php


示例18: getCleanSeparators

 /**
  * {@inheritdoc}
  */
 public function getCleanSeparators($string, $separator = NULL)
 {
     $config = $this->configFactory->get('pathauto.settings');
     if (!isset($separator)) {
         $separator = $config->get('separator');
     }
     $output = $string;
     if (strlen($separator)) {
         // Trim any leading or trailing separators.
         $output = trim($output, $separator);
         // Escape the separator for use in regular expressions.
         $seppattern = preg_quote($separator, '/');
         // Replace multiple separators with a single one.
         $output = preg_replace("/{$seppattern}+/", $separator, $output);
         // Replace trailing separators around slashes.
         if ($separator !== '/') {
             $output = preg_replace("/\\/+{$seppattern}\\/+|{$seppattern}\\/+|\\/+{$seppattern}/", "/", $output);
         } else {
             // If the separator is a slash, we need to re-add the leading slash
             // dropped by the trim function.
             $output = '/' . $output;
         }
     }
     return $output;
 }
开发者ID:aakb,项目名称:cfia,代码行数:28,代码来源:AliasCleaner.php


示例19: loginToDrupal

 /**
  * Attempts to log the authenticated CAS user into Drupal.
  *
  * This method should be used to login a user after they have successfully
  * authenticated with the CAS server.
  *
  * @param CasPropertyBag $property_bag
  *   CasPropertyBag containing username and attributes from CAS.
  *
  * @throws CasLoginException
  */
 public function loginToDrupal(CasPropertyBag $property_bag, $ticket)
 {
     $this->eventDispatcher->dispatch(CasHelper::CAS_PROPERTY_ALTER, new CasPropertyEvent($property_bag));
     $account = $this->userLoadByName($property_bag->getUsername());
     if (!$account) {
         $config = $this->settings->get('cas.settings');
         if ($config->get('user_accounts.auto_register') === TRUE) {
             if (!$property_bag->getRegisterStatus()) {
                 $_SESSION['cas_temp_disable'] = TRUE;
                 throw new CasLoginException("Cannot register user, an event listener denied access.");
             }
             $account = $this->registerUser($property_bag->getUsername());
         } else {
             throw new CasLoginException("Cannot login, local Drupal user account does not exist.");
         }
     }
     $this->eventDispatcher->dispatch(CasHelper::CAS_USER_ALTER, new CasUserEvent($account, $property_bag));
     $account->save();
     if (!$property_bag->getLoginStatus()) {
         $_SESSION['cas_temp_disable'] = TRUE;
         throw new CasLoginException("Cannot login, an event listener denied access.");
     }
     $this->userLoginFinalize($account);
     $this->storeLoginSessionData($this->sessionManager->getId(), $ticket);
 }
开发者ID:anarshi,项目名称:recap,代码行数:36,代码来源:CasLogin.php


示例20: getErrorLevel

 /**
  * Gets the configured error level.
  *
  * @return string
  */
 protected function getErrorLevel()
 {
     if (!isset($this->errorLevel)) {
         $this->errorLevel = $this->configFactory->get('system.logging')->get('error_level');
     }
     return $this->errorLevel;
 }
开发者ID:jeyram,项目名称:camp-gdl,代码行数:12,代码来源:DefaultExceptionSubscriber.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Config\ConfigImporter类代码示例发布时间:2022-05-23
下一篇:
PHP Config\Config类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap