1. Go to this page and download the library: Download qandidate/stack-request-id library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
qandidate / stack-request-id example snippets
5
use Symfony\Component\HttpFoundation\Request;
$kernel = new AppKernel($env, $debug);
$kernel->loadClassCache();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
5
use Qandidate\Stack\RequestId;
use Qandidate\Stack\UuidRequestIdGenerator;
use Symfony\Component\HttpFoundation\Request;
$kernel = new AppKernel($env, $debug);
// Stack it!
$generator = new UuidRequestIdGenerator(1337);
$stack = new RequestId($kernel, $generator);
$kernel->loadClassCache();
$request = Request::createFromGlobals();
$response = $stack->handle($request);
$response->send();
$kernel->terminate($request, $response);
5
$generator = new UuidRequestIdGenerator(1337);
$stack = new RequestId($kernel, $generator);
$stack->enableResponseHeader();