1. Go to this page and download the library: Download debuggy/gauger 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/ */
debuggy / gauger example snippets
$totals = Debuggy\Gauger::getSample ('anykey', 'Totals');
$totals->stamp ('Any name for the stamp');
echo $totals->toString ();
use Debuggy\Gauger\Dial;
use Debuggy\Gauger\Filter;
use Debuggy\Gauger\Formatter;
use Debuggy\Gauger\Gauge;
use Debuggy\Gauger\Indicator;
use Debuggy\Gauger\Presenter;
use Debuggy\Gauger\Refiner;
use Debuggy\Gauger\Reporter;
$gauge = new Gauge;
$gauge->addDial (new Dial (
new Indicator\Extra (
'keep?', // get only values from this key of an array passed as an extra
new Formatter\Stash // Stash conceals the indicator from the reporter
),
new Filter\Equal (true) // filter will be applied for each single stamp
));
// if any dial does not pass its value to gauge, the whole stamp will be omitted
$gauge->addDial (new Dial (new Indicator\Extra ('value'))); // for keeping our values
foreach (range (0, 11) as $i)
$gauge->stamp ('evens', ['value' => $i, 'keep?' => ($i % 2 === 0)]);
// the root refiner provides a gauge encapsulation and always comes first
$refiner = new Refiner\Root ($gauge);
$refiner = new Refiner\Filter (
$refiner, // all other refiners take another refiner into a constructor
new Filter\Between (1, 9) // will be applied to the eventual bunch of stamps
);
// The Plain reporter just produces a simple list of stamps and their values
$reporter = new Reporter\Plain;
// The report as an array
$dataAsArray = $reporter->recount ($refiner);
/* Let's add a title to our report */
$dataAsArray = array ('Our title' => $dataAsArray)
// Txt presenter makes a fancy text from an array
$presenter = new Presenter\Txt;
echo $presenter->represent ($dataAsArray);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.