Skip to content

Commit

Permalink
Merge pull request #9 from webrgp/develop
Browse files Browse the repository at this point in the history
Fix Craft 4 compatibility issue on `AddCraftInfo` middleware.
  • Loading branch information
webrgp authored Jan 3, 2025
2 parents bbd3407 + debcc23 commit 89d7316
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## 1.0.2 - 2025-01-02

- Fix Craft 4 compatibility issue on `AddCraftInfo` middleware.

## 1.0.1.1 - 2025-01-02

- Enhance code formatting by removing unused middleware and adjusting function syntax in the IgnitionRenderer.
Expand Down
6 changes: 5 additions & 1 deletion src/middleware/AddCraftInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ public function handle(Report $report, $next)
*/
private static function _appInfo(): array
{
$craftEdition = version_compare(Craft::$app->getVersion(), '5.0.0', '<')
? App::editionName(Craft::$app->getEdition())
: Craft::$app->edition->name;

$info = [
'PHP version' => App::phpVersion(),
'OS version' => PHP_OS . ' ' . php_uname('r'),
'Database driver & version' => self::_dbDriver(),
'Image driver & version' => self::_imageDriver(),
'Craft edition & version' => sprintf('Craft %s %s', Craft::$app->edition->name, Craft::$app->getVersion()),
'Craft edition & version' => sprintf('Craft %s %s', $craftEdition, Craft::$app->getVersion()),
];

if (!class_exists(InstalledVersions::class, false)) {
Expand Down

0 comments on commit 89d7316

Please sign in to comment.