Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Apply fixes from StyleCI (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
rashidlaasri authored Aug 12, 2019
1 parent fb20e54 commit 001b802
Show file tree
Hide file tree
Showing 38 changed files with 1,474 additions and 1,569 deletions.
284 changes: 141 additions & 143 deletions src/Config/installer.php
Original file line number Diff line number Diff line change
@@ -1,143 +1,141 @@
<?php

use Illuminate\Validation\Rule;

return [

/*
|--------------------------------------------------------------------------
| Server Requirements
|--------------------------------------------------------------------------
|
| This is the default Laravel server requirements, you can add as many
| as your application require, we check if the extension is enabled
| by looping through the array and run "extension_loaded" on it.
|
*/
'core' => [
'minPhpVersion' => '7.0.0'
],
'final' => [
'key' => true,
'publish' => false
],
'requirements' => [
'php' => [
'openssl',
'pdo',
'mbstring',
'tokenizer',
'JSON',
'cURL',
],
'apache' => [
'mod_rewrite',
],
],

/*
|--------------------------------------------------------------------------
| Folders Permissions
|--------------------------------------------------------------------------
|
| This is the default Laravel folders permissions, if your application
| requires more permissions just add them to the array list bellow.
|
*/
'permissions' => [
'storage/framework/' => '775',
'storage/logs/' => '775',
'bootstrap/cache/' => '775'
],

/*
|--------------------------------------------------------------------------
| Environment Form Wizard Validation Rules & Messages
|--------------------------------------------------------------------------
|
| This are the default form field validation rules. Available Rules:
| https://laravel.com/docs/5.4/validation#available-validation-rules
|
*/
'environment' => [
'form' => [
'rules' => [
'app_name' => 'required|string|max:50',
'environment' => 'required|string|max:50',
'environment_custom' => 'required_if:environment,other|max:50',
'app_debug' => 'required|boolean',
'app_log_level' => 'required|string|max:50',
'app_url' => 'required|url',
'database_connection' => 'required|string|max:50',
'database_hostname' => 'required|string|max:50',
'database_port' => 'required|numeric',
'database_name' => 'required|string|max:50',
'database_username' => 'required|string|max:50',
'database_password' => 'required|string|max:50',
'broadcast_driver' => 'required|string|max:50',
'cache_driver' => 'required|string|max:50',
'session_driver' => 'required|string|max:50',
'queue_driver' => 'required|string|max:50',
'redis_hostname' => 'required|string|max:50',
'redis_password' => 'required|string|max:50',
'redis_port' => 'required|numeric',
'mail_driver' => 'required|string|max:50',
'mail_host' => 'required|string|max:50',
'mail_port' => 'required|string|max:50',
'mail_username' => 'required|string|max:50',
'mail_password' => 'required|string|max:50',
'mail_encryption' => 'required|string|max:50',
'pusher_app_id' => 'max:50',
'pusher_app_key' => 'max:50',
'pusher_app_secret' => 'max:50',
],
],
],

/*
|--------------------------------------------------------------------------
| Installed Middleware Options
|--------------------------------------------------------------------------
| Different available status switch configuration for the
| canInstall middleware located in `canInstall.php`.
|
*/
'installed' => [
'redirectOptions' => [
'route' => [
'name' => 'welcome',
'data' => [],
],
'abort' => [
'type' => '404',
],
'dump' => [
'data' => 'Dumping a not found message.',
]
],
],

/*
|--------------------------------------------------------------------------
| Selected Installed Middleware Option
|--------------------------------------------------------------------------
| The selected option fo what happens when an installer instance has been
| Default output is to `/resources/views/error/404.blade.php` if none.
| The available middleware options include:
| route, abort, dump, 404, default, ''
|
*/
'installedAlreadyAction' => '',

/*
|--------------------------------------------------------------------------
| Updater Enabled
|--------------------------------------------------------------------------
| Can the application run the '/update' route with the migrations.
| The default option is set to False if none is present.
| Boolean value
|
*/
'updaterEnabled' => 'true',

];
<?php

return [

/*
|--------------------------------------------------------------------------
| Server Requirements
|--------------------------------------------------------------------------
|
| This is the default Laravel server requirements, you can add as many
| as your application require, we check if the extension is enabled
| by looping through the array and run "extension_loaded" on it.
|
*/
'core' => [
'minPhpVersion' => '7.0.0',
],
'final' => [
'key' => true,
'publish' => false,
],
'requirements' => [
'php' => [
'openssl',
'pdo',
'mbstring',
'tokenizer',
'JSON',
'cURL',
],
'apache' => [
'mod_rewrite',
],
],

/*
|--------------------------------------------------------------------------
| Folders Permissions
|--------------------------------------------------------------------------
|
| This is the default Laravel folders permissions, if your application
| requires more permissions just add them to the array list bellow.
|
*/
'permissions' => [
'storage/framework/' => '775',
'storage/logs/' => '775',
'bootstrap/cache/' => '775',
],

/*
|--------------------------------------------------------------------------
| Environment Form Wizard Validation Rules & Messages
|--------------------------------------------------------------------------
|
| This are the default form field validation rules. Available Rules:
| https://laravel.com/docs/5.4/validation#available-validation-rules
|
*/
'environment' => [
'form' => [
'rules' => [
'app_name' => 'required|string|max:50',
'environment' => 'required|string|max:50',
'environment_custom' => 'required_if:environment,other|max:50',
'app_debug' => 'required|boolean',
'app_log_level' => 'required|string|max:50',
'app_url' => 'required|url',
'database_connection' => 'required|string|max:50',
'database_hostname' => 'required|string|max:50',
'database_port' => 'required|numeric',
'database_name' => 'required|string|max:50',
'database_username' => 'required|string|max:50',
'database_password' => 'required|string|max:50',
'broadcast_driver' => 'required|string|max:50',
'cache_driver' => 'required|string|max:50',
'session_driver' => 'required|string|max:50',
'queue_driver' => 'required|string|max:50',
'redis_hostname' => 'required|string|max:50',
'redis_password' => 'required|string|max:50',
'redis_port' => 'required|numeric',
'mail_driver' => 'required|string|max:50',
'mail_host' => 'required|string|max:50',
'mail_port' => 'required|string|max:50',
'mail_username' => 'required|string|max:50',
'mail_password' => 'required|string|max:50',
'mail_encryption' => 'required|string|max:50',
'pusher_app_id' => 'max:50',
'pusher_app_key' => 'max:50',
'pusher_app_secret' => 'max:50',
],
],
],

/*
|--------------------------------------------------------------------------
| Installed Middleware Options
|--------------------------------------------------------------------------
| Different available status switch configuration for the
| canInstall middleware located in `canInstall.php`.
|
*/
'installed' => [
'redirectOptions' => [
'route' => [
'name' => 'welcome',
'data' => [],
],
'abort' => [
'type' => '404',
],
'dump' => [
'data' => 'Dumping a not found message.',
],
],
],

/*
|--------------------------------------------------------------------------
| Selected Installed Middleware Option
|--------------------------------------------------------------------------
| The selected option fo what happens when an installer instance has been
| Default output is to `/resources/views/error/404.blade.php` if none.
| The available middleware options include:
| route, abort, dump, 404, default, ''
|
*/
'installedAlreadyAction' => '',

/*
|--------------------------------------------------------------------------
| Updater Enabled
|--------------------------------------------------------------------------
| Can the application run the '/update' route with the migrations.
| The default option is set to False if none is present.
| Boolean value
|
*/
'updaterEnabled' => 'true',

];
11 changes: 6 additions & 5 deletions src/Controllers/EnvironmentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace RachidLaasri\LaravelInstaller\Controllers;

use Exception;
use Illuminate\Routing\Controller;
use Validator;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\DB;
use RachidLaasri\LaravelInstaller\Helpers\EnvironmentManager;
use RachidLaasri\LaravelInstaller\Events\EnvironmentSaved;
use Validator;
use RachidLaasri\LaravelInstaller\Helpers\EnvironmentManager;

class EnvironmentController extends Controller
{
Expand Down Expand Up @@ -97,7 +97,7 @@ public function saveWizard(Request $request, Redirector $redirect)
return $redirect->route('LaravelInstaller::environmentWizard')->withInput()->withErrors($validator->errors());
}

if (!$this->checkDatabaseConnection($request)) {
if (! $this->checkDatabaseConnection($request)) {
return $redirect->route('LaravelInstaller::environmentWizard')->withInput()->withErrors([
'database_connection' => trans('installer_messages.environment.wizard.form.db_connection_failed'),
]);
Expand All @@ -116,7 +116,7 @@ public function saveWizard(Request $request, Redirector $redirect)
* Validate database connection with user credentials (Form Wizard).
*
* @param Request $request
* @return boolean
* @return bool
*/
private function checkDatabaseConnection(Request $request)
{
Expand All @@ -142,6 +142,7 @@ private function checkDatabaseConnection(Request $request)

try {
DB::connection()->getPdo();

return true;
} catch (Exception $e) {
return false;
Expand Down
1 change: 0 additions & 1 deletion src/Controllers/PermissionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

class PermissionsController extends Controller
{

/**
* @var PermissionsChecker
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Controllers/RequirementsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public function requirements()

return view('vendor.installer.requirements', compact('requirements', 'phpSupportInfo'));
}
}
}
2 changes: 1 addition & 1 deletion src/Controllers/UpdateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace RachidLaasri\LaravelInstaller\Controllers;

use Illuminate\Routing\Controller;
use RachidLaasri\LaravelInstaller\Helpers\InstalledFileManager;
use RachidLaasri\LaravelInstaller\Helpers\DatabaseManager;
use RachidLaasri\LaravelInstaller\Helpers\InstalledFileManager;

class UpdateController extends Controller
{
Expand Down
2 changes: 0 additions & 2 deletions src/Controllers/WelcomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class WelcomeController extends Controller
{

/**
* Display the installer welcome page.
*
Expand All @@ -16,5 +15,4 @@ public function welcome()
{
return view('vendor.installer.welcome');
}

}
Loading

0 comments on commit 001b802

Please sign in to comment.