Tag Archives: pear

howto use php pear horde utilities whilst avoiding the ubuntu14 apache2 php5 pear includefile bug

on an ubuntu 14 apache 2 php 5 install if you look at your php include_path it may look like this

include_path .:/usr/share/php:/usr/share/pear 

which is WRONG because there is no /usr/share/pear directory in fact on ubuntu 14 php 5 pear is installed in /usr/share/php/PEAR and horde is installed in /usr/share/php/Horde

so to enable autoloading to allow you to automatically use a horde class just

install pear horde

# pear channel-discover pear.horde.org
# pear install horde/Horde_Autoloader
# pear install horde/Horde_Text_Diff


require_once 'Horde/Autoloader/Default.php';

then whenever you use any horde class library (that you have previously downloaded and installed) it will be autoloaded

$check_diff = new Horde_Text_Diff( 'auto', array($a_lines, $b_lines) );
$renderer = new Horde_Text_Diff_Renderer_Inline();

#php #phpunit unit testing

there are a number of php pear phpunit unit test librarys floating around 1.3.2, 2.3.6, 3.7.21 & 3.8.x but currently i would NOT install OLD versions of phpunit from ubuntu repo or default pear repo BUT install phpunit 3.7.21 from phpunit.de instead


# pear channel-discover pear.phpunit.de
# pear channel-discover pear.symfony.com
# pear remote-list -c phpunit
# pear install --alldeps phpunit/PHPUnit
# pear list -c phpunit