| Conditions | 5 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 35 | public function checkRunningAsRootUser(Event $event) |
||
| 36 | { |
||
| 37 | if ($this->_isSkipRootCheck()) { |
||
| 38 | return; |
||
| 39 | } |
||
| 40 | |||
| 41 | $config = $event->getApplication()->getConfig(); |
||
| 42 | if (!$config['application']['check-root-user']) { |
||
| 43 | return; |
||
| 44 | } |
||
| 45 | |||
| 46 | // display if current user is root |
||
| 47 | if (function_exists('posix_getuid') && posix_getuid() === 0) { |
||
| 48 | $output = $event->getOutput(); |
||
| 49 | $output->writeln(''); |
||
| 50 | $output->writeln(self::WARNING_ROOT_USER); |
||
| 51 | $output->writeln(''); |
||
| 52 | } |
||
| 53 | } |
||
| 54 | |||
| 60 |