PEAR/PHPUnit installation on shared hosting
I’ve installed a local (per-account) PEAR instance on shared web-hosting. After that I’ve installed PHPUnit. It doesn’t work in command-line mode because 开发者_JS百科PHPUnit classes are not under default include_path that is ".:/usr/local/lib/php".
The same, I think, would happen with local phing and other command-line tools installed via PEAR.
Is there a way to specify per-account include_path value that will contain my local PEAR path "~/pear/php"?
you could set this up in a local php.ini in your home account (~/php.ini perhaps) and then set an alias: $alias php='/usr/bin/php -c ~/php.ini'
This is a bit late, but a workable solution is to work out of "~/pear/php", and from there do phpunit --include-path . It's ugly, but should do the job. You could probably stick a script in whatever directory you're running the tests out of that will handle it for you.
#!/bin/sh
cur=$(pwd)
cd ~/pear/php
phpunit --includepath $cur $@
cd $cur
精彩评论