Closed iturgeon closed 11 years ago
:+1:
Probably an idea to take in the interpreter as an optional parameter also as some of us run multi-versioned environments where php
is not 5.4
Phil
@phil-lavin I don't have any experience running a multi-environment, point me to some documentation or describe how it works?
[website_admin@linux2:~]$ php -v
PHP 5.2.17 (cli) (built: Jan 17 2011 12:51:24)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v3.1.28, Copyright (c) 2002-2007, by ionCube Ltd.
[website_admin@linux2:~]$ php.54 -v
PHP 5.4.9 (cli) (built: Nov 26 2012 13:10:25)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
[website_admin@linux2:~]$
The addition to your code would be to accept an optional command line param of the interpreter, else default to using php.
Updated the gist to account for @phil-lavin's input.
@WanWizard when you get a chance, feedback on if we think this should go in?
Some of my team are working on updating the Fuelphp crash course. It would be a MUCH simpler document with this in place.
The new 5.4 built in server would be perfect to get running with fuelphp in a very quick way. You, of course, know Rails and Django do this sort of thing, but php has just caught up. It'd be great to use it as a first class citizen in fuel.
Anyway, I basically abstracted all the arguments for the built in server with oil arguments. This ends up running via passthru(), which works, but I'm not sure if there's a better method.
I'm not sure why passthru() doesn't echo the first output from php -S, so I just reproduced them manually in the code for oil.
The bootstrap_dev.php file acts as the router file - terminology from the dev server docs. It'll mimic the default url rewriting. I think this could be a little more robust by allowing one to override default behavior by placing a bootstrap_dev.php in the app directory.
https://gist.github.com/iturgeon/5238182
Anyway, I think it could be a pretty awesome feature. I'd like to put it into 1.6 or 1.7? and leave it undocumented / document it as requiring 5.4.