{"id":16156550,"url":"https://github.com/nioc/synology-srm-php-api","last_synced_at":"2025-03-18T20:30:41.054Z","repository":{"id":57027416,"uuid":"260701347","full_name":"nioc/synology-srm-php-api","owner":"nioc","description":"PHP wrapper for Synology Router Manager (SRM) API","archived":false,"fork":false,"pushed_at":"2022-09-27T21:09:08.000Z","size":20,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T12:06:56.573Z","etag":null,"topics":["router","srm","synology"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nioc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-02T14:13:09.000Z","updated_at":"2023-10-08T07:06:33.000Z","dependencies_parsed_at":"2022-08-23T16:30:14.626Z","dependency_job_id":null,"html_url":"https://github.com/nioc/synology-srm-php-api","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nioc%2Fsynology-srm-php-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nioc%2Fsynology-srm-php-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nioc%2Fsynology-srm-php-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nioc%2Fsynology-srm-php-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nioc","download_url":"https://codeload.github.com/nioc/synology-srm-php-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243950792,"owners_count":20373664,"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":["router","srm","synology"],"created_at":"2024-10-10T01:45:15.579Z","updated_at":"2025-03-18T20:30:40.810Z","avatar_url":"https://github.com/nioc.png","language":"PHP","readme":"# Synology SRM PHP API\n\n[![license: AGPLv3](https://img.shields.io/badge/license-AGPLv3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\n[![GitHub release](https://img.shields.io/github/release/nioc/synology-srm-php-api.svg)](https://github.com/nioc/synology-srm-php-api/releases/latest)\n[![Packagist Downloads](https://img.shields.io/packagist/dt/nioc/synology-srm-php-api?label=Composer%20installs)](https://packagist.org/packages/nioc/synology-srm-php-api)\n[![GitHub all releases](https://img.shields.io/github/downloads/nioc/synology-srm-php-api/total?label=Release%20downloads)](https://github.com/nioc/synology-srm-php-api/releases)\n\nAPI wrapper for Synology Router Manager (SRM).\n\n## Key features\n-    get WAN status,\n-    get network utilization,\n-    get devices with status, IP, etc... ,\n-    get wifi devices with link quality, signal strength, max rate, band used, etc... ,\n-    get devices traffic usage (live, day, week, month),\n-    get mesh nodes with status, connected devices, etc... ,\n-    get wake-on-lan devices,\n-    get access control groups with devices, online status, etc... ,\n-    add wake-on-lan on a device,\n-    wake-on-lan a device.\n\n## Installation\n\nTo install with composer:\n```shell\ncomposer require nioc/synology-srm-php-api\n```\n\nOr download [latest release](https://github.com/nioc/synology-srm-php-api/releases/latest) zip archive,\n\n## Usage\n\n### Create client\n\n#### Create a simple client\n\n```php\n$client = new SrmClient(null, $username, $password, $hostname, $port, $https, false);\n```\n\n#### Create a client with session keeped\n\nIf you can store session id, you can pass it value to constructor. if value is `null`, client will execute a login request.\n\n```php\n$client = new SrmClient(null, $username, $password, $hostname, $port, $https, true, $sid);\n```\n\nTo retrieve session id value in order to store it:\n```php\n$sid = $client-\u003egetSid();\n```\n\n#### Create a client with logger\n\nConstructor first parameter is `LoggerInterface`, allowing you to use any PSR-3 compliant logger library (like [Monolog](https://github.com/Seldaek/monolog) or [Analog](https://github.com/jbroadway/analog)).\n\nFollowing a basic console logger with Analog:\n```php\nuse Analog\\Logger;\nuse Analog\\Handler\\EchoConsole;\n\n$logger = new Logger;\nAnalog::$format = \"%s - %s - %s - %s\\n\";\n$logger-\u003ehandler(\n    Analog\\Handler\\Threshold::init(\n        Analog\\Handler\\LevelName::init(\n            EchoConsole::init()\n        ),\n        Analog::INFO\n    )\n);\n\n$client = new SrmClient($logger, $username, $password, $hostname, $port, $https, true, $sid);\n```\n### Get devices, mesh, traffic, ...\n\nSimply call the requested client method, exemple with traffic:\n\n```php\n$devicesTraffic = $client-\u003egetTraffic('live');\n```\n\nYou can see a full exemple [here](https://github.com/nioc/synology-srm-php-api/blob/master/example.php).\n\n## Versioning\n\nThis library is maintained under the [semantic versioning](https://semver.org/) guidelines.\n\nSee the [releases](https://github.com/nioc/synology-srm-php-api/releases) on this repository for changelog.\n\n## Contributing\n\nIf you have a suggestion, please submit a [feature request](https://github.com/nioc/synology-srm-php-api/issues/new?labels=enhancement).\nPull requests are welcomed.\n\n## Credits\n\n* **[Nioc](https://github.com/nioc/)** - *Initial work*\n\nSee also the list of [contributors](https://github.com/nioc/synology-srm-php-api/contributors) to this project.\n\n## License\n\nThis project is licensed under the GNU Affero General Public License v3.0 - see the [LICENSE](LICENSE.md) file for details\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnioc%2Fsynology-srm-php-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnioc%2Fsynology-srm-php-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnioc%2Fsynology-srm-php-api/lists"}