PHP code example of marcqualie / hoard

1. Go to this page and download the library: Download marcqualie/hoard 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/ */

    

marcqualie / hoard example snippets

 php
{
    "arcqualie/hoard": "dev-master"
    }
}
 php
$hoard = new Hoard\Client(array(
    'server' => 'http://username.hoardhq.com';
    'apikey' => 'XXX'
));
$hoard->setDriver(new Hoard\Driver\GearmanDriver());
$bucket = $hoard->getBucket('analytics');
$response = $bucket->track('pageview', array(
    'uri' => '/'
));
echo 'Tracking ID: ' . $response->id;
 php
$app->register(new Silex\Provider\HoardServiceProvider(), array(
    'hoard.server' => 'http://username.hoardhq.com',
    'hoard.apikey' => 'XXX'
));
$bucket = $app['hoard']->getBucket('analytics');
$response = $bucket->track('pageview', array(
    'uri' => '/'
));
echo 'Tracking ID: ' . $response->id;
 php
$hoard = new Hoard\Client(array(
    'server' => 'http://username.hoardhq.com',
    'apikey' => 'XXX'
));
$driver = new Hoard\Driver\GearmanDriver(array(
    'host' => 'localhost',
    'port' => 4730
));
$hoard->setDriver($driver);
$response = $hoard->track('pageview', array(
    'uri' => '/'
));
echo 'Tracking ID: ' . $response->id;