Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR ConfigManifest cache fixes

- Do not skip the cache if there are currently no environmental specific spec, just use the an empty variantKeySpec.
- When doing a regeneration of the config, clear the previous values from the array before regeneration.
  • Loading branch information...
commit 5e79e81b31d75defc1ebe014dd5efa3f6928d929 1 parent ebe75fe
@stojg stojg authored chillu committed
Showing with 11 additions and 9 deletions.
  1. +11 −9 core/manifest/ConfigManifest.php
View
20 core/manifest/ConfigManifest.php
@@ -59,15 +59,13 @@ public function __construct($base, $includeTests = false, $forceRegen = false )
if (!$forceRegen) {
// The PHP config sources are always needed
$this->phpConfigSources = $this->cache->load('php_config_sources');
-
- // Get the variant key spec - if this isn't present, we can't figure out what variant we're in so it's full regen time
- if ($this->variantKeySpec = $this->cache->load('variant_key_spec')) {
- // Try getting the pre-filtered & merged config for this variant
- if (!($this->yamlConfig = $this->cache->load('yaml_config_'.$this->variantKey()))) {
- // Otherwise, if we do have the yaml config fragments (and we should since we have a variant key spec) work out the config for this variant
- if ($this->yamlConfigFragments = $this->cache->load('yaml_config_fragments')) {
- $this->buildYamlConfigVariant();
- }
+ // Get the variant key spec
+ $this->variantKeySpec = $this->cache->load('variant_key_spec');
+ // Try getting the pre-filtered & merged config for this variant
+ if (!($this->yamlConfig = $this->cache->load('yaml_config_'.$this->variantKey()))) {
+ // Otherwise, if we do have the yaml config fragments (and we should since we have a variant key spec) work out the config for this variant
+ if ($this->yamlConfigFragments = $this->cache->load('yaml_config_fragments')) {
+ $this->buildYamlConfigVariant();
}
}
}
@@ -122,6 +120,10 @@ public function variantKey() {
* @param bool $cache Cache the result.
*/
public function regenerate($includeTests = false, $cache = true) {
+ $this->phpConfigSources = array();
+ $this->yamlConfigFragments = array();
+ $this->variantKeySpec = array();
+
$finder = new ManifestFileFinder();
$finder->setOptions(array(
'name_regex' => '/_config.php$/',
Please sign in to comment.
Something went wrong with that request. Please try again.