Skip to content

Commit d94204f

Browse files
committed
Add timeout docu to readme
Remove crlf from certain files. Add gitattributes
1 parent a8480c4 commit d94204f

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ PHP wrapper for systemctl (PHP7.1)
2525
SystemCtl::setBinary('/bin/systemctl');
2626
```
2727

28+
## How to change command timeout
29+
To change command tmeout simply call the static method `setTimeout`.
30+
```php
31+
SystemCtl::setTimeout(10);
32+
```
33+
34+
> The default timeout is set to `3` seconds
35+
2836
## "I need sudo to run commands"
2937
If you need sudo, you should execute the bin executable with sudo.
3038
The incode support was dropped due to security reason.

src/SystemCtl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function getService(string $name): Service
111111

112112
/**
113113
* @param null|string $unitPrefix
114-
* @return array|Service[]
114+
* @return Service[]
115115
*/
116116
public function getServices(?string $unitPrefix = null): array
117117
{
@@ -133,7 +133,7 @@ public function getTimer(string $name): Timer
133133

134134
/**
135135
* @param null|string $unitPrefix
136-
* @return array|Timer[]
136+
* @return Timer[]
137137
*/
138138
public function getTimers(?string $unitPrefix = null): array
139139
{

tests/SystemCtlTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ public function testGetTimers()
152152

153153
public function testSetBinaryShouldChangeCommand()
154154
{
155-
// Reset sudo to default
156155
$systemCtl = new SystemCtl();
157156

158157
$processBuilder = $systemCtl->getProcessBuilder();

0 commit comments

Comments
 (0)