Ejemplo n.º 1
0
 function disconnect()
 {
     if ($this->connectionId > 0) {
         $res = linter_close_connect($this->connectionId);
         if ($res < 0) {
             $this->log("Disconnect failed: #" . $this->connectionId);
         } else {
             $this->log("Disconnected: #" . $this->connectionId);
         }
         $this->cursorPool = array();
         $this->connectionId = null;
     }
 }
Ejemplo n.º 2
0
echo "native linter fetching: " . (microtime(true) - $mark) . "\n";
$conn = lmbDBAL::newConnection('linter://*****:*****@localhost/Demo');
$mark = microtime(true);
for ($i = 0; $i < 1000; $i++) {
    $rs = lmbDBAL::fetch('SELECT "bar" FROM "foo";', $conn);
    foreach ($rs as $record) {
        $bar = $record['bar'];
    }
    $rs->freeQuery();
}
echo "lmbDBAL :: fetch(), array access: " . (microtime(true) - $mark) . "\n";
$mark = microtime(true);
for ($i = 0; $i < 1000; $i++) {
    $rs = lmbDBAL::fetch('SELECT "bar" FROM "foo";', $conn);
    foreach ($rs as $record) {
        $bar = $record->get('bar');
    }
    $rs->freeQuery();
}
echo "lmbDBAL :: fetch(), getter: " . (microtime(true) - $mark) . "\n";
$mark = microtime(true);
for ($i = 0; $i < 1000; $i++) {
    $stmt = $conn->newStatement('SELECT "bar" FROM "foo";');
    $rs = $stmt->getRecordSet();
    foreach ($rs as $record) {
        $bar = $record->get('bar');
    }
}
echo "lmbLinterConnection :: newStatement(), getter: " . (microtime(true) - $mark) . "\n";
linter_close_connect($linter_db);