Skip to content

Commit

Permalink
Fix missing service before modxcms/revolution#16696 gets merged
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-H committed Feb 21, 2025
1 parent b3290d7 commit 896f8e5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/components/aikit/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php

/**
* @var \MODX\Revolution\modX $modx
* @var array $namespace
*/

use GuzzleHttp\Psr7\HttpFactory;
use xPDO\xPDO;

if (!file_exists(__DIR__ . '/vendor/autoload.php')) {
Expand All @@ -16,3 +18,9 @@
if (!$modx->addPackage('modmore\\AIKit\\Model', __DIR__ . '/src/Model/', null, 'modmore\\AIKit\\Model')) {
$modx->log(xPDO::LOG_LEVEL_ERROR, 'Failed adding AIKit package');
}

if (!$modx->services->has(\Psr\Http\Message\ResponseFactoryInterface::class)) {
$modx->services->add(\Psr\Http\Message\ResponseFactoryInterface::class, function () {
return new HttpFactory();
});
}

0 comments on commit 896f8e5

Please sign in to comment.