Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
php-version: [ '8.2', '8.3', '8.4', '8.5' ]
dependencies: ['highest']
include:
- php-version: '8.1'
- php-version: '8.2'
dependencies: 'lowest'

steps:
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
fi

- name: Code Coverage Report
if: success() && matrix.php-version == '8.1'
if: success() && matrix.php-version == '8.2'
uses: codecov/codecov-action@v5

cs-stan:
Expand Down
7 changes: 1 addition & 6 deletions src/Log/Engines/SentryLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
namespace CakeSentry\Log\Engines;

use Cake\Event\EventManager;
use Cake\Http\Server;
use Cake\Log\Engine\BaseLog;
use Psr\Log\LogLevel;
use Sentry\Logs\Logs;
Expand All @@ -22,11 +21,7 @@ public function __construct(array $config = [])
parent::__construct($config);

// Send the logs to sentry after the client has received the response
if (
PHP_SAPI !== 'cli' &&
function_exists('fastcgi_finish_request') &&
method_exists(Server::class, 'terminate')
) {
if (PHP_SAPI !== 'cli' && function_exists('fastcgi_finish_request')) {
$this->logsWillBeFlushed = true;
EventManager::instance()->on('Server.terminate', function (): void {
Logs::getInstance()->flush();
Expand Down
3 changes: 1 addition & 2 deletions src/Middleware/CakeSentryPerformanceMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Cake\Database\Driver;
use Cake\Datasource\ConnectionManager;
use Cake\Event\EventManager;
use Cake\Http\Server;
use CakeSentry\Database\Log\CakeSentryLog;
use CakeSentry\Event\CacheEventListener;
use CakeSentry\Event\HttpEventListener;
Expand Down Expand Up @@ -101,7 +100,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface

$transaction->setHttpStatus($response->getStatusCode());

if (function_exists('fastcgi_finish_request') && method_exists(Server::class, 'terminate')) {
if (function_exists('fastcgi_finish_request')) {
// Send the transaction to sentry after the client has received the response
EventManager::instance()->on('Server.terminate', function () use ($transaction): void {
$transaction->finish();
Expand Down