Skip to content

Commit

Permalink
Updating debug mode and it's env file.
Browse files Browse the repository at this point in the history
Signed-off-by: Vallabh Kansagara <[email protected]>
  • Loading branch information
vrkansagara committed May 25, 2018
1 parent 624a251 commit ac06718
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ protected $middleware = [

Add your target environment into `.env`
~~~bash
VRKANSAGARA_COMPRESS_ENVIRONMENT='prod,testing,dev'
VRKANSAGARA_COMPRESS_ENVIRONMENT='prod,testing,dev,local'
~~~


If you want to see how much you compress on each page, set bellow line in `.env`
~~~bash
VRKANSAGARA_COMPRESS_DEBUG=0
~~~


### Display usage on each page.

Set `$debug = 1;` in `AfterMiddleware.php`
Expand Down
11 changes: 6 additions & 5 deletions src/Http/Middleware/AfterMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ class AfterMiddleware
public function handle($request, Closure $next)
{

$isDebug = isset(getenv('VRKANSAGARA_COMPRESS_DEBUG'))
&& ! empty(getenv('VRKANSAGARA_COMPRESS_DEBUG'))
getenv('VRKANSAGARA_COMPRESS_DEBUG')
: 0;

$isDebug = null !== getenv('VRKANSAGARA_COMPRESS_DEBUG')
? getenv('VRKANSAGARA_COMPRESS_DEBUG')
: 0;
if ($isDebug) {
$this->debug = 1;
}
$targetEnvironment = explode(
',', getenv('VRKANSAGARA_COMPRESS_ENVIRONMENT')
);
Expand Down

0 comments on commit ac06718

Please sign in to comment.