34 require_once realpath(dirname(__FILE__).
"/cache.inc");
65 $startTime = microtime(
true);
68 $endTime = microtime(
true);
69 trace(
"Connection opened in ".number_format($endTime-$startTime, 3).
" seconds", 3);
74 catch(PDOException $e)
76 trace(
"Database connection failed - " . $e->getMessage(), 1);
89 $startTime = microtime(
true);
91 $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
92 $endTime = microtime(
true);
93 trace(
"New connection opened in ".number_format($endTime-$startTime, 3).
" seconds", 3);
96 catch(PDOException $e)
98 trace(
"Database connection failed - " . $e->getMessage(), 1);
132 $escaped = preg_replace(
"/^'(.*)'$/",
"$1", $quoted);
133 trace(
"ESCAPE: $str -> $quoted -> $escaped", 1);
147 $version =
$conn->query(
'select version()')->fetchColumn();
static get($key)
Retrieve the specified object from the cache.
static put($key, $obj, $ttl=0)
Store the specified object in the cache at the specified key.
The ConnectionManager class provides the common point of entry by which DataItems can access the glob...
static quote($str)
Quote a string value based on the character set of the global connection.
static releaseConnection()
Releases the global connection to the database.
static newConnection()
Returns a new connection to the database.
static getVersion()
Determine the version of the connected database.
static getConnection()
Retrieves a reference to the global database connection.
static escape($str)
Escapes a string based on the character set of the global connection.
trace($msg, $lvl=3, $callStack=null)
Send output to the trace log.