* Get the Compatibility info for a chunk of code
* This example show the new options|features available with API 1.8.0
* Especially, observer and xml renderer
* @package PHP_CompatInfo
* @author Laurent Laville <pear@laurent-laville.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD
* @version CVS: $Id: pci180_parsestring_toxml.php,v 1.2 2008/07/22 20:26:45 farell Exp $
* @link http://pear.php.net/package/PHP_CompatInfo
* @since version 1.8.0b4 (2008-06-18)
require_once 'PHP/CompatInfo.php';
define('DEST_LOG_FILE', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'notify.log');
Add an observer to listen all PCI events
function pci180_debug(&$auditEvent)
$notifyName = $auditEvent->getNotificationName();
$notifyInfo = $auditEvent->getNotificationInfo();
error_log('notifyName:'. $notifyName . PHP_EOL, 3, DEST_LOG_FILE);
error_log('notifyInfo:'. PHP_EOL .
var_export($notifyInfo, true) . PHP_EOL, 3, DEST_LOG_FILE);
With API 1.8.0 you may choose a custom render,
between all default renderers (all customizable).
Here we choose to display result as XML stream,
beautified if PEAR::XML_Beautifier package is available (installed).