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

14
.env.bak Normal file
View File

@ -0,0 +1,14 @@
APP_ENV=dev
APP_KEY=base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI=
APP_DEBUG=true
APP_LOCALE=en
APP_URL=http://localhost
APP_LOG=daily
APP_LOG_LEVEL=debug
APP_LOG_MAX_FILES=7
DB_CONNECTION=sqlite
CACHE_DRIVER=array
CACHE_PREFIX=

1
.gitignore vendored
View File

@ -18,6 +18,7 @@ storage/*.sqlite
.env.php
.env
.env.php
.env.*
.env.generated
.vagrant
#Homestead.yaml

View File

@ -70,6 +70,13 @@ schema:
deploy-package:
./.travis/deploy_script.sh
.PHONY: reset-installer
reset-installer:
@cp .env.dev.example .env
@make clean
mysql -uroot -e "DROP DATABASE IF EXISTS phpvms"
mysql -uroot -e "CREATE DATABASE phpvms"
.PHONY: docker
docker:
@mkdir -p $(CURR_PATH)/tmp/mysql

View File

@ -1,3 +1,4 @@
dnsmasq: /usr/local/sbin/dnsmasq --keep-in-foreground
php-fpm: /usr/local/sbin/php-fpm --nodaemonize
nginx: /usr/local/bin/nginx
mysql: /usr/local/bin/mysqld

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

View File

@ -304,21 +304,6 @@
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="PHARS">
<CLASSES>
<root url="phar://$MODULE_DIR$/vendor/phar-io/manifest/tests/_fixture/test.phar/" />
<root url="phar://$MODULE_DIR$/composer.phar/" />
<root url="phar://$MODULE_DIR$/vendor/phpunit/phpunit/tests/_files/phpunit-example-extension/tools/phpunit.d/phpunit-example-extension-1.0.1.phar/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="phar://$MODULE_DIR$/vendor/phar-io/manifest/tests/_fixture/test.phar/" />
<root url="phar://$MODULE_DIR$/composer.phar/" />
<root url="phar://$MODULE_DIR$/vendor/phpunit/phpunit/tests/_files/phpunit-example-extension/tools/phpunit.d/phpunit-example-extension-1.0.1.phar/" />
</SOURCES>
</library>
</orderEntry>
</component>
<component name="TemplatesService">
<option name="TEMPLATE_FOLDERS">