Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currently used PHP binary for oil to run phpunit #135

Closed
lukearmstrong opened this issue Jul 2, 2012 · 1 comment
Closed

Currently used PHP binary for oil to run phpunit #135

lukearmstrong opened this issue Jul 2, 2012 · 1 comment

Comments

@lukearmstrong
Copy link

I talked to WanWizard in IRC about this earlier.

$_ENV['_']/$_SERVER['_'] only exists in certain usages of Linux, it may be that I am using a login shell instead of a standard shell? It never exists in Windows.

PHP_BINARY constant only exists in PHP >= 5.4 for Windows or Linux.

<?php

$binary = defined('PHP_BINARY') ? PHP_BINARY : (array_key_exists('_', $_SERVER) ? $_SERVER['_'] : '/usr/bin/env php');

Or this may be better, so that phpunit runs as an executable as it currently does if no binary is determined, as I imagine /usr/bin/env php doesn't exist on Windows

<?php

$binary = defined('PHP_BINARY') ? PHP_BINARY : (array_key_exists('_', $_SERVER) ? $_SERVER['_'] : '');

So use either of the above in fuel/packages/oil/classes/command.php at around Line 175, and change the line that follows to this...

<?php

// CD to the root of Fuel and call up phpunit with the path to our config
$command = 'cd '.DOCROOT.'; '.$binary.' phpunit -c "'.$phpunit_config.'"';

Though obviously this is just a suggestion to start a discussion, and not a pull request, as the code may be better off being somewhere else, as it may be useful in more than one place.

@WanWizard
Copy link
Member

This code no longer exist, the phpunit command is now configurable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants