tags:

views:

126

answers:

2

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 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"?

A: 

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'

kguest
This way suits for calling php-scripts manually from command line. PHPUnit that’s installed from PEAR has is’s own hardcoded path to PHP interpreter, and setting an alias will give no effect.
Sergei Morozov
A: 

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
Dan G