evilfreelancer/pihole-api-php

dev-master 2020-02-29 19:24 UTC

This package is auto-updated.

Last update: 2024-10-29 04:53:41 UTC


README

Latest Stable Version Build Status Total Downloads License Code Climate Code Coverage Scrutinizer CQ

Pi-Hole API PHP client

composer require evilfreelancer/pihole-api-php

How to use

$config = new \PiHole\Config([
    'webpassword' => '6b600e5555af97b26ed51a5910a0b310d9da8e22a7aaf97ab0137bb4880ec55e',
    'base_url'    => 'http://192.168.1.10/admin/api.php'
]);

$client = new \PiHole\Client($config);

// Get all stats
$statistics = $client->statistics()->exec();
print_r($statistics);

// Get version of PiHole
$version = $client->version()->exec();
print_r($version);

// Enable ADBlocking on PiHole
$enable = $client->enable()->exec();
print_r($enable);

// Disable ADBlocking on PiHole
$disable = $client->disable()->exec();
print_r($disable);

// Logout from PiHole
$logout = $client->logout()->exec();
print_r($logout);

List of available configuration parameters

Links