Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:6229 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18847 invoked by uid 1010); 5 Dec 2003 13:38:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 18823 invoked from network); 5 Dec 2003 13:38:11 -0000 Received: from unknown (HELO mx.thebrainroom.net) (65.200.24.98) by pb1.pair.com with SMTP; 5 Dec 2003 13:38:11 -0000 Received: by mx.thebrainroom.net (Postfix, from userid 517) id 030151488089; Fri, 5 Dec 2003 05:37:16 -0800 (PST) Received: from obsidian (zaneeb.thebrainroom.net [82.133.1.138]) by mx.thebrainroom.net (Postfix) with ESMTP id E49A21488087; Fri, 5 Dec 2003 05:37:13 -0800 (PST) Message-ID: <006f01c3bb34$efb22970$8802a8c0@obsidian> To: "Antony Dovgal" , Cc: , , References: <20031205163044.130c88ed.tony2001@phpclub.net> Date: Fri, 5 Dec 2003 13:37:29 -0000 Organization: The Brain Room Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_30,MAILTO_TO_SPAM_ADDR,QUOTED_EMAIL_TEXT, REFERENCES version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) X-TBR-Filter: Virus scanned and defanged Subject: Re: [PHP-DEV] [PATCH] for oci8 and some improvement proposals From: wez@thebrainroom.com ("Wez Furlong") Would it make sense to expose this stuff as a stream using the streams API, so the user would be able to fread($lob) etc? You could still add functions for those things that aren't covered already by streams (the erase() call). One of the benefits would be avoiding adding more functions to the global namespace, and also side stepping any naming convention wars that might arise. --Wez. ----- Original Message ----- From: "Antony Dovgal" To: Cc: ; ; Sent: Friday, December 05, 2003 1:30 PM Subject: [PHP-DEV] [PATCH] for oci8 and some improvement proposals > Hi, all! > > I want to propose a patch, that will add functions listed below to OCI8 extension. > Similar functions exist in Postgres & Informix extensions, but they are absent in OCI8 module. > The patch is being used on 4 my servers (development, test & 2 production servers) about a week and seems to be (almost? =)) bug-free. > > ocitelllob(); [ OCI_Lob->tell(); ] - ftell(); analogue for Lobs > ociwritelob(); [ OCI_Lob->write(); ] - fwrite(); analogue for Lobs > ocitruncatelob(); [ OCI_Lob->truncate(); ] - ftruncate(); analogue for Lobs > ocieraselob(); [ OCI_Lob->erase(); ] - erases specified part of a Lob (for BLOBs it means zero-filling, for CLOBs - space-filling) > ociflushlob(); [ OCI_Lob->flush(); ] - flushes Lob buffer (if buffering was enabled before) > ocisetbufferinglob(); [ OCI_Lob->setBuffering(); ] - turns on/off buffering for the current Lob > ocigetbufferinglob(); [ OCI_Lob->getBuffering(); ] - gets buffering' current state > ocirewindlob(); [ OCI_Lob->rewind(); ] - rewind(); analogue for Lobs > ocireadlob(); [ OCI_Lob->read(); ] - fread(); analogue for Lobs > ocieoflob(); [ OCI_Lob->eof(); ] - feof(); analogue for Lobs > ociseeklob(); [ OCI_Lob->seek(); ] - fseek(); analogue for Lobs > ocilobgetlength(); [ OCI_Lob->getLength(); ] - filesize(); analogue for Lobs > > ociappendlob(); - appends data from a Lob to another Lob > ocicopylob(); - copies data from a Lob to another Lob > ociisequallob(); - compares 2 Lobs and checks if they are equal > > All OCI-Lob methods could be rewritten to receive Lob as parameter, when they aren't called as methods, but currently this is not done (should I do it?). > > As you can see, I've added this check: > if (oci_lobgetlen(descr->conn,descr,&len) == 0 && descr->lob_size >= 0) > to almost all new functions. > I propose to add this check to already existing functions (I mean, to replace calls of CALL_OCI_RETURN()), > 'cause at this moment they get Lob's length from Oracle each time they are called and it's not the best decision imho. > > And there is another one thing I want to ask you about: > ALL functions, which wrap database API's in PHP, are called like this: ___, > but only OCI8 wrappers are called in another way: oci > Maybe it's time to declare this style deprecated and to change it to oci___? > (especially after that endless discussion about studlyCaps =))