PHP code example of rstgroup / request-id-module

1. Go to this page and download the library: Download rstgroup/request-id-module 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/ */

    

rstgroup / request-id-module example snippets


return [
    'modules' => [
        \RstGroup\RequestIdModule::class,
    ],
];

return [
    'rst_group' => [
        'request_id_module' => [
            'header_name' => 'X-Custom-Request-Id',
            'allow_override'=> false,
        ],
    ],
];

return [
   'service_manager' => [
       'invokables' => [
           \PhpMiddleware\RequestId\Generator\GeneratorInterface::class => \PhpMiddleware\RequestId\Generator\Md5Generator::class,
       ],
    ],
];

$requestIdProvider = $serviceLocator->get(\PhpMiddleware\RequestId\RequestIdProviderInterface::class);
$requestId = $requestIdProvider->getRequestId();