{"id":13404989,"url":"https://github.com/icanhazstring/systemctl-php","last_synced_at":"2025-06-21T21:03:21.666Z","repository":{"id":45222292,"uuid":"92149145","full_name":"icanhazstring/systemctl-php","owner":"icanhazstring","description":"PHP wrapper for systemctl","archived":false,"fork":false,"pushed_at":"2023-06-27T07:32:39.000Z","size":223,"stargazers_count":73,"open_issues_count":3,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-17T04:40:19.092Z","etag":null,"topics":["php","php-systemctl","php-wrapper","systemctl","systemctl-php","systemd","systemd-php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icanhazstring.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-05-23T08:35:23.000Z","updated_at":"2025-03-22T12:06:54.000Z","dependencies_parsed_at":"2024-01-16T10:37:45.424Z","dependency_job_id":"ca18ec73-a635-49b0-b2dd-1959e96789e8","html_url":"https://github.com/icanhazstring/systemctl-php","commit_stats":{"total_commits":82,"total_committers":9,"mean_commits":9.11111111111111,"dds":0.5487804878048781,"last_synced_commit":"1923834b2d92abf532bbf001e62cff5ab97ef8f4"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/icanhazstring/systemctl-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Fsystemctl-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Fsystemctl-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Fsystemctl-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Fsystemctl-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icanhazstring","download_url":"https://codeload.github.com/icanhazstring/systemctl-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Fsystemctl-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261193088,"owners_count":23122904,"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":["php","php-systemctl","php-wrapper","systemctl","systemctl-php","systemd","systemd-php"],"created_at":"2024-07-30T19:01:54.216Z","updated_at":"2025-06-21T21:03:16.648Z","avatar_url":"https://github.com/icanhazstring.png","language":"PHP","readme":"# systemctl-php\n![CI Pipeline](https://github.com/icanhazstring/systemctl-php/workflows/CI%20Pipeline/badge.svg) [![Code Climate](https://codeclimate.com/github/icanhazstring/systemctl-php/badges/gpa.svg)](https://codeclimate.com/github/icanhazstring/systemctl-php) [![Test Coverage](https://codeclimate.com/github/icanhazstring/systemctl-php/badges/coverage.svg)](https://codeclimate.com/github/icanhazstring/systemctl-php/coverage) [![Join the chat at https://gitter.im/icanhazstring/systemctl-php](https://badges.gitter.im/icanhazstring/systemctl-php.svg)](https://gitter.im/icanhazstring/systemctl-php?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nPHP wrapper for systemctl\n\n# How to install\n```php\n$ composer require icanhazstring/systemctl-php\n```\n\n## Current supported units\nSee [Units](src/Unit)\n\n\u003e If you like to add support for more units, feel free to grab an issue and contribute.\n\n## Current supported commands\n- start\n- stop\n- enable\n- disable\n- reload\n- restart\n- isEnabled\n- isActive\n\n\u003e If you like to add support for more commands, feel free to contribute.\n\n## How to change the binary\n\n```php\nSystemCtl::setBinary('/bin/systemctl');\n```\n\n## How to change command timeout\nTo change command tmeout simply call the static method `setTimeout`.\n```php\nSystemCtl::setTimeout(10);\n```\n\n\u003e The default timeout is set to `3` seconds\n\n## \"I need sudo to run commands\"\nIf you need sudo, you should execute the bin executable with sudo.\nThe incode support was dropped due to security reason.\n\n## How do I start/stop/restart a unit?\nSimply is that. First we instantiate a `SystemCtl` instance an load a unit from a specific type. Here we use a `Service`. You will always get back `true` if the command succeeded. Otherwise the method will throw a `CommandFailedException`.\n\n```php\n$systemCtl = new SystemCtl();\n\n// start/stop/enable/disable/reload/restart\n$systemCtl-\u003egetService('nginx')-\u003estart();\n$systemCtl-\u003egetService('nginx')-\u003estop();\n```\n\n# How to Contribute\nClone the repo and install using `composer`\n\n```bash\n$ composer install\n```\n\nMake your changes and make sure you run *test*, *codesniffer* and *phpstan*.\n\n```bash\n$ composer test\n\u003e vendor/bin/phpunit\nPHPUnit 9.5.3 by Sebastian Bergmann and contributors.\n\n...............................................................  63 / 128 ( 49%)\n............................................................... 126 / 128 ( 98%)\n..                                                              128 / 128 (100%)\n\nTime: 00:00.033, Memory: 10.00 MB\n\nOK (128 tests, 192 assertions)\n\n$ composer cs\n\u003e vendor/bin/phpcs --standard=PSR2 src/ \u0026\u0026 vendor/bin/phpcs --standard=PSR2 tests/\n\n$\n\n$ composer analyse\n\u003e vendor/bin/phpstan analyse --no-progress\nNote: Using configuration file /data/systemctl-php/phpstan.neon.\n\n\n [OK] No errors\n\n$\n```\n\n# Credits\nThis library is heavily influenced by [@mjanser](https://github.com/mjanser) [php-systemctl](https://github.com/mjanser/php-systemctl).\n","funding_links":[],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficanhazstring%2Fsystemctl-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficanhazstring%2Fsystemctl-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficanhazstring%2Fsystemctl-php/lists"}