当前位置: 首页>>代码示例>>PHP>>正文


PHP pg_lo_unlink函数代码示例

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


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

示例1: testExecutePersist

 public function testExecutePersist()
 {
     $fileIn = tempnam(sys_get_temp_dir(), 'PgOidIn');
     file_put_contents($fileIn, 'content');
     $lo = new PgLargeObject($fileIn);
     $this->assertTrue($lo->isNew());
     $this->assertTrue($lo->isChanged());
     $this->assertFalse($lo->isDeleted());
     $this->assertSame($lo->getFilePath(), $fileIn);
     $task = new Persist($this->entityManager->recordManager);
     $task->setObject($lo);
     $this->assertTrue($task->execute($this->db));
     $this->assertFalse($lo->isNew());
     $this->assertFalse($lo->isChanged());
     $this->assertFalse($lo->isDeleted());
     $this->assertNull($lo->getFilePath());
     // the task has been inserted correctly
     $this->assertTrue(is_numeric($lo->getOid()));
     $this->db->query(new PgQuery('BEGIN'));
     $fileOut = tempnam(sys_get_temp_dir(), 'PgOidOut');
     pg_lo_export($this->db->resource->get(), $lo->getOid(), $fileOut);
     $this->db->query(new PgQuery('COMMIT'));
     $this->assertFileEquals($fileIn, $fileOut);
     pg_lo_unlink($this->db->resource->get(), $lo->getOid());
 }
开发者ID:squareproton,项目名称:bond,代码行数:25,代码来源:PgLargeObjectTest.php

示例2: DB_lo_unlink

function DB_lo_unlink($c, $id)
{
    if (strcmp(phpversion(), '4.2.0') < 0) {
        return pg_lounlink($id, $c);
    } else {
        return pg_lo_unlink($c, $id);
    }
}
开发者ID:sbaldrich,项目名称:boca,代码行数:8,代码来源:getextdata.php

示例3: deleteblob

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

示例4: exclusao

 /**
  * Exclui um objeto oid do Banco de dados
  * @param integer $iOid
  *
  * Caso de Uso: Ao excluir um registro de uma tabela e eo campo for do tipo oid,
  * Deve-se excluir o objeto do banco utilizando este método
  */
 public static function exclusao($iOid)
 {
     $lTransacaoInterna = false;
     global $conn;
     if (!db_utils::inTransaction()) {
         throw new Exception("Sem transação Ativa.");
     }
     return pg_lo_unlink($conn, $iOid);
 }
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:16,代码来源:DBLargeObject.php

示例5: deleteOID

 /**
  * delete an OID
  *
  * @param integer    $OID
  * @return mixed MDB2_OK on success or MDB2 Error Object on failure
  * @access public
  */
 function deleteOID($OID)
 {
     $db =& $this->getDBInstance();
     if (PEAR::isError($db)) {
         return $db;
     }
     $connection = $db->getConnection();
     if (PEAR::isError($connection)) {
         return $connection;
     }
     if (!@pg_lo_unlink($connection, $OID)) {
         return $db->raiseError(null, null, null, 'Unable to unlink OID: ' . $OID, __FUNCTION__);
     }
     return MDB2_OK;
 }
开发者ID:ookwudili,项目名称:chisimba,代码行数:22,代码来源:pgsql.php

示例6: execute

 public function execute(Pg $pg, $simulate = false)
 {
     if ($this->object->isNew()) {
         return true;
     }
     // IMPORTANT: pg_lo fn's don't work outside a transaction
     $pg->query(new Query('BEGIN'));
     if (!($response = pg_lo_unlink($pg->resource->get(), $this->object->getOid()))) {
         throw new QueryException("Unable to delete PgLargeObject {$this->object->getOid()}");
     }
     // IMPORTANT: pg_lo_import/export DO NOT WORK without a transaction!
     $pg->query(new Query('COMMIT'));
     $this->object->markDeleted();
     return true;
 }
开发者ID:squareproton,项目名称:bond,代码行数:15,代码来源:Delete.php

示例7: pgsqlLOBUnlink

 public function pgsqlLOBUnlink($oid)
 {
     return pg_lo_unlink($this->link, $oid);
 }
开发者ID:PHPcomaptibility,项目名称:PHPPDO,代码行数:4,代码来源:pgsql.php

示例8: loUnlink

 public function loUnlink($oid)
 {
     assert('is_string($pathname)');
     assert('is_int($oid)');
     return pg_lo_unlink($this->_pg, $oid);
 }
开发者ID:mai7star,项目名称:fake,代码行数:6,代码来源:PostgreSQL.php

示例9: large_object_delete

 function large_object_delete($oid)
 {
     trigger_before('large_object_delete', $this, $this);
     $return = false;
     #$result = pg_query($this->conn,"SELECT $field FROM $table WHERE $pkfield = '$pkvalue'");
     #if (!$result) { trigger_error("Error in select file OID", E_USER_ERROR ); }
     #$oid = pg_result($result,0,$field);
     #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_d transaction: " . @pg_last_error($this->conn), E_USER_ERROR);
     }
     $result = @pg_lo_unlink($this->conn, $oid);
     if (!$result) {
         trigger_error("error in l_o_unlink: " . @pg_last_error($this->conn), E_USER_ERROR);
     }
     $result = @pg_query($this->conn, "COMMIT");
     if (!$result) {
         trigger_error("error committing l_o_d transaction: " . @pg_last_error($this->conn), E_USER_ERROR);
     } else {
         $return = true;
     }
     return $return;
 }
开发者ID:voitto,项目名称:dbscript,代码行数:24,代码来源:postgresql.php

示例10: dump

 $req = $_POST['r'.$rn];
 if( $req == 'connect' ) {
   dump( 0 );
   dump( 0 );
   dump( 0 );
 } elseif( substr($req,0,11) == 'blob_create' ) {
   list($oid) = sscanf( $req, 'blob_create %u' );
   pg_free_result( pg_query( $commit ? 'COMMIT' : 'ROLLBACK' ) );
   pg_free_result( pg_query( 'BEGIN' ) );
   $oid = pg_lo_create() or pgerr('lo_create failed');
   pg_free_result( pg_query( 'COMMIT' ) );
   pg_free_result( pg_query( 'BEGIN' ) );
   dump($oid);
 } elseif( substr($req,0,11) == 'blob_delete' ) {
   list($oid) = sscanf( $req, 'blob_delete %u' );
   $oid = pg_lo_unlink($oid) or pgerr('lo_unlink failed');
 } elseif( substr($req,0,10) == 'blob_write' ) {
   list($oid) = sscanf( $req, 'blob_write %s ' );
   $bin = substr($req,12+strlen($oid));
   $obj = pg_lo_open($oid,'w') or pgerr( 'lo_open failed' );
   $res = pg_lo_write($obj,$bin) or pgerr( 'lo_write failed' );
   pg_lo_close($obj);
   dump($res);
 } elseif( substr($req,0,9) == 'blob_read' ) {
   list($oid) = sscanf( $req, 'blob_read %u' );
   $obj = pg_lo_open($oid,'r') or pgerr( 'lo_open failed' );
   pg_lo_seek($obj,0,PGSQL_SEEK_END);
   $len = pg_lo_tell($obj);
   pg_lo_seek($obj,0,PGSQL_SEEK_SET);
   $res = pg_lo_read($obj,$len) or pgerr( 'lo_read failed' );
   pg_lo_close($obj);
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:31,代码来源:emsproxy.php

示例11: Unlink

 function Unlink()
 {
     if (version_compare(phpversion(), "4.2.0", "ge") > 0) {
         pg_lo_unlink($this->dbconnect, $this->oid);
     }
 }
开发者ID:rmittalsfdc,项目名称:Search,代码行数:6,代码来源:postgredb.php

示例12: lo_unlink

 function lo_unlink($p_oid)
 {
     return pg_lo_unlink($this->db, $p_oid);
 }
开发者ID:Kloadut,项目名称:noalyss_ynh,代码行数:4,代码来源:class_database.php

示例13: pg_lo_unlink

if (!$oid) {
    echo "pg_lo_import() error\n";
}
if ($oid != 21003) {
    echo "pg_lo_import() wrong id\n";
}
pg_lo_unlink($db, $oid);
pg_exec($db, 'commit');
echo "import LO from string\n";
pg_exec($db, 'begin');
$oid = pg_lo_import($db, __FILE__, "21004");
if (!$oid) {
    echo "pg_lo_import() error\n";
}
if ($oid != 21004) {
    echo "pg_lo_import() wrong id\n";
}
pg_lo_unlink($db, $oid);
pg_exec($db, 'commit');
echo "import LO using default connection\n";
pg_exec('begin');
$oid = pg_lo_import($db, __FILE__, 21005);
if (!$oid) {
    echo "pg_lo_import() error\n";
}
if ($oid != 21005) {
    echo "pg_lo_import() wrong id\n";
}
pg_lo_unlink($oid);
pg_exec('commit');
echo "OK";
开发者ID:badlamer,项目名称:hhvm,代码行数:31,代码来源:28large_object_import_oid.php

示例14: lo_unlink

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

示例15: BlobDelete

 function BlobDelete($blob)
 {
     pg_query($this->_connectionID, 'begin');
     $result = @pg_lo_unlink($blob);
     pg_query($this->_connectionID, 'commit');
     return $result;
 }
开发者ID:nicolas34732,项目名称:address_book,代码行数:7,代码来源:adodb-postgres64.inc.php


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