You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,17 @@ Don't worry. Simply set sudo flag to `true`.
32
32
SystemCtl::sudo(true);
33
33
```
34
34
35
+
## How do I start/stop/restart a unit?
36
+
Simply 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`.
37
+
38
+
```php
39
+
$systemCtl = new SystemCtl();
40
+
41
+
// start/stop/enable/disable/reload/restart
42
+
$systemCtl->getService('nginx')->start();
43
+
$systemCtl->getService('nginx')->stop();
44
+
```
45
+
35
46
# How to Contribute
36
47
Simply clone the repo and install using `composer`
0 commit comments