Skip to content

Commit

Permalink
Updates Laravel to run on OpenShift
Browse files Browse the repository at this point in the history
  • Loading branch information
luciddreamz committed Aug 15, 2016
1 parent 7703179 commit dd4c7fc
Show file tree
Hide file tree
Showing 12 changed files with 1,300 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .s2i/environment
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DOCUMENTROOT=/public
SHORT_OPEN_TAG=ON
APP_LOG=errorlog
8 changes: 4 additions & 4 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
|
*/

'env' => env('APP_ENV', 'production'),
'env' => env('APP_ENV', 'development'),

/*
|--------------------------------------------------------------------------
Expand All @@ -26,7 +26,7 @@
|
*/

'debug' => env('APP_DEBUG', false),
'debug' => env('APP_DEBUG', true),

/*
|--------------------------------------------------------------------------
Expand All @@ -39,7 +39,7 @@
|
*/

'url' => env('APP_URL', 'http://localhost'),
'url' => env('OPENSHIFT_BUILD_NAME') ? ( 'http://'.preg_replace('/^(.*)-[\d]+$/','${1}',env('OPENSHIFT_BUILD_NAME', 'laravel-mysql-example-1')).'-'.env('OPENSHIFT_BUILD_NAMESPACE').'.'.env('ROUTER_SHARD', '44fs').'.'.env('CLUSTER_NAME', 'preview').'.openshiftapps.com' ) : env('APP_URL', 'http://localhost'),

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -91,7 +91,7 @@
|
*/

'key' => env('APP_KEY'),
'key' => env('APP_KEY', 'base64:WvqIZriSQBJAlFyHQ3zrMUQbzLB9a42v/vQRACDAdqA='),

'cipher' => 'AES-256-CBC',

Expand Down
10 changes: 5 additions & 5 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
|
*/

'default' => env('DB_CONNECTION', 'mysql'),
'default' => env('DB_CONNECTION', 'sqlite'),

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -54,8 +54,8 @@

'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '3306'),
'host' => env(strtoupper(env('DB_SERVICE_NAME', 'MYSQL')).'_SERVICE_HOST', env('DB_HOST', 'localhost')),
'port' => env(strtoupper(env('DB_SERVICE_NAME', 'MYSQL')).'_SERVICE_PORT', env('DB_PORT', '3306')),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
Expand All @@ -68,8 +68,8 @@

'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '5432'),
'host' => env(strtoupper(env('DB_SERVICE_NAME', 'PGSQL')).'_SERVICE_HOST', env('DB_HOST', 'localhost')),
'port' => env(strtoupper(env('DB_SERVICE_NAME', 'PGSQL')).'_SERVICE_PORT', env('DB_PORT', '5432')),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
Expand Down
2 changes: 1 addition & 1 deletion config/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
|
*/

'driver' => env('SESSION_DRIVER', 'file'),
'driver' => env('SESSION_DRIVER', 'cookie'),

/*
|--------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion database/.gitignore

This file was deleted.

Empty file added database/database.sqlite
Empty file.
5 changes: 5 additions & 0 deletions migrate-database.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -e

echo "Migrating database 'php artisan migrate --force'..."
php artisan migrate --force
Loading

0 comments on commit dd4c7fc

Please sign in to comment.