Skip to content

Commit

Permalink
Allow environment to be checked via App::environment method.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Oct 19, 2013
1 parent e045886 commit 66e5a0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/Illuminate/Foundation/Application.php
Expand Up @@ -196,13 +196,21 @@ public function startExceptionHandling()
} }


/** /**
* Get the current application environment. * Get or check the current application environment.
* *
* @param dynamic
* @return string * @return string
*/ */
public function environment() public function environment()
{ {
return $this['env']; if (count(func_get_args()) > 0)
{
return in_array($this['env'], func_get_args());
}
else
{
return $this['env'];
}
} }


/** /**
Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Foundation/changes.json
Expand Up @@ -59,6 +59,7 @@
{"message": "Allow Blade processing on echos to be escaped using the @ sign.", "backport": null}, {"message": "Allow Blade processing on echos to be escaped using the @ sign.", "backport": null},
{"message": "Allow custom messages to be registered when using Validator::extend.", "backport": null}, {"message": "Allow custom messages to be registered when using Validator::extend.", "backport": null},
{"message": "Added new auth:clear-reminders command for clearing expired password reminders.", "backport": null}, {"message": "Added new auth:clear-reminders command for clearing expired password reminders.", "backport": null},
{"message": "Added Cookie::queue method for creating cookies that are automatically attached to the final response.", "backport": null} {"message": "Added Cookie::queue method for creating cookies that are automatically attached to the final response.", "backport": null},
{"message": "Allow environment to be checked via App::environment method.", "backport": null}
] ]
} }

0 comments on commit 66e5a0b

Please sign in to comment.