Beispiel #1
0
function DB_lo_read_all($id)
{
    if (strcmp(phpversion(), '4.2.0') < 0) {
        return pg_loreadall($id);
    } else {
        return pg_lo_read_all($id);
    }
}
 function BlobDecode($blob)
 {
     @pg_exec("begin");
     $fd = @pg_lo_open($blob, "r");
     if ($fd === false) {
         @pg_exec("commit");
         return $blob;
     }
     $realblob = @pg_loreadall($fd);
     @pg_loclose($fd);
     @pg_exec("commit");
     return $realblob;
 }
Beispiel #3
0
 function BlobDecode($blob)
 {
     if (strlen($blob) > 24) {
         return $blob;
     }
     @pg_exec($this->_connectionID, "begin");
     $fd = @pg_lo_open($this->_connectionID, $blob, "r");
     if ($fd === false) {
         @pg_exec($this->_connectionID, "commit");
         return $blob;
     }
     $realblob = @pg_loreadall($fd);
     @pg_loclose($fd);
     @pg_exec($this->_connectionID, "commit");
     return $realblob;
 }
Beispiel #4
0
 function Read()
 {
     if (!$this->oid) {
         echo "{$this->error}<br>\n";
     } else {
         if (version_compare(phpversion(), "4.2.0", "ge") > 0) {
             $this->result = pg_lo_read_all($this->result, $data);
         } else {
             $this->result = pg_loreadall($this->result, $data);
         }
     }
     return $this->result;
 }