Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #30 from jorygeerts/master
Browse files Browse the repository at this point in the history
Changes for issue "ignore_environments"
  • Loading branch information
ceesvanegmond committed Apr 25, 2014
2 parents 1508f9f + a60afe8 commit 6dee727
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/CeesVanEgmond/Minify/Minify.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private function process($file)
{
$this->provider->add($file);

if($this->provider->make($this->buildPath))
if($this->minifyForCurrentEnvironment() && $this->provider->make($this->buildPath))
{
$this->provider->minify();
}
Expand All @@ -93,14 +93,22 @@ private function process($file)
*/
public function render()
{
if (in_array($this->environment, $this->config['ignore_environments']))
if (!$this->minifyForCurrentEnvironment())
{
return $this->provider->tags($this->attributes);
}

return $this->provider->tag($this->buildPath . $this->provider->getFilename(), $this->attributes);
}

/**
* @return bool
*/
protected function minifyForCurrentEnvironment()
{
return !in_array($this->environment, $this->config['ignore_environments']);
}

/**
* @return string
*/
Expand Down

0 comments on commit 6dee727

Please sign in to comment.