PHP code example of debugchannel / php-client

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

    

debugchannel / php-client example snippets


composer 
`
git clone https://github.com/SquareProtonOrg/debugchannel-php-client



$d = new debugchannel\DebugChannel("192.168.2.158", "greeting");

class Person {
  private $name; private $age;
  public __construct($name, $age) {
    $this->name = $name;
    $this->age = $age;
  }
}

$d->explore("Hello World"); // 1
$d->explore(23); // 2
$d->explore(new Person("John", 32)); // 3
$d->explore(array(1,"hello", new Person("John", 32))); // 4

$data = array(
    array(1,2,3),
    array(4,5,6),
    array(7,8,9)
);
$d->table($data);

$obj = new stdClass();
$obj->name = 'Peter';
$obj->age = 30;
$obj->likes = 'Php';

$data = array( $obj );

$d->table($data);

$d = new DebugChannel('localhost', 'mychannel');

$d->explore( "...", array(DC_DIE, DC_EXPAND) );
$d->explore( "...", DC_DIE | DC_EXPAND );

{
    "host": "192.168.2.17",
    "channel" : "peter",
    "apiKey": null,
    "options": {
      "showPrivateMembers": true,
      "expLvl": 2,
      "maxDepth": 2,
      "showMethods": false
    }
}