2017 © Pedro Peláez
 

library vnstat

PHP wrapper for the command line app 'vnstat'

image

luna/vnstat

PHP wrapper for the command line app 'vnstat'

  • Friday, December 23, 2016
  • by DuckThom
  • Repository
  • 1 Watchers
  • 1 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

php-vnstat

vnstat json output parser for PHP, (*1)

StyleCI License Total Downloads, (*2)

Usage

use Luna\Vnstat\Vnstat;

class YourClass extends Awesomeness implements Ideas
{
  protected $interface = 'eth0';

  public function runWithStaticMethod()
  {    
    $jsonObject = Vnstat::get($this->interface);
  }

  public function runWithNewInstance()
  {
    $vnstat = new Vnstat($this->interface);
    $vnstat->run();

    $rawJson = $vnstat->getJson();
    $response = $vnstat->getResponse();
  }
}

Methods

public function Vnstat::__construct(string $interface): void
public function Vnstat::get(string $interface): \Luna\Vnstat\VnstatResponse
public function Vnstat::getResponse(): \Luna\Vnstat\VnstatResponse
public function Vnstat::setExecutablePath(string $executable): $this
public function Vnstat::getExecutablePath(): string
public function Vnstat::setJson(string $json): $this
public function Vnstat::getJson(): string

Errors/Exceptions

Throws Luna\Vnstat\Exceptions\InvalidJsonException if the string returned by Vnstat::getJson() was an invalid json string., (*3)

Throws Luna\Vnstat\Exceptions\ExecutableNotFoundException if which vnstat failed., (*4)

Throws \Symfony\Component\Process\Exception\ProcessFailedException if vnstat --query --json -i $interface failed., (*5)

The Versions

23/12 2016

dev-master

9999999-dev

PHP wrapper for the command line app 'vnstat'

  Sources   Download

MIT

The Requires

 

The Development Requires

by Thomas Wiringa

23/12 2016

1.1.1

1.1.1.0

PHP wrapper for the command line app 'vnstat'

  Sources   Download

MIT

The Requires

 

The Development Requires

by Thomas Wiringa

13/12 2016

1.1.0

1.1.0.0

PHP wrapper for the command line app 'vnstat'

  Sources   Download

MIT

The Requires

 

The Development Requires

by Thomas Wiringa

11/12 2016

1.0.2

1.0.2.0

PHP wrapper for the command line app 'vnstat'

  Sources   Download

MIT

The Requires

 

The Development Requires

by Thomas Wiringa

11/12 2016

1.0.1

1.0.1.0

PHP wrapper for the command line app 'vnstat'

  Sources   Download

MIT

The Requires

 

The Development Requires

by Thomas Wiringa

10/12 2016

1.0.0

1.0.0.0

PHP wrapper for the command line app 'vnstat'

  Sources   Download

MIT

The Requires

 

The Development Requires

by Thomas Wiringa

10/12 2016

0.1

0.1.0.0

PHP wrapper for the command line app 'vnstat'

  Sources   Download

MIT

The Requires

 

The Development Requires

by Thomas Wiringa