Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
scripts/run-tests.sh hard codes /usr/bin/php as its interpreter. This patch seamlessly discovers your interpreter in 99% of use cases. For the others, it adds the ability to pass in the path to your php as a command line argument.
Comment | File | Size | Author |
---|---|---|---|
#6 | 311160-auto-discover-php-interpreter.patch | 2.06 KB | Damien Tournoud |
#5 | mw.patch | 2.58 KB | moshe weitzman |
#4 | mw.patch | 2.52 KB | moshe weitzman |
#3 | mw.patch | 2.02 KB | moshe weitzman |
#1 | mw.patch | 1.65 KB | moshe weitzman |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedHelp from DamZ - now SUDO_COMMAND case gets only the interpreter
Comment #2
Dries CreditAttribution: Dries commentedInteresting little patch. Can you add a line documentation the
$_ENV['_'];
case? I'm not familiar with$_ENV['_'];
. We might want to add a line aboutSUDO_COMMAND
too. Thanks!Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedAdded comments and error handling in case when php path cannot be found and was not supplied.
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedNow with escapeshellarg($php) and typos fixed in code comments.
Comment #5
moshe weitzman CreditAttribution: moshe weitzman commentedAdded a comment above escapeshellarg() and changed php => PHP three times.
Comment #6
Damien Tournoud CreditAttribution: Damien Tournoud commentedHere is a fix for the patch in #5, should be ready to go in as-is.
Comment #7
moshe weitzman CreditAttribution: moshe weitzman commentedThanks a bunch, Damien. Code and functionality look good.
Comment #8
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD! Thanks for the improvements. I like. :)
Comment #9
boombatower CreditAttribution: boombatower commentedFirst off this no longer works on SUSE 11.0 with PHP in /usr/bin/php which is annoying.
I can get it to run by using --php with path, but when I try to run tests the error pops up again. I'm guess it doesn't pass it along correctly.
Anyone confirm?
Comment #10
webchick@boombatower: If you revert this patch, do you still get the same problem? I found a bug where if you run this via ./run-tests.sh (rather than php run-tests.sh) you get tons of errors, but it happened before this patch too.
Comment #11
boombatower CreditAttribution: boombatower commentedIt runs without patch and I don't have to specify --php.
It appears to be a bit more quirky then when I left it (even without patch). :(
I can't just do:
Instead I have to use --class or something else...either bad documentation or borken.
but it runs when I do that. I get 34 fails....hmm
seems to be quiet broken.
Comment #12
clemens.tolboom(// $Id: run-tests.sh,v 1.12 2008/09/24 19:00:31 webchick Exp $)
It's weird to run a '.sh' script with php. I was about to commit a shebang
#!/usr/bin/php
patch but now I don't know if this script is intended to run like./scripts/run-tests.sh
. If not why not replace the extension to '.php'?When running as a normal user or www-data (not root
php ./scripts/run-tests.sh --list
lists nothing. Running tests from admin/build/testing is doing ok.Comment #13
moshe weitzman CreditAttribution: moshe weitzman commented@clemens - i agree, but thats a separate issue. this script used to be called run-functional-tests and had a .php extension at one time. see http://cvs.drupal.org/viewvc.py/drupal/drupal/scripts/?pathrev=DRUPAL-6. i don't know why it extension.
fyi, drush's shebang is '#!/usr/bin/env php' which is slightly prefereable AFAIK.
Comment #14
Damien Tournoud CreditAttribution: Damien Tournoud commentedHaving a shebang will make us loose the ability to autodetect the path of the running PHP interpreter. For simpletest, it is *critical* that we know this information and that child scripts are run in the exact same interpreter => I guess this is a won't fix, but documentation could be improved (for example, it is not stated anywhere that run-tests should be ran using the exact same user as Apache).
The .sh extension is there to prevent the script from being executed by Apache. There are other solutions (detecting the sapi, using .htaccess, etc.). Improvements are welcome.
I don't see why running php thru even is better. Could someone explain this?
Comment #15
moshe weitzman CreditAttribution: moshe weitzman commentedThe remaining gripes are not elated to this patch. Please open new issues as needed.
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.