From 5ba802d4733194ca2ed4539e1e085c940da391fa Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 21 May 2012 11:05:59 -0500 Subject: [PATCH] Update environment documentation. --- laravel/documentation/install.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/laravel/documentation/install.md b/laravel/documentation/install.md index 3f462e88..12f12951 100644 --- a/laravel/documentation/install.md +++ b/laravel/documentation/install.md @@ -52,11 +52,15 @@ It's **extremely** important that you change the **application key** option befo ## Environments -Most likely, the configuration options you need for local development are not the same as the options you need on your production server. Laravel's default environment handling mechanism is the **LARAVEL_ENV** environment variable. To get started, set the environment variable in your **httpd.conf** file: +Most likely, the configuration options you need for local development are not the same as the options you need on your production server. Laravel's default environment handling mechanism is URL based, which will make setting up environments a breeze. Pop open the `paths.php` file in the root of your Laravel installation. You should see an array like this: - SetEnv LARAVEL_ENV local + $environments = array( -> **Note:** Using a web server other than Apache? Check your server's documentation to learn how to set environment variables. + 'local' => array('http://localhost*', '*.dev'), + + ); + +This tells Laravel that any URLs beginning with "localhost" or ending with ".dev" should be considered part of the "local" environment. Next, create an **application/config/local** directory. Any files and options you place in this directory will override the options in the base **application/config** directory. For example, you may wish to create an **application.php** file within your new **local** configuration directory: @@ -68,9 +72,7 @@ Next, create an **application/config/local** directory. Any files and options yo In this example, the local **URL** option will override the **URL** option in **application/config/application.php**. Notice that you only need to specify the options you wish to override. -If you do not have access to your server's configuration files, you may manually set the **LARAVEL_ENV** variable at the top of Laravel's **paths.php** file: - - $_SERVER['LARAVEL_ENV'] = 'local'; +Isn't it easy? Of course, you are free to create as many environments as you wish! ## Cleaner URLs