{"id":18795344,"url":"https://github.com/duckthom/php-vnstat","last_synced_at":"2025-04-13T15:34:23.035Z","repository":{"id":62520306,"uuid":"75982156","full_name":"DuckThom/php-vnstat","owner":"DuckThom","description":"vnstat json output parser for PHP","archived":false,"fork":false,"pushed_at":"2016-12-23T15:03:16.000Z","size":39,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T06:34:42.646Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DuckThom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-08T22:58:37.000Z","updated_at":"2021-04-17T16:26:24.000Z","dependencies_parsed_at":"2022-11-02T13:31:58.154Z","dependency_job_id":null,"html_url":"https://github.com/DuckThom/php-vnstat","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DuckThom%2Fphp-vnstat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DuckThom%2Fphp-vnstat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DuckThom%2Fphp-vnstat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DuckThom%2Fphp-vnstat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DuckThom","download_url":"https://codeload.github.com/DuckThom/php-vnstat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248736615,"owners_count":21153623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T21:33:30.640Z","updated_at":"2025-04-13T15:34:22.655Z","avatar_url":"https://github.com/DuckThom.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-vnstat\nvnstat json output parser for PHP\n\n[![StyleCI](https://styleci.io/repos/75982156/shield?branch=master)](https://styleci.io/repos/75982156)\n[![License](https://poser.pugx.org/luna/vnstat/license?format=flat-square)](https://packagist.org/packages/luna/vnstat)\n[![Total Downloads](https://poser.pugx.org/luna/vnstat/downloads?format=flat-square)](https://packagist.org/packages/luna/vnstat)\n\n## Usage\n\n```php\nuse Luna\\Vnstat\\Vnstat;\n\nclass YourClass extends Awesomeness implements Ideas\n{\n  protected $interface = 'eth0';\n\n  public function runWithStaticMethod()\n  {    \n    $jsonObject = Vnstat::get($this-\u003einterface);\n  }\n  \n  public function runWithNewInstance()\n  {\n    $vnstat = new Vnstat($this-\u003einterface);\n    $vnstat-\u003erun();\n    \n    $rawJson = $vnstat-\u003egetJson();\n    $response = $vnstat-\u003egetResponse();\n  }\n}\n```\n\n## Methods\n\n```php\npublic function Vnstat::__construct(string $interface): void\n```\n\n```php\npublic function Vnstat::get(string $interface): \\Luna\\Vnstat\\VnstatResponse\n```\n\n```php\npublic function Vnstat::getResponse(): \\Luna\\Vnstat\\VnstatResponse\n```\n\n```php\npublic function Vnstat::setExecutablePath(string $executable): $this\n```\n\n```php\npublic function Vnstat::getExecutablePath(): string\n```\n\n```php\npublic function Vnstat::setJson(string $json): $this\n```\n\n```php\npublic function Vnstat::getJson(): string\n```\n\n## Errors/Exceptions\n\nThrows `Luna\\Vnstat\\Exceptions\\InvalidJsonException` if the string returned by `Vnstat::getJson()` was an invalid json string.\n\nThrows `Luna\\Vnstat\\Exceptions\\ExecutableNotFoundException` if `which vnstat` failed.\n\nThrows `\\Symfony\\Component\\Process\\Exception\\ProcessFailedException` if `vnstat --query --json -i $interface` failed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduckthom%2Fphp-vnstat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduckthom%2Fphp-vnstat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduckthom%2Fphp-vnstat/lists"}