Skip to content

Commit

Permalink
try with closure
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 committed Mar 1, 2024
1 parent 12b5d61 commit 6579da7
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/ci/files/public/index_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,25 @@
define('PIMCORE_PROJECT_ROOT', __DIR__ . '/..');
define('APP_ENV', 'test');

\Pimcore\Bootstrap::setProjectRoot();
\Pimcore\Bootstrap::bootstrap();
return function (array $context) {
\Pimcore\Bootstrap::setProjectRoot();
\Pimcore\Bootstrap::bootstrap();

$request = Request::createFromGlobals();
$request = Request::createFromGlobals();

// set current request as property on tool as there's no
// request stack available yet
Tool::setCurrentRequest($request);
Tool::setCurrentRequest($request);

/** @var \Pimcore\Kernel $kernel */
$kernel = \Pimcore\Bootstrap::kernel();
/** @var \Pimcore\Kernel $kernel */
$kernel = \Pimcore\Bootstrap::kernel();

// reset current request - will be read from request stack from now on
Tool::setCurrentRequest(null);
Tool::setCurrentRequest(null);

$response = $kernel->handle($request);
$response->send();
$response = $kernel->handle($request);
$response->send();

$kernel->terminate($request, $response);
$kernel->terminate($request, $response);
return $kernel;
};

0 comments on commit 6579da7

Please sign in to comment.