Monthly Archives: November 2014

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

then

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();

mysql config files, global, commandline options and session variables

you seem to be able to set global and command line options variables in mysql config files but not session variables so you’ll need to create a .my.cnf file with your favorite global and command line options and a separate mysql.sql file with your favorite session variables and source it once logged in

ie

.my.cnf

[mysql]
user=user
password=password

mysql.sql

#
set sql_quote_show_create=OFF

mysql

mysql> source ~/mysql.sql

see also

https://dev.mysql.com/doc/refman/5.5/en/option-files.html