public function testIncludeThemes()
 {
     $finder = new ManifestFileFinder();
     $finder->setOption('name_regex', '/\\.txt$/');
     $finder->setOption('include_themes', true);
     $this->assertFinderFinds($finder, array('module/module.txt', 'themes/themes.txt'));
 }
 /**
  * Regenerates the manifest by scanning the base path.
  *
  * @param bool $cache
  */
 public function regenerate($cache = true)
 {
     $finder = new ManifestFileFinder();
     $finder->setOptions(array('include_themes' => false, 'ignore_dirs' => array('node_modules', THEMES_DIR), 'ignore_tests' => !$this->tests, 'dir_callback' => array($this, 'handleDirectory')));
     $this->themes = [];
     $finder->find($this->base);
     if ($cache) {
         $this->cache->save($this->themes, $this->cacheKey);
     }
 }
 /**
  * Completely regenerates the manifest file.
  *
  * @param bool $cache Cache the result.
  */
 public function regenerate($cache = true)
 {
     $resets = array('classes', 'roots', 'children', 'descendants', 'interfaces', 'implementors', 'configs', 'configDirs', 'traits');
     // Reset the manifest so stale info doesn't cause errors.
     foreach ($resets as $reset) {
         $this->{$reset} = array();
     }
     $this->setDefaults();
     $finder = new ManifestFileFinder();
     $finder->setOptions(array('name_regex' => '/^(_config.php|[^_].*\\.php)$/', 'ignore_files' => array('index.php', 'main.php', 'cli-script.php', 'SSTemplateParser.php'), 'ignore_tests' => !$this->tests, 'file_callback' => array($this, 'handleFile'), 'dir_callback' => array($this, 'handleDir')));
     $finder->find($this->base);
     foreach ($this->roots as $root) {
         $this->coalesceDescendants($root);
     }
     if ($cache) {
         $data = array('classes' => $this->classes, 'descendants' => $this->descendants, 'interfaces' => $this->interfaces, 'implementors' => $this->implementors, 'configs' => $this->configs, 'configDirs' => $this->configDirs, 'traits' => $this->traits);
         $this->cache->save($data, $this->cacheKey);
     }
 }
 /**
  * Completely regenerates the manifest file. Scans through finding all php _config.php and yaml _config/*.ya?ml
  * files,parses the yaml files into fragments, sorts them and figures out what values need to be checked to pick
  * the correct variant.
  *
  * Does _not_ build the actual variant
  *
  * @param bool $includeTests
  * @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('min_depth' => 0, 'name_regex' => '/(^|[\\/\\\\])_config.php$/', 'ignore_tests' => !$includeTests, 'file_callback' => array($this, 'addSourceConfigFile')));
     $finder->find($this->base);
     $finder = new ManifestFileFinder();
     $finder->setOptions(array('name_regex' => '/\\.ya?ml$/', 'ignore_tests' => !$includeTests, 'file_callback' => array($this, 'addYAMLConfigFile')));
     $finder->find($this->base);
     $this->prefilterYamlFragments();
     $this->sortYamlFragments();
     $this->buildVariantKeySpec();
     if ($cache) {
         $this->cache->save($this->phpConfigSources, $this->key . 'php_config_sources');
         $this->cache->save($this->yamlConfigFragments, $this->key . 'yaml_config_fragments');
         $this->cache->save($this->variantKeySpec, $this->key . 'variant_key_spec');
     }
 }