I am trying to create an automatic deployment for a Symfony 2 project. Part of this deployment process should be the download and installation of Composer (http://getcomposer.org).
The instructions for installing Composer differ between Windows and Linux but this command seems to work on both systems:
php -r "readfile('https://getcomposer.org/installer');" | php
Basically, what this does is download a PHP script and then run it to install composer. I wanted to create my own PHP script because I wanted to avoid creating different shell scripts (.bat and .sh) for different operating systems.
My very simple PHP script looks like this:
<?php
$installer = readfile('https://getcomposer.org/installer');
eval($installer);
However, when calling this script I always get an error:
PHP Parse error: syntax error, unexpected end of file in C:\Users\chrisandomproject\getcomposer.php(4) : eval()'d code on line 1 Parse error: syntax error, unexpected end of file in C:\Users\chrisandomproject\getcomposer.php(4) : eval()'d code on line 1
It seems the script delivered by the composer server can not be executed via eval().
What other options do I have?