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


PHP ConfigFactoryInterface::reset方法代码示例

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


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

示例1: deleteLocaleTranslationData

 /**
  * Deletes translation data from locale module.
  *
  * This will invoke LocaleConfigSubscriber through the event dispatcher. To
  * make sure the configuration was persisted correctly, the configuration
  * value is checked. Because LocaleConfigSubscriber temporarily disables the
  * override state of the configuration factory we check that the correct value
  * is restored afterwards.
  *
  * @param string $config_name
  *   The configuration name.
  * @param string $key
  *   The configuration key.
  * @param string $source_value
  *   The source configuration value to verify the correct value is returned
  *   from the configuration factory after the deletion.
  * @param string $langcode
  *   The language code.
  */
 protected function deleteLocaleTranslationData($config_name, $key, $source_value, $langcode)
 {
     $this->localeConfigManager->getStringTranslation($config_name, $langcode, $source_value, '')->delete();
     $this->localeConfigManager->reset();
     $this->localeConfigManager->updateConfigTranslations(array($config_name), array($langcode));
     $this->configFactory->reset($config_name);
     $this->assertNoConfigOverride($config_name, $key, $source_value, $langcode);
 }
开发者ID:ddrozdik,项目名称:dmaps,代码行数:27,代码来源:LocaleConfigSubscriberTest.php

示例2: installCollectionDefaultConfig

 /**
  * {@inheritdoc}
  */
 public function installCollectionDefaultConfig($collection)
 {
     $storage = new ExtensionInstallStorage($this->getActiveStorages(StorageInterface::DEFAULT_COLLECTION), InstallStorage::CONFIG_INSTALL_DIRECTORY, $collection, $this->drupalInstallationAttempted());
     // Only install configuration for enabled extensions.
     $enabled_extensions = $this->getEnabledExtensions();
     $config_to_install = array_filter($storage->listAll(), function ($config_name) use($enabled_extensions) {
         $provider = Unicode::substr($config_name, 0, strpos($config_name, '.'));
         return in_array($provider, $enabled_extensions);
     });
     if (!empty($config_to_install)) {
         $this->createConfiguration($collection, $storage->readMultiple($config_to_install));
         // Reset all the static caches and list caches.
         $this->configFactory->reset();
     }
 }
开发者ID:dmyerson,项目名称:d8ecs,代码行数:18,代码来源:ConfigInstaller.php

示例3: installCollectionDefaultConfig

 /**
  * {@inheritdoc}
  */
 public function installCollectionDefaultConfig($collection)
 {
     $config_to_install = $this->getSourceStorage($collection)->listAll();
     $extension_config = $this->configFactory->get('core.extension');
     $enabled_extensions = array_keys((array) $extension_config->get('module'));
     $enabled_extensions += array_keys((array) $extension_config->get('theme'));
     $config_to_install = array_filter($config_to_install, function ($config_name) use($enabled_extensions) {
         $provider = Unicode::substr($config_name, 0, strpos($config_name, '.'));
         return in_array($provider, $enabled_extensions);
     });
     if (!empty($config_to_install)) {
         $old_state = $this->configFactory->getOverrideState();
         $this->configFactory->setOverrideState(FALSE);
         $this->createConfiguration($collection, $config_to_install);
         $this->configFactory->setOverrideState($old_state);
         // Reset all the static caches and list caches.
         $this->configFactory->reset();
     }
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:22,代码来源:ConfigInstaller.php

示例4: reload

 /**
  * {@inheritdoc}
  */
 public function reload()
 {
     $this->config = NULL;
     $this->configFactory->reset($this->configName);
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:8,代码来源:StaticMenuLinkOverrides.php

示例5: deleteLocaleTranslationData

 /**
  * Deletes translation data from locale module.
  *
  * This will invoke LocaleConfigSubscriber through the event dispatcher. To
  * make sure the configuration was persisted correctly, the configuration
  * value is checked. Because LocaleConfigSubscriber temporarily disables the
  * override state of the configuration factory we check that the correct value
  * is restored afterwards.
  *
  * @param string $config_name
  *   The configuration name.
  * @param string $key
  *   The configuration key.
  * @param string $source_value
  *   The source configuration value to verify the correct value is returned
  *   from the configuration factory after the deletion.
  */
 protected function deleteLocaleTranslationData($config_name, $key, $source_value)
 {
     $this->localeConfigManager->deleteTranslationData($config_name, $this->langcode);
     $this->configFactory->reset($config_name);
     $this->assertConfigValue($config_name, $key, $source_value);
 }
开发者ID:Nikola-xiii,项目名称:d8intranet,代码行数:23,代码来源:LocaleConfigSubscriberTest.php


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