• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP pg_lo_open函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中pg_lo_open函数的典型用法代码示例。如果您正苦于以下问题:PHP pg_lo_open函数的具体用法?PHP pg_lo_open怎么用?PHP pg_lo_open使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了pg_lo_open函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: loOpen

 public function loOpen($oid, $mode)
 {
     assert('is_int($oid)');
     assert('is_string($mode)');
     $loid = pg_lo_open($this->_pg, $oid, $mode);
     return new PostgreSQLLOB($this->_pg, $loid);
 }
开发者ID:mai7star,项目名称:fake,代码行数:7,代码来源:PostgreSQL.php


示例2: DB_lo_open

function DB_lo_open($conn, $file, $mode)
{
    if (strcmp(phpversion(), '4.2.0') < 0) {
        return pg_loopen($conn, $file, $mode);
    } else {
        return pg_lo_open($conn, $file, $mode);
    }
}
开发者ID:sbaldrich,项目名称:boca,代码行数:8,代码来源:getextdata.php


示例3: getstreamblob

 public function getstreamblob($oid)
 {
     $this->query = pg_query($this->dbhandle, "begin");
     $handle = pg_lo_open($this->dbhandle, $oid, "r");
     $blob = pg_lo_read_all($handle);
     pg_query($this->dbhandle, "commit");
     return $blob;
     //TODO: kontola, ali je bil query ok izveden!
 }
开发者ID:danetteCafe,项目名称:Polar-Flowlink-linux,代码行数:9,代码来源:dbf.php


示例4: escrita

 /**
  * Escreve objeto oid com o arquivo informado
  * @param integer $iOid
  * @param string  $sCaminhoArquivo
  * @return boolean
  */
 public static function escrita($sCaminhoArquivo, $iOid = null)
 {
     global $conn;
     if (!db_utils::inTransaction()) {
         throw new Exception("Sem transação Ativa.");
     }
     $rsLargeObject = pg_lo_open($conn, $iOid, "w");
     $sConteudoArquivo = file_get_contents($sCaminhoArquivo);
     $escrita = pg_lo_write($rsLargeObject, $sConteudoArquivo);
     return $escrita;
 }
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:17,代码来源:DBLargeObject.php


示例5: stream_open

 function stream_open($path, $mode)
 {
     $path = trim(parse_url($path, PHP_URL_HOST));
     if ($path) {
         if ($this->dbh = pg_connect($path)) {
             if (pg_query($this->dbh, 'BEGIN')) {
                 if (is_resource($this->loh = pg_lo_open($this->dbh, $this->lon = self::$loId, $mode))) {
                     pg_lo_seek($this->loh, 0, PGSQL_SEEK_END);
                     $this->size = (int) pg_lo_tell($this->loh);
                     pg_lo_seek($this->loh, 0, PGSQL_SEEK_SET);
                     return true;
                 }
             }
         }
     }
     return false;
 }
开发者ID:garybulin,项目名称:php7,代码行数:17,代码来源:PgLobStream.php


示例6: getPoster

 public function getPoster($oid)
 {
     //TODO check good run
     $connection = $this->_em->getConnection();
     $database = pg_connect("host=" . $connection->getHost() . " port=5432 dbname=" . $connection->getDatabase() . " user=postgres");
     $stat = pg_connection_status($database);
     if ($stat !== PGSQL_CONNECTION_OK) {
         return null;
     }
     ob_start();
     pg_query($database, "begin");
     $handle = pg_lo_open($database, $oid, "r");
     pg_lo_read_all($handle);
     pg_query($database, "commit");
     $imgContent = ob_get_contents();
     ob_end_clean();
     return $imgContent;
 }
开发者ID:dadaperso,项目名称:APIVIdeoDada,代码行数:18,代码来源:PosterRepository.php


示例7: copy_db_image

function copy_db_image($dbconn, $row, $wfd, $header = null)
{
    $oid = $row['image_blob'];
    $type = $row['image_type'];
    if (isset($header)) {
        header("Content-type: image/" . $row['image_type']);
    }
    $fd = pg_lo_open($dbconn, $oid, 'r');
    if ($fd) {
        $str = pg_lo_read($fd, 8192);
        do {
            fwrite($wfd, $str, strlen($str));
        } while ($str = pg_lo_read($fd, 8192));
        pg_lo_close($fd);
    } else {
        error_log("Unable to open oid {$oid} in db: " . pg_last_error());
    }
}
开发者ID:JazzHandsCMDB,项目名称:jazzhands,代码行数:18,代码来源:picture.php


示例8: pg_lo_write

    echo "pg_lo_open() error\n";
}
pg_lo_write($handle, "large object data\n");
pg_lo_close($handle);
pg_exec($db, "commit");
echo "open/read/tell/seek/close LO\n";
pg_exec($db, "begin");
$handle = pg_lo_open($db, $oid, "w");
pg_lo_read($handle, 100);
pg_lo_tell($handle);
pg_lo_seek($handle, 2);
pg_lo_close($handle);
pg_exec($db, "commit");
echo "open/read_all/close LO\n";
pg_exec($db, "begin");
$handle = pg_lo_open($db, $oid, "w");
pg_lo_read_all($handle);
if (pg_last_error()) {
    echo "pg_lo_read_all() error\n" . pg_last_error();
}
pg_lo_close($handle);
pg_exec($db, "commit");
echo "unlink LO\n";
pg_exec($db, "begin");
pg_lo_unlink($db, $oid) or print "pg_lo_unlink() error 1\n";
pg_exec($db, "commit");
// more pg_lo_unlink() tests
echo "Test without connection\n";
pg_exec($db, "begin");
$oid = pg_lo_create($db) or print "pg_lo_create() error\n";
pg_lo_unlink($oid) or print "pg_lo_unlink() error 2\n";
开发者ID:badlamer,项目名称:hhvm,代码行数:31,代码来源:05large_object.php


示例9: large_object_fetch

 function large_object_fetch($oid, $return = false)
 {
     trigger_before('large_object_fetch', $this, $this);
     //$result = pg_query($this->conn,"SELECT $field FROM $table WHERE $");
     //if (!$result) { trigger_error("Error in select file OID", E_USER_ERROR ); }
     //$oid = pg_result($result,0,$fieldname);
     //if (!$oid) { trigger_error("Error in file OID result", E_USER_ERROR ); }
     $result = @pg_query($this->conn, "BEGIN");
     if (!$result) {
         trigger_error("error starting l_o_f transaction: " . @pg_last_error($this->conn), E_USER_ERROR);
     }
     $handle = @pg_lo_open($this->conn, $oid, "r");
     if (!$handle) {
         trigger_error("error in l_o_f/l_o_o: " . @pg_last_error($this->conn), E_USER_ERROR);
     }
     if ($return === true) {
         return @pg_lo_read($handle, $this->max_blob_length);
     } else {
         @pg_lo_read_all($handle);
     }
     if (!$buffer) {
         trigger_error("error in l_o_read_all: " . @pg_last_error($this->conn), E_USER_ERROR);
     }
     $result = @pg_lo_close($handle);
     if (!$result) {
         trigger_error("error in l_o_close: " . @pg_last_error($this->conn), E_USER_ERROR);
     }
     $result = @pg_query($this->conn, "COMMIT");
     if (!$result) {
         trigger_error("error committing l_o_f transaction: " . @pg_last_error($this->conn), E_USER_ERROR);
     }
     return $return;
 }
开发者ID:voitto,项目名称:dbscript,代码行数:33,代码来源:postgresql.php


示例10: stream_open

 function stream_open($path, $mode)
 {
     if (!($this->conn = HTTP_Download_PgLOB::getConnection())) {
         return false;
     }
     if (!preg_match('/(\\d+)/', $path, $matches)) {
         return false;
     }
     $this->ID = $matches[1];
     if (!pg_query($this->conn, 'BEGIN')) {
         return false;
     }
     $this->handle = pg_lo_open($this->conn, $this->ID, $mode);
     if (!is_resource($this->handle)) {
         return false;
     }
     // fetch size of lob
     pg_lo_seek($this->handle, 0, PGSQL_SEEK_END);
     $this->size = (int) pg_lo_tell($this->handle);
     pg_lo_seek($this->handle, 0, PGSQL_SEEK_SET);
     return true;
 }
开发者ID:quangbt2005,项目名称:vhost-kis,代码行数:22,代码来源:PgLOB.php


示例11: pg_query

 *  detalhes.                                                         
 *                                                                    
 *  Voce deve ter recebido uma copia da Licenca Publica Geral GNU     
 *  junto com este programa; se nao, escreva para a Free Software     
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA          
 *  02111-1307, USA.                                                  
 *  
 *  Copia da licenca no diretorio licenca/licenca_en.txt 
 *                                licenca/licenca_pt.txt 
 */
include "libs/db_stdlib.php";
include "libs/db_sql.php";
//############## teste ####################
if (isset($oid_arq) && $oid_arq != "") {
    pg_query($conn, "begin");
    $loid = pg_lo_open($conn, $oid_arq, "r");
    header('Accept-Ranges: bytes');
    //header('Content-Length: 32029974'); //this is the size of the zipped file
    header('Keep-Alive: timeout=15, max=100');
    $sqloid = "select * from liclicitaedital where l27_arquivo = {$oid_arq}";
    $resultoid = pg_query($sqloid);
    //$result_nomearq = $cltarefaanexos->sql_record($cltarefaanexos->sql_query_file(null,"*",null,"at25_anexo = '$oid_arq'"));
    db_fieldsmemory($resultoid, 0);
    //header('Content-type: Application/x-zip');
    header('Content-Disposition: attachment; filename="' . $l27_arqnome . '"');
    pg_lo_read_all($loid);
    pg_lo_close($loid);
    pg_query($conn, "commit");
    exit;
}
//#########################3
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:31,代码来源:lic_baixaedital.php


示例12: BlobDecode

 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;
 }
开发者ID:BackupTheBerlios,项目名称:osiswebprinter,代码行数:13,代码来源:adodb-postgres64.inc.php


示例13: readFlushLargeObject

 /**
  * Reads an entire large object and send it to the browser
  */
 function readFlushLargeObject($lo_oid)
 {
     $connection = $this->connect(NULL);
     // Large objects calls MUST be enclosed in transaction block
     // remember, large objects must be obtained from within a transaction
     pg_query($connection, "begin");
     $handle_lo = pg_lo_open($connection, $lo_oid, "r") or die("<h1>Error.. can't get handle</h1>");
     pg_lo_read_all($handle_lo) or die("<h1>Error, can't read large object.</h1>");
     // committing the data transaction
     pg_query($connection, "commit");
 }
开发者ID:cnlangzi,项目名称:wifidog-auth,代码行数:14,代码来源:AbstractDb.php


示例14: pgsqlLOBOpen

 public function pgsqlLOBOpen($oid)
 {
     if (!($stream = tmpfile())) {
         $this->set_error(7, 'Could not create tem file', 'HY000', PDO::ERRMODE_EXCEPTION, 'pgsqlLOBOpen');
     }
     if (!($lo_stream = pg_lo_open($this->link, $oid, 'w'))) {
         $this->set_error(null, PDO::ERRMODE_EXCEPTION, 'pgsqlLOBOpen');
     }
     $this->los[(int) $stream] = array($oid, $lo_stream);
     return $stream;
 }
开发者ID:PHPcomaptibility,项目名称:PHPPDO,代码行数:11,代码来源:pgsql.php


示例15: Open

 function Open($mode = "rw")
 {
     if (version_compare(phpversion(), "4.2.0", "ge") > 0) {
         $this->result = pg_lo_open($this->dbconnect, $this->oid, $mode);
     } else {
         $this->result = pg_loopen($this->dbconnect, $this->oid, $mode);
     }
     return $this->result;
 }
开发者ID:rmittalsfdc,项目名称:Search,代码行数:9,代码来源:postgredb.php


示例16: download

 function download()
 {
     /*         * *************************************************** */
     /* TYPE SAVE  */
     /*         * *************************************************** */
     $sis_tipcarga = 1;
     //
     $pasaje_viatico = new tab_pasaje_viatico();
     //
     // A BD
     if ($sis_tipcarga == 2) {
         $error = "";
         /*
                       if (isset ( $_COOKIE [session_name ()] )) {
                       if (session_is_registered ( 'USU_ID' )) { */
         if (isset($_POST['dov_id_open'])) {
             $dov_id = $_POST['dov_id_open'];
         } else {
             $dov_id = VAR3;
         }
         if ($dov_id != '') {
             $documento_viaje = new tab_documento_viaje();
             $rowe = $documento_viaje->dbSelectBySQL("SELECT * FROM tab_documento_viaje WHERE dov_id =  '" . $dov_id . "'");
             if (count($rowe) == 1) {
                 $sql = "SELECT\r\n                            tab_documento_viaje.dov_id,\r\n                            tab_documento_viaje.fil_nomoriginal,\r\n                            tab_documento_viaje.fil_nomcifrado,\r\n                            tab_documento_viaje.fil_tamano,\r\n                            tab_documento_viaje.fil_extension,\r\n                            tab_documento_viaje.fil_tipo,\r\n                            coalesce(tab_documento_viajebin.fil_contenido,'-1') as fil_contenido\r\n                            FROM\r\n                            tab_documento_viaje\r\n                            Inner Join tab_documento_viajebin ON tab_documento_viaje.dov_id = tab_documento_viajebin.dov_id WHERE tab_documento_viajebin.dov_id =  '" . $dov_id . "'";
                 $r_files = $documento_viaje->dbSelectBySQLArchive($sql);
                 //
                 $link = $pasaje_viatico->connect();
                 $sql = "select dov_id, nombre, mime, size, coalesce(archivo_oid,'-1') as archivo_oid, coalesce(archivo_bytea,'-1') as archivo_bytea from tab_documento_viaje where dov_id={$dov_id}";
                 $result = pg_query($link, $sql);
                 if (!$result || pg_num_rows($result) < 1) {
                     header("Location: index.php");
                     exit;
                 }
                 $row = pg_fetch_array($result, 0);
                 pg_free_result($result);
                 if ($row['archivo_bytea'] == -1 && $row['archivo_oid'] == -1) {
                     die('No existe el archivo para mostrar o bajar');
                 }
                 pg_query($link, "begin");
                 $file = pg_lo_open($link, $row['archivo_oid'], "r");
                 header("Cache-control: private");
                 header("Content-type: {$row['mime']}");
                 //if($f==1) header("Content-Disposition: attachment; filename=\"$row[nombre]\"");
                 header("Content-length: {$row['size']}");
                 header("Expires: " . gmdate("D, d M Y H:i:s", mktime(date("H") + 2, date("i"), date("s"), date("m"), date("d"), date("Y"))) . " GMT");
                 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
                 header("Cache-Control: no-cache, must-revalidate");
                 header("Pragma: no-cache");
                 pg_lo_read_all($file);
                 pg_lo_close($file);
                 pg_query($link, "commit");
                 pg_close($link);
             } else {
                 $error = "No existe el archivo.";
             }
         } else {
             $error = 'No existe el archivo.';
         }
     } else {
         // A SERVER
         $error = "";
         if (isset($_POST['dov_id_open'])) {
             $dov_id = $_POST['dov_id_open'];
         } else {
             $dov_id = VAR3;
         }
         if ($dov_id != '') {
             //
             $link = $pasaje_viatico->connect();
             $sql = "SELECT dov_id, \r\n                               pav_id, \r\n                               dov_nombre, \r\n                               dov_mime, \r\n                               dov_size, \r\n                               coalesce(dov_archivo_oid,'-1') as archivo_oid, \r\n                               coalesce(dov_archivo_bytea,'-1') as archivo_bytea \r\n                               FROM tab_documento_viaje \r\n                               WHERE dov_id = {$dov_id} ";
             $result = pg_query($link, $sql);
             if (!$result || pg_num_rows($result) < 1) {
                 header("Location: index.php");
                 exit;
             }
             $row = pg_fetch_array($result, 0);
             // Data Parameters
             $nombreDirectorio = "";
             $tsistema = new tab_sistema();
             $sql = "SELECT *\r\n                        FROM tab_sistema";
             $rows2 = $tsistema->dbselectBySQL($sql);
             if (count($rows2) >= 1) {
                 $sis_tipcarga = $rows2[0]->sis_tipcarga;
                 $sis_tammax = $rows2[0]->sis_tammax;
                 $nombreDirectorio = $rows2[0]->sis_ruta;
             }
             $archivopdf = $nombreDirectorio . $row[2];
             $len = filesize($archivopdf);
             //$archivopdf = PATH_DOMAIN ."/". $nombreDirectorio . $row[1];
             //$len = filesize($archivopdf);
             header("Cache-control: private");
             //header("Content-type: $row[mime]");
             header("Content-type: {$row['3']}");
             //header("Content-Disposition: attachment; filename='".$archivopdf."'");
             header("Content-length: {$len}");
             header("Expires: " . gmdate("D, d M Y H:i:s", mktime(date("H") + 2, date("i"), date("s"), date("m"), date("d"), date("Y"))) . " GMT");
             header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
             header("Cache-Control: no-cache, must-revalidate");
             header("Pragma: no-cache");
//.........这里部分代码省略.........
开发者ID:acastellon,项目名称:pasajes_viaticos,代码行数:101,代码来源:documento_viajeController.php


示例17: makePgLO

 public function makePgLO(&$data = null)
 {
     $pg = $this->connectionFactory->get('RW');
     $pgResource = $pg->resource->get();
     if (!isset($data)) {
         $data = file_get_contents($this->makeAndFillFile());
     }
     pg_query($pgResource, "BEGIN");
     $oid = pg_lo_create($pgResource);
     $handle = pg_lo_open($pgResource, $oid, 'w');
     pg_lo_write($handle, $data);
     pg_query($pgResource, "COMMIT");
     return new Oid($oid, $pg);
 }
开发者ID:squareproton,项目名称:bond,代码行数:14,代码来源:PgLargeObjectTest.php


示例18: mostraFoto

function mostraFoto($aluid)
{
    $sql = "select fot_foto from alunosfotos where fot_aluid = {$aluid}";
    //echo $sql;
    $rs = pg_exec($sql);
    $row = pg_fetch_row($rs, 0);
    pg_query("begin");
    $loid = pg_lo_open($row[0], "r");
    $foto = pg_lo_read_all($loid);
    pg_lo_close($loid);
    pg_query("commit");
}
开发者ID:tavo1981,项目名称:phpbar,代码行数:12,代码来源:funcoes.php


示例19: lo_open

 /**
  *
  */
 function lo_open($oid, $mode)
 {
     return pg_lo_open($this->connection, $oid, $mode);
 }
开发者ID:zenga22,项目名称:knowledgeroot1,代码行数:7,代码来源:class-pgsql.php


示例20: _firstUse

 private function _firstUse()
 {
     if (is_resource($this->_blob)) {
         return true;
     }
     if ($this->_id !== null) {
         $this->_blob = @pg_lo_open($this->_database->link, $this->_id, 'rw');
         if ($this->_blob === false) {
             return $this->_raiseError('open');
         }
     } else {
         $this->_id = @pg_lo_create($this->_database->link);
         $this->_blob = @pg_lo_open($this->_database->link, $this->_id, 'w');
         if ($this->_blob === false) {
             return $this->_raiseError('create');
         }
     }
     return true;
 }
开发者ID:vbo,项目名称:DB_Adapter,代码行数:19,代码来源:Blob.php



注:本文中的pg_lo_open函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP pg_lo_read函数代码示例发布时间:2022-05-15
下一篇:
PHP pg_lo_create函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap