Skip to content

Commit

Permalink
adding filter to bootstrap/console.php for setting environment.
Browse files Browse the repository at this point in the history
commenting out previous filer used for colorizing.
  • Loading branch information
gwoo committed Jan 5, 2012
1 parent 07c7c03 commit 321fe4d
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions app/config/bootstrap/console.php
Expand Up @@ -7,13 +7,27 @@
*/

use lithium\console\Dispatcher;
use lithium\core\Environment;

Dispatcher::applyFilter('_call', function($self, $params, $chain) {
$params['callable']->response->styles(array(
'heading' => '\033[1;30;46m'
));
return $chain->next($self, $params, $chain);
/**
* This filter sets the environment based on the current request. By default, `$request->env`, for
* example in the command `li3 help --env=production`, is used to determine the environment.
*
*/
Dispatcher::applyFilter('run', function($self, $params, $chain) {
Environment::set($params['request']);
});

/**
* This filter will convert {:heading} to the specified color codes. This is useful for colorizing
* output and creating different sections.
*
*/
// Dispatcher::applyFilter('_call', function($self, $params, $chain) {
// $params['callable']->response->styles(array(
// 'heading' => '\033[1;30;46m'
// ));
// return $chain->next($self, $params, $chain);
// });

?>

0 comments on commit 321fe4d

Please sign in to comment.