| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public static function downloadData(Event $event) |
||
| 22 | { |
||
| 23 | $defaultOptions = [ |
||
| 24 | self::ZEND_INDEX_PATH => 'public/index.php', |
||
| 25 | ]; |
||
| 26 | $newOptions = $event->getComposer()->getPackage()->getExtra(); |
||
| 27 | $options = array_merge($defaultOptions, $newOptions); |
||
| 28 | $zendIndexPath = $options[self::ZEND_INDEX_PATH]; |
||
| 29 | $geoipDownloadCmd = 'geoip download'; |
||
| 30 | |||
| 31 | if ($event->getName() === 'post-install-cmd') { |
||
| 32 | $geoipDownloadCmd .= ' --no-clobber'; |
||
| 33 | } |
||
| 34 | $cmd = sprintf('php %s %s', $zendIndexPath, $geoipDownloadCmd); |
||
| 35 | system($cmd); |
||
| 36 | } |
||
| 37 | |||
| 39 |