diff --git a/.travis.yml b/.travis.yml index d2556725..e919cc66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,9 +44,83 @@ script: after_failure: - cat storage/logs/*.log +# Refer to: https://github.com/doctrine/dbal/blob/master/.travis.yml#L39 jobs: - fast_finish: true include: + # Different test stages +# - stage: Test +# name: PHP 7.2 + MySQL 5.7 +# php: 7.2 +# env: DB=mysql +# services: +# - mysql +# - stage: Test +# name: PHP 7.3 + MySQL 5.7 +# php: 7.3 +# env: DB=mysql +# services: +# - mysql +# - stage: Test +# name: PHP 7.4 + MySQL 5.7 +# php: 7.4 +# env: DB=mysql +# services: +# - mysql +# - stage: Test +# name: PHP 7.2 + MariaDB 10.1 +# php: 7.2 +# env: DB=mariadb +# addons: +# mariadb: '10.1' +# - stage: Test +# name: PHP 7.3 + MariaDB 10.1 +# php: 7.3 +# env: DB=mariadb +# addons: +# mariadb: '10.1' +# - stage: Test +# name: PHP 7.4 + MariaDB 10.1 +# php: 7.4 +# env: DB=mariadb MARIADB_VERSION=10.1 +# addons: +# mariadb: '10.1' +# - stage: Test +# name: PHP 7.2 + MariaDB 10.2 +# php: 7.2 +# env: DB=mariadb +# addons: +# mariadb: '10.2' +# - stage: Test +# name: PHP 7.3 + MariaDB 10.3 +# php: 7.3 +# env: DB=mariadb +# addons: +# mariadb: '10.2' +# - stage: Test +# name: PHP 7.4 + MariaDB 10.2 +# php: 7.4 +# env: DB=mariadb +# addons: +# mariadb: '10.2' +# - stage: Test +# name: PHP 7.2 + MariaDB 10.3 +# php: 7.2 +# env: DB=mariadb +# addons: +# mariadb: '10.3' +# - stage: Test +# name: PHP 7.3 + MariaDB 10.3 +# php: 7.3 +# env: DB=mariadb +# addons: +# mariadb: '10.3' +# - stage: Test +# name: PHP 7.4 + MariaDB 10.3 +# php: 7.4 +# env: DB=mariadb +# addons: +# mariadb: '10.3' + # Just packages up a release - stage: package script: skip diff --git a/app/Contracts/Model.php b/app/Contracts/Model.php index 9f0587fc..20e94c97 100644 --- a/app/Contracts/Model.php +++ b/app/Contracts/Model.php @@ -6,7 +6,7 @@ namespace App\Contracts; * @property mixed $id * @property bool $skip_mutator * - * @method static create(array $attrs) + * @method static Model create(array $attrs) * @method static Model find(int $id) * @method static Model select(array $array) * @method static Model where(array $array) diff --git a/app/Facades/Utils.php b/app/Facades/Utils.php index c077c819..8a9973e0 100644 --- a/app/Facades/Utils.php +++ b/app/Facades/Utils.php @@ -5,9 +5,6 @@ namespace App\Facades; use GuzzleHttp\Client; use Illuminate\Support\Facades\Facade; -/** - * Class Utils - */ class Utils extends Facade { /** diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 4c35ccca..2605280a 100755 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -25,7 +25,7 @@ use App\Models\Subfleet; use App\Models\User; use App\Repositories\SettingRepository; use App\Services\ModuleService; -use Illuminate\Contracts\Container\BindingResolutionException; +use App\Support\Utils; use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\View; use Illuminate\Support\ServiceProvider; @@ -76,13 +76,10 @@ class AppServiceProvider extends ServiceProvider $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class); } - try { - if (config('app.debug_toolbar') === true) { - app('debugbar')->enable(); - } else { - app('debugbar')->disable(); - } - } catch (BindingResolutionException $e) { + if (config('app.debug_toolbar') === true) { + Utils::enableDebugToolbar(); + } else { + Utils::disableDebugToolbar(); } } } diff --git a/modules/Installer/Services/DatabaseService.php b/app/Services/Installer/DatabaseService.php similarity index 97% rename from modules/Installer/Services/DatabaseService.php rename to app/Services/Installer/DatabaseService.php index 9a1618b6..57ddabfa 100644 --- a/modules/Installer/Services/DatabaseService.php +++ b/app/Services/Installer/DatabaseService.php @@ -1,6 +1,6 @@ disable(); + + $module = Module::find('importer'); + $module->disable(); + } } diff --git a/modules/Installer/Utils/LoggerTrait.php b/app/Services/Installer/LoggerTrait.php similarity index 89% rename from modules/Installer/Utils/LoggerTrait.php rename to app/Services/Installer/LoggerTrait.php index f8faa60b..872827ef 100644 --- a/modules/Installer/Utils/LoggerTrait.php +++ b/app/Services/Installer/LoggerTrait.php @@ -1,6 +1,6 @@ enable(); + } catch (BindingResolutionException $e) { + } + } + + /** + * Disable the debug toolbar + */ + public static function disableDebugToolbar() + { + try { + app('debugbar')->disable(); + } catch (BindingResolutionException $e) { + } + } + /** * Is the installer enabled? * diff --git a/config/modules_statuses.json b/config/modules_statuses.json index 6aba0422..d7b8ddbe 100644 --- a/config/modules_statuses.json +++ b/config/modules_statuses.json @@ -1,7 +1,9 @@ { "Awards": true, + "Importer": true, "Installer": true, "Sample": true, + "Updater": true, "VMSAcars": true, "Vacentral": true -} \ No newline at end of file +} diff --git a/intellij_style.xml b/intellij_style.xml index 9c0b5256..3fc35b05 100644 --- a/intellij_style.xml +++ b/intellij_style.xml @@ -17,9 +17,9 @@