/** * @package WACT_DB * @version $Id: pear.inc.php,v 1.31 2004/11/20 18:09:47 jeffmoore Exp $ */ //-------------------------------------------------------------------------------- /** * Make sure dataspace is loaded */ if (!class_exists('DataSpace')) { require WACT_ROOT . 'util/dataspace.inc.php'; } /** * Include PEAR::DB */ if (!defined('PEAR_LIBRARY_PATH')) { define('PEAR_LIBRARY_PATH', ConfigManager::getOptionAsPath('config', 'pear', 'library_path')); } if (!@(include_once PEAR_LIBRARY_PATH . 'DB.php')) { RaiseError('runtime', 'LIBRARY_REQUIRED', array('library' => 'PEAR::DB', 'path' => PEAR_LIBRARY_PATH)); } //-------------------------------------------------------------------------------- /** * Encapsulates a database connection. Allows for lazy connections. * implements Connection interface * @see Connection * @see http://wact.sourceforge.net/index.php/Connection * @access public * @package WACT_DB */ class PearConnection {
define('TMPL_FILESCHEME_PATH', TEST_ROOT . '/filescheme/'); error_reporting(E_ALL); set_time_limit(600); ini_set('memory_limit', '128M'); /* Used to determine output to display */ define('DW_TESTS_OUTPUT_HTML', 1); define('DW_TESTS_OUTPUT_XML', 2); if (isset($_GET['output']) && $_GET['output'] == 'xml') { define('DW_TESTS_OUTPUT', DW_TESTS_OUTPUT_XML); } else { define('DW_TESTS_OUTPUT', DW_TESTS_OUTPUT_HTML); } require_once 'lib/testmanager.php'; TestManager::setup('tests.ini'); if (!defined('SIMPLE_TEST')) { define('SIMPLE_TEST', ConfigManager::getOptionAsPath('tests', 'simpletest', 'library_path')); } if (!@(include_once SIMPLE_TEST . 'reporter.php')) { RaiseError('runtime', 'LIBRARY_REQUIRED', array('library' => 'Simple Test', 'path' => SIMPLE_TEST)); } function &DW_TESTS_GetReporter() { static $Reporter = NULL; if (!$Reporter) { switch (DW_TESTS_OUTPUT) { case DW_TESTS_OUTPUT_XML: require_once SIMPLE_TEST . 'xml.php'; $Reporter = new XmlReporter(); break; case DW_TESTS_OUTPUT_HTML: default: