diff --git a/res/schema.json b/res/schema.json index 22a4c55a..427cbd0f 100644 --- a/res/schema.json +++ b/res/schema.json @@ -43,6 +43,13 @@ }, "type": ["array", "string"] }, + "exclude-from-value-replace": { + "description": "A list of regular expressions for file paths to not value replace but add verbatim", + "items": { + "type": "string" + }, + "type": ["array", "string"] + }, "bootstrap": { "description": "A file used to load third-party class compactors.", "type": "string" diff --git a/src/lib/KevinGH/Box/Command/Build.php b/src/lib/KevinGH/Box/Command/Build.php index f4be0fee..4cd3af18 100644 --- a/src/lib/KevinGH/Box/Command/Build.php +++ b/src/lib/KevinGH/Box/Command/Build.php @@ -445,6 +445,12 @@ protected function execute(InputInterface $input, OutputInterface $output) unset($values, $key, $value); } + //set the regular expressions for files that don't need value replacement + if (array() !== ($excludedFromValueReplace = $this->config->getExcludedFromValueReplace())) { + $this->box->setExcludedFromValueReplace($excludedFromValueReplace, $this->config->getBasePath()); + } + + // register configured compactors if (array() !== ($compactors = $this->config->getCompactors())) { @@ -695,6 +701,9 @@ private function add( $box->addFile($file, $relative); } + if($box instanceof Box) { + $box->addFilesFromQueue(); + } } } } diff --git a/src/lib/KevinGH/Box/Configuration.php b/src/lib/KevinGH/Box/Configuration.php index 895eed64..89ea326d 100644 --- a/src/lib/KevinGH/Box/Configuration.php +++ b/src/lib/KevinGH/Box/Configuration.php @@ -216,6 +216,18 @@ function (&$file) { return array(); } + /** + * Returns a list of non parsed regular expressions to exclude files from getting replacements + * + * @return array + */ + public function getExcludedFromValueReplace() + { + if (isset($this->raw->{'exclude-from-value-replace'})) { + return (array)$this->raw->{'exclude-from-value-replace'}; + } + return array(); + } /** * Returns a filter callable for the configured blacklist. *