Skip to content

Commit

Permalink
Merge pull request #97 from flashingcursor/develop
Browse files Browse the repository at this point in the history
Making things a bit more environmentally sensitive...
  • Loading branch information
snipe committed Nov 30, 2013
2 parents f62ce40 + 78d1c03 commit 3bc3520
Show file tree
Hide file tree
Showing 16 changed files with 708 additions and 67 deletions.
77 changes: 56 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This isn't actually ready for anyone to use yet, as I'm still working out some o

## Requirements

- PHP 5.3.7 or later
- PHP 5.4 or later
- MCrypt PHP Extension

-----
Expand Down Expand Up @@ -43,41 +43,63 @@ Forgetting to do this can mean your DB might end up out of sync with the new fil

-----

### 2) Install the Dependencies via Composer
##### 2.1) If you don't have composer installed globally
### 2) Setup Database and Mail Settings

cd your-folder
curl -s http:https://getcomposer.org/installer | php
php composer.phar install
#### 2.1) Setup Your Database

##### 2.2) For globally composer installations
Copy the example database config `app/config/local/database.example.php` to `database.php`.
Update the file `app/config/local/database.php` with your database name and credentials.

cd your-folder
composer install
vi app/config/local/database.php

-----
#### 2.2) Setup Mail Settings

Copy the example mail config `app/config/local/database.example.php` to `database.php`.
Update the file `app/config/local/mail.php` with your mail settings.

vi app/config/local/mail.php

This will be used to send emails to your users, when they register and they request a password reset.

#### 2.3) Adjust the application settings.

Copy the example app config `app/config/local/app.example.php` to `app.php`.

Update the file `app/config/local/app.php` with your setting URL settings.

vi app/config/local/app.php

### 3) Setup Database
You should also change your secret key here -- if you prefer to have your key randomly generated, run the artisan key:generate command from the application root.

Copy the file `app/config/database.php` to `database.php`, and update `database.php` with your database name and credentials
php artisan key:generate --env=local

cp app/config/database.example.php app/config/database.php
vi app/config/database.example.php
#### 2.4) Adjust Environments

Update the file `boostrap/start.php' under the section `Detect The Application Environment`.

vi bootstrap/start.php

#### 2.5) Additional Adjustments

The app is configured to automatically detect if your in a local, staging, or production environment. Before deploying to a staging or production environment, follow sets 2.1, 2.2, and 2.3 above to tweak each environment as nescessary. Configuration files for each environment can be found in app/config/{environment} (local, staging, and production).

-----

### 4) Setup Mail Settings
### 3) Install the Dependencies via Composer
##### 3.1) If you don't have composer installed globally

Now, copy the file `app/config/mail.php` to `mail.php`, and update `mail.php` with your mail settings
cd your-folder
curl -s http:https://getcomposer.org/installer | php
php composer.phar install

cp app/config/mail.example.php app/config/mail.php
vi app/config/mail.example.php
##### 3.2) For global composer installations

This will be used to send emails to your users, when they register and they request a password reset.
cd your-folder
composer install

-----

### 5) Use custom CLI Installer Command
### 4) Use custom CLI Installer Command

Now, you need to create yourself a user and finish the installation.

Expand All @@ -101,7 +123,7 @@ If you still run into a permissions error, you may need to increase the permissi

### 7) Set the correct document root for your server

The document root for the app should be set to the public directory. In a standard Apache virtualhost setup, that might look something like this:
The document root for the app should be set to the public directory. In a standard Apache virtualhost setup, that might look something like this on a standard linux LAMP stack:

<VirtualHost *:80>
DocumentRoot /var/www/html/public
Expand All @@ -110,6 +132,19 @@ The document root for the app should be set to the public directory. In a standa
# Other directives here
</VirtualHost>

An OS X virtualhost setup could look more like:

Directory "/Users/flashingcursor/Sites/snipe-it/public/">
Allow From All
AllowOverride All
Options +Indexes
</Directory>
<VirtualHost *:80>
ServerName "snipe-it.dev"
DocumentRoot "/Users/flashingcursor/Sites/snipe-it/public"
SetEnv LARAVEL_ENV development
</VirtualHost>

-----

### 8) Seed the Database
Expand Down
49 changes: 5 additions & 44 deletions app/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,6 @@

return array(

/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/

'debug' => true,

/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/

'url' => 'http:https://localhost',

/*
|--------------------------------------------------------------------------
| Application Timezone
Expand All @@ -43,29 +17,16 @@

/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/

'locale' => 'en',

/*
|--------------------------------------------------------------------------
| Encryption Key
| Application Debug Mode
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/

'key' => 'YourSecretKey!!!',
'debug' => false,

/*
|--------------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions app/config/local/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
app.php
mail.php
database.php
45 changes: 45 additions & 0 deletions app/config/local/app.example.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

return array(

/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/

'debug' => true,

/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/

'url' => 'http:https://snipeit.dev',

/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
| Run a php artisand key:generate --env=staging to create a random one
*/

'key' => 'Change_this_key_or_snipe_will_get_ya',

);
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions app/config/production/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
app.php
mail.php
database.php
45 changes: 45 additions & 0 deletions app/config/production/app.example.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

return array(

/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/

'debug' => false,

/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/

'url' => 'http:https://www.yourserver.com',

/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
| Run a php artisand key:generate --env=staging to create a random one
*/

'key' => 'Change_this_key_or_snipe_will_get_ya',

);
Loading

0 comments on commit 3bc3520

Please sign in to comment.