PHP code example of manomano-tech / correlation-ids
1. Go to this page and download the library: Download manomano-tech/correlation-ids library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
manomano-tech / correlation-ids example snippets
useManomanoTech\CorrelationId\Factory\HeaderCorrelationIdContainerFactory;
useManomanoTech\CorrelationId\Generator\RamseyUuidGenerator;
useManomanoTech\CorrelationId\CorrelationEntryName;
// We specify which generator will be responsible for generating the// identification of the current process
$generator = new RamseyUuidGenerator();
// We define what are the http header names to look for
$correlationEntryNames = new CorrelationEntryName(
'Current-Correlation-id',
'Parent-Correlation-id',
'Root-Correlation-id'
);
$factory = new HeaderCorrelationIdContainerFactory(
$generator,
$correlationEntryNames
);
$correlationIdContainer = $factory->create(getallheaders());
useManomanoTech\CorrelationId\Factory\CorrelationIdContainerFactory;
useManomanoTech\CorrelationId\Generator\RamseyUuidGenerator;
useManomanoTech\CorrelationId\CorrelationEntryName;
// We specify which generator will be responsible for generating the// identification of the current process
$generator = new RamseyUuidGenerator();
$factory = new CorrelationIdContainerFactory($generator);
$correlationIdContainer = $factory->create(
'3fc044d9-90fa-4b50-b6d9-3423f567155f',
'3b5263fa-1644-4750-8f11-aaf61e58cd9e'
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.