|
@@ 515-520 (lines=6) @@
|
| 512 |
|
if (substr($os, 0, 3) == 'win') { |
| 513 |
|
$url = preg_replace('win/', 'win32/', $url); |
| 514 |
|
$data = @file_get_contents($url, false, null); |
| 515 |
|
if ($data === false) { |
| 516 |
|
// there is nothing more we can do |
| 517 |
|
$message = sprintf('Could not download the executable <info>%s</info>', $executable); |
| 518 |
|
|
| 519 |
|
return Result::error($this, $message); |
| 520 |
|
} |
| 521 |
|
} |
| 522 |
|
// if it is not windows there is nothing we can do |
| 523 |
|
$message = sprintf('Could not download the executable <info>%s</info>', $executable); |
|
@@ 539-543 (lines=5) @@
|
| 536 |
|
$path = $this->executableTargetDir . '/' . $executable . '.exe'; |
| 537 |
|
} |
| 538 |
|
$result = file_put_contents($path, $data); |
| 539 |
|
if ($result === false) { |
| 540 |
|
$message = sprintf('Could not copy the executable <info>%s</info> to %s', $executable, $path); |
| 541 |
|
|
| 542 |
|
return Result::error($this, $message); |
| 543 |
|
} |
| 544 |
|
// set the binary to executable |
| 545 |
|
chmod($path, 0755); |
| 546 |
|
|