本文整理汇总了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);
}
示例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();
}
}
示例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();
}
}
示例4: reload
/**
* {@inheritdoc}
*/
public function reload()
{
$this->config = NULL;
$this->configFactory->reset($this->configName);
}
示例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);
}