cvs: pear /MDB lob.php

From: Date: Wed, 29 May 2002 13:58:47 +0000
Subject: cvs: pear /MDB lob.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4263@lists.php.net to get a copy of this message
lsmith Wed May 29 09:58:47 2002 EDT Modified files: /pear/MDB lob.php Log: db object is now referenced directly instead of through $databases array Index: pear/MDB/lob.php diff -u pear/MDB/lob.php:1.2 pear/MDB/lob.php:1.3 --- pear/MDB/lob.php:1.2 Wed Apr 3 15:58:45 2002 +++ pear/MDB/lob.php Wed May 29 09:58:47 2002 @@ -2,19 +2,19 @@ /* * lob.php * - * @(#) $Header: /usr/repository/pear/MDB/lob.php,v 1.2 2002/04/03 20:58:45 lsmith Exp $ + * @(#) $Header: /usr/repository/pear/MDB/lob.php,v 1.3 2002/05/29 13:58:47 lsmith Exp $ * */ -$lobs=array(); +$lobs = array(); class MDB_lob { - var $error=""; - var $database=0; + var $error = ""; + var $database; var $lob; - var $data=""; - var $position=0; + var $data = ""; + var $position = 0; function create(&$arguments) { @@ -59,21 +59,18 @@ function destroy() { - global $databases; - $databases[$this->database]->destroyResultLob($this->result_lob); + $this->database->destroyResultLob($this->result_lob); } function endOfLob() { - global $databases; - return($databases[$this->database]->endOfResultLob($this->result_lob)); + return($this->database->endOfResultLob($this->result_lob)); } function readLob(&$data, $length) { - global $databases; - if(($read_length = $databases[$this->database]->readResultLob($this->result_lob, $data, $length)) < 0) { - $this->error = $databases[$this->database]->error(); + if(($read_length = $this->database->readResultLob($this->result_lob, $data, $length)) < 0) { + $this->error = $this->database->error(); } return($read_length); } @@ -143,7 +140,6 @@ function create(&$arguments) { global $lobs; - if(isset($arguments["BufferLength"])) { if($arguments["BufferLength"] <= 0) { $this->error = "it was specified an invalid buffer length"; @@ -168,7 +164,7 @@ $this->error = "it was not specified the output file"; return(0); } - } + } if(isset($arguments["LOB"])) { if(!isset($lobs[$arguments["LOB"]])) { $this->destroy(); @@ -183,12 +179,11 @@ && isset($arguments["Field"]) && isset($arguments["Binary"])) { - global $databases; if($arguments["Binary"]) { - $this->input_lob = $databases[$this->database]->fetchBLobResult($arguments["Result"], + $this->input_lob = $this->database->fetchBLobResult($arguments["Result"], $arguments["Row"], $arguments["Field"]); } else { - $this->input_lob = $databases[$this->database]->fetchClobResult($arguments["Result"], + $this->input_lob = $this->database->fetchClobResult($arguments["Result"], $arguments["Row"], $arguments["Field"]); } if($this->input_lob == 0) { @@ -202,7 +197,7 @@ $this->error = "it was not specified the input large object identifier"; return(0); } - } + } return(1); } @@ -268,7 +263,7 @@ return(0); } } else { - if(IsSet($arguments["Class"])) { + if(isset($arguments["Class"])) { $class = $arguments["Class"]; } } @@ -277,6 +272,7 @@ if(isset($arguments["Database"])) { $lobs[$lob]->database = $arguments["Database"]; } + if($lobs[$lob]->create($arguments)) { return(1); } @@ -299,6 +295,7 @@ function endOfLob($lob) { global $lobs; + return($lobs[$lob]->endOfLob()); }

« previous php.pear.cvs (#4263) next »