It's possible that the problem is that updating PHP also updated PEAR::DB, and 
it bumped up to a version that doesn't get along with LibStats. Do you happen 
to have any record of the PEAR versions that were running on your server before 
the upgrade so that you can compare them against current versions? It might be 
possible to simply downgrade the dependency to restore previous functionality 
(though of course you then run the risk of running into some other 
incompatibility between an old version of the library and PHP 7... it's never 
easy!).

For what it's worth, users running very old versions of VuFind (from before it 
switched from PEAR::DB_DataObject to Zend\Db as its abstraction layer) 
occasionally complain about breaks after upgrading PHP, and the solution 
usually turns out to be "downgrade to a specific old version of 
PEAR::DB_DataObject." I'm not sure if this also applies to plain old PEAR::DB, 
but it's worth investigating if you have the option.

Good luck!

- Demian

-----Original Message-----
From: Code for Libraries [mailto:[email protected]] On Behalf Of Will 
Martin
Sent: Thursday, August 25, 2016 12:52 PM
To: [email protected]
Subject: [CODE4LIB] LibStats, PEAR, PHP 7

All,

A recent server upgrade seems to have broken our installation of LibStats.  It 
appears that the database abstraction layer it uses, PEAR::DB, is not working 
correctly.  Once instantiated, it's supposed to have methods like getOne() and 
getAll() that execute a SQL query and retrieve the results; but keeps 
complaining that these are undefined.

I'm pretty sure this has something to do with the fact that the upgrade
-- to Ubuntu 16.04.1 LTS -- installed PHP 7, up from 5.6.  According to the 
PEAR web site, PEAR::DB is supposed to be compatible with PHP 7 despite being 
ancient and crufty, but it's not working.

Anyone have any insight on how to get PEAR::DB to play nice in its new 
environment?  Because the other option would be going in and rewriting all the 
database queries to use a more modern database abstraction layer.  Probably 
PDO.  That's certainly doable, but it'd be quite a pretty fair chunk of work, 
and in the meantime our reference and access services staff can't log their 
stats normally.

Will Martin

Reply via email to