Conditions | 4 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | public function getCalculatedAnswer() |
||
10 | { |
||
11 | $data = shell_exec('for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done'); |
||
12 | $newLines = []; |
||
13 | foreach (explode("\n", $data) as $line) { |
||
14 | $line = trim($line); |
||
15 | if ($line) { |
||
16 | if (substr(trim($line), 0, 1) !== '#') { |
||
17 | $newLines[] = $line; |
||
18 | } |
||
19 | } |
||
20 | } |
||
21 | return implode("\n", $newLines); |
||
22 | } |
||
31 |