Some fixes to the installer

This commit is contained in:
Nabeel Shahzad
2017-12-14 21:34:11 -06:00
parent a7318b851b
commit 719d7c2bd5
10 changed files with 51 additions and 41 deletions

View File

@@ -8,7 +8,8 @@ return [
],
# TODO: Remove eventually
'env_postfix' => '.generated',
// 'env_postfix' => '.generated',
'env_postfix' => '',
'extensions' => [
'openssl',

View File

@@ -2,6 +2,7 @@
Route::get('/', 'InstallerController@index')->name('index');
Route::get('/step1', 'InstallerController@step1')->name('step1');
Route::post('/step1', 'InstallerController@step1')->name('step1');
Route::get('/step2', 'InstallerController@step2')->name('step2');
Route::get('/step3', 'InstallerController@step3')->name('step3');

View File

@@ -3,11 +3,11 @@
# and APP_DEBUG to false
#
APP_ENV=dev
APP_URL=http://localhost
APP_ENV={!! $APP_ENV !!}
APP_URL="http://localhost"
APP_SKIN=default
VACENTRAL_API_KEY=
APP_KEY=base64:{!! $APP_KEY !!}
VACENTRAL_API_KEY=""
APP_KEY="base64:{!! $APP_KEY !!}"
APP_DEBUG=true
APP_LOCALE=en
@@ -15,28 +15,28 @@ APP_LOG=daily
APP_LOG_LEVEL=debug
APP_LOG_MAX_FILES=3
DB_CONNECTION={!! $DB_CONN !!}
DB_HOST={!! $DB_HOST !!}
DB_PORT={!! $DB_PORT !!}
DB_DATABASE={!! $DB_NAME !!}
DB_USERNAME={!! $DB_USER !!}
DB_PASSWORD={!! $DB_PASS !!}
DB_PREFIX=
DB_CONNECTION="{!! $DB_CONN !!}"
DB_HOST="{!! $DB_HOST !!}"
DB_PORT="{!! $DB_PORT !!}"
DB_DATABASE="{!! $DB_NAME !!}"
DB_USERNAME="{!! $DB_USER !!}"
DB_PASSWORD="{!! $DB_PASS !!}"
DB_PREFIX=""
MAIL_DRIVER=smtp
MAIL_FROM_ADDRESS=no-reply@phpvms.net
MAIL_FROM_NAME=phpVMS Admin
MAIL_HOST=smtp.mailgun.org
MAIL_FROM_ADDRESS="no-reply@phpvms.net"
MAIL_FROM_NAME="phpVMS Admin"
MAIL_HOST="smtp.mailgun.org"
MAIL_PORT=587
MAIL_ENCRYPTION=tls
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION="tls"
MAIL_USERNAME=""
MAIL_PASSWORD=""
CACHE_DRIVER={!! $CACHE_DRIVER !!}
CACHE_PREFIX=phpvms
CACHE_DRIVER="{!! $CACHE_DRIVER !!}"
CACHE_PREFIX="phpvms"
REDIS_HOST=localhost
REDIS_PASSWORD=
REDIS_HOST="localhost"
REDIS_PASSWORD=""
REDIS_PORT=6379
REDIS_DATABASE=1

View File

@@ -17,7 +17,7 @@ class DatabaseService {
Log::info('Testing Connection: '.$type.'::'.$user.':'.$pass.'@'.$host.':'.$port.';'.$name);
if($type === 'mysql') {
$dsn = "mysql:host=$host;port=$port;dbname=$name";
$dsn = "mysql:host=$host;port=$port;";
Log::info('Connection string: '. $dsn);
try {
$conn = new PDO($dsn, $user, $pass);

View File

@@ -14,6 +14,7 @@ class EnvironmentService
public function createEnvFile($type, $host, $port, $name, $user, $pass)
{
$opts = [
'APP_ENV' => 'dev',
'APP_KEY' => $this->createAppKey(),
'DB_CONN' => $type,
'DB_HOST' => $host,
@@ -50,7 +51,7 @@ class EnvironmentService
if(\extension_loaded('apc')) {
$opts['CACHE_DRIVER'] = 'apc';
} else {
$opts['CACHE_DRIVER'] = 'filesystem';
$opts['CACHE_DRIVER'] = 'file';
}
return $opts;
@@ -81,8 +82,7 @@ class EnvironmentService
*/
protected function writeEnvFile($opts)
{
$app = app();
$env_file = $app->environmentFilePath();
$env_file = \App::environmentFilePath();
$env_file .= config('installer.env_postfix');
# render it within Blade and log the contents