本文整理汇总了PHP中Magento\Framework\App\DeploymentConfig::resetData方法的典型用法代码示例。如果您正苦于以下问题:PHP DeploymentConfig::resetData方法的具体用法?PHP DeploymentConfig::resetData怎么用?PHP DeploymentConfig::resetData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\App\DeploymentConfig
的用法示例。
在下文中一共展示了DeploymentConfig::resetData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadConfigData
/**
* Loads configuration data only
*
* @return void
*/
private function loadConfigData()
{
$this->config->resetData();
if (null === $this->configData && null !== $this->config->get(ConfigOptionsListConstants::KEY_MODULES)) {
$this->configData = $this->config->get(ConfigOptionsListConstants::KEY_MODULES);
}
}
示例2: saveConfig
/**
* Saves config
*
* @param array $data
* @param bool $override
* @return void
*/
public function saveConfig(array $data, $override = false)
{
$paths = $this->configFilePool->getPaths();
foreach ($data as $fileKey => $config) {
if (isset($paths[$fileKey])) {
if ($this->filesystem->getDirectoryWrite(DirectoryList::CONFIG)->isExist($paths[$fileKey])) {
$currentData = $this->reader->load($fileKey);
if ($override) {
$config = array_merge($currentData, $config);
} else {
$config = array_replace_recursive($currentData, $config);
}
}
$contents = $this->formatter->format($config);
try {
$this->filesystem->getDirectoryWrite(DirectoryList::CONFIG)->writeFile($paths[$fileKey], $contents);
} catch (FileSystemException $e) {
throw new FileSystemException(new Phrase('Deployment config file %1 is not writable.', [$paths[$fileKey]]));
}
if (function_exists('opcache_invalidate')) {
opcache_invalidate($this->filesystem->getDirectoryRead(DirectoryList::CONFIG)->getAbsolutePath($paths[$fileKey]));
}
}
}
$this->deploymentConfig->resetData();
}
示例3: saveConfig
/**
* Saves config
*
* @param array $data
* @param bool $override
* @return void
*/
public function saveConfig(array $data, $override = false)
{
$paths = $this->configFilePool->getPaths();
foreach ($data as $fileKey => $config) {
if (isset($paths[$fileKey])) {
if ($this->filesystem->getDirectoryWrite(DirectoryList::CONFIG)->isExist($paths[$fileKey])) {
$currentData = $this->reader->load($paths[$fileKey]);
if ($override) {
$config = array_merge($currentData, $config);
} else {
$config = array_replace_recursive($currentData, $config);
}
}
$contents = $this->formatter->format($config);
$this->filesystem->getDirectoryWrite(DirectoryList::CONFIG)->writeFile($paths[$fileKey], $contents);
}
}
$this->deploymentConfig->resetData();
}