PHP code example of traceguide / api-php
1. Go to this page and download the library: Download traceguide/api-php 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/ */
traceguide / api-php example snippets
guide::initialize('examples/trivial_process', '{{access_token_goes_here}}');
Traceguide::infof("The current unix time = %d", time());
$span = Traceguide::startSpan();
$span->setOperation("trivial/loop");
for ($i = 0; $i < 10; $i++) {
$span->infof("Loop iteration %d", $i);
echo "The current unix time is " . time() . "\n";
sleep(1);
}
$span->finish();
bash
composer