logo       

cvs: pear /MDB lob.php: msg#00600

Subject: cvs: pear /MDB lob.php
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());
 }
 



-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe