<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
chubbyphp / chubbyphp-swoole-request-handler example snippets
declare(strict_types=1);
namespace App;
use Chubbyphp\SwooleRequestHandler\OnRequest;
use Chubbyphp\SwooleRequestHandler\PsrRequestFactory;
use Chubbyphp\SwooleRequestHandler\SwooleResponseEmitter;
use Psr\Http\Server\RequestHandlerInterface;
use Some\Psr17\Factory\ServerRequestFactory;
use Some\Psr17\Factory\StreamFactory;
use Some\Psr17\Factory\UploadedFileFactory;
use Swoole\Http\Server;
$loader = eEmitter(),
$app
));
$http->start();
declare(strict_types=1);
namespace App;
use Blackfire\Client;
use Chubbyphp\SwooleRequestHandler\Adapter\BlackfireOnRequestAdapter;
use Chubbyphp\SwooleRequestHandler\OnRequest;
/** @var OnRequest $onRequest */
$onRequest = ...;
if (extension_loaded('blackfire') {
$onRequest = new BlackfireOnRequestAdapter($onRequest, new Client());
}
$http->on('request', $onRequest);
declare(strict_types=1);
namespace App;
use Chubbyphp\SwooleRequestHandler\Adapter\NewRelicOnRequestAdapter;
use Chubbyphp\SwooleRequestHandler\OnRequest;
/** @var OnRequest $onRequest */
$onRequest = ...;
if (extension_loaded('newrelic') && false !== $name = ini_get('newrelic.appname')) {
$onRequest = new NewRelicOnRequestAdapter($onRequest, $name);
}
$http->on('request', $onRequest);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.