Skip to content

Commit

Permalink
Merge branch 'develop' into fix/logging-too-much
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxwilko committed Feb 26, 2025
2 parents 5ded270 + 98fd6f1 commit 9e20d92
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install PHP and PHP Code Sniffer
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.2
extensions: curl, fileinfo, gd, mbstring, openssl, pdo, pdo_sqlite, sqlite3, xml, zip
tools: phpcs

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Update manifest
runs-on: ubuntu-latest
env:
phpVersion: '8.1'
phpVersion: '8.2'
extensions: curl, fileinfo, gd, mbstring, openssl, pdo, pdo_sqlite, sqlite3, xml, zip
key: winter-cms-cache-develop
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: ${{ matrix.operatingSystem }} / JavaScript
env:
nodeVersion: 16
phpVersion: '8.0'
phpVersion: '8.2'
extensions: curl, fileinfo, gd, mbstring, openssl, pdo, pdo_sqlite, sqlite3, xml, zip
key: winter-cms-cache-develop
steps:
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
max-parallel: 8
matrix:
operatingSystem: [ubuntu-latest, windows-latest]
phpVersion: ['8.0', '8.1', '8.2', '8.3']
phpVersion: ['8.1', '8.2', '8.3']
fail-fast: false
runs-on: ${{ matrix.operatingSystem }}
name: ${{ matrix.operatingSystem }} / PHP ${{ matrix.phpVersion }}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"source": "/~https://github.com/wintercms/winter"
},
"require": {
"php": "^8.0.2",
"php": ">=8.1",
"winter/storm": "dev-develop as 1.2",
"winter/wn-system-module": "dev-develop",
"winter/wn-backend-module": "dev-develop",
Expand Down
2 changes: 1 addition & 1 deletion modules/backend/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
],
"require": {
"php": "^8.0.2",
"php": ">=8.1",
"composer/installers": "~1.11.0",
"laravel/framework": "^9.1"
},
Expand Down
2 changes: 1 addition & 1 deletion modules/cms/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
],
"require": {
"php": "^8.0.2",
"php": ">=8.1",
"composer/installers": "~1.11.0",
"laravel/framework": "^9.1"
},
Expand Down
56 changes: 36 additions & 20 deletions modules/system/classes/PluginManager.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
<?php namespace System\Classes;

use Db;
use App;
use Str;
use Log;
use File;
use Lang;
use View;
use Cache;
use Config;
use Schema;
use SystemException;
<?php

namespace System\Classes;

use Backend\Classes\NavigationManager;
use FilesystemIterator;
use RecursiveIteratorIterator;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\View;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use System\Models\PluginVersion;
use SystemException;
use Winter\Storm\Foundation\Application;
use Winter\Storm\Support\ClassLoader;
use Backend\Classes\NavigationManager;
use Winter\Storm\Support\Facades\Config;
use Winter\Storm\Support\Facades\File;
use Winter\Storm\Support\Str;

/**
* Plugin manager
Expand Down Expand Up @@ -256,8 +258,15 @@ public function registerAll(bool $force = false): void
return;
}

foreach ($this->plugins as $pluginId => $plugin) {
$this->registerPlugin($plugin, $pluginId);
try {
foreach ($this->plugins as $pluginId => $plugin) {
$this->registerPlugin($plugin, $pluginId);
}
} catch (QueryException $ex) {
// SQLSTATE[42S02]: Base table or view not found - migrations haven't run yet
if ($ex->getCode() === '42S02') {
Log::error("$pluginId cannot be registered, missing database content. Try running migrations. Error: " . $ex->getMessage());
}
}

// Ensure that route attributes are properly loaded
Expand Down Expand Up @@ -372,8 +381,15 @@ public function bootAll(bool $force = false): void
return;
}

foreach ($this->plugins as $plugin) {
$this->bootPlugin($plugin);
try {
foreach ($this->plugins as $pluginId => $plugin) {
$this->bootPlugin($plugin);
}
} catch (QueryException $ex) {
// SQLSTATE[42S02]: Base table or view not found - migrations haven't run yet
if ($ex->getCode() === '42S02') {
Log::error("$pluginId cannot be booted, missing database content. Try running migrations. Error: " . $ex->getMessage());
}
}

$this->booted = true;
Expand Down Expand Up @@ -664,7 +680,7 @@ protected function loadDisabled(): void
if (
$this->app->hasDatabaseTable('system_plugin_versions')
) {
$userDisabled = Db::table('system_plugin_versions')->where('is_disabled', 1)->lists('code') ?? [];
$userDisabled = DB::table('system_plugin_versions')->where('is_disabled', 1)->lists('code') ?? [];
foreach ($userDisabled as $code) {
$this->flagPlugin($code, static::DISABLED_BY_USER);
}
Expand Down
2 changes: 1 addition & 1 deletion modules/system/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
],
"require": {
"php": "^8.0.2",
"php": ">=8.1",
"composer/installers": "~1.11.0",
"laravel/framework": "^9.1",
"composer/semver": "^3.2"
Expand Down

0 comments on commit 9e20d92

Please sign in to comment.