Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40258 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 809 invoked from network); 4 Sep 2008 15:48:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Sep 2008 15:48:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=office@kitsoftware.ro; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=office@kitsoftware.ro; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kitsoftware.ro from 81.196.12.70 cause and error) X-PHP-List-Original-Sender: office@kitsoftware.ro X-Host-Fingerprint: 81.196.12.70 smtp1.rdslink.ro Linux 2.4/2.6 Received: from [81.196.12.70] ([81.196.12.70:35051] helo=smtp.rdslink.ro) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D8/D5-07417-E3300C84 for ; Thu, 04 Sep 2008 11:48:15 -0400 Received: (qmail 20399 invoked from network); 4 Sep 2008 15:48:12 -0000 X-Mail-Scanner: Scanned by qSheff 1.0 (http://www.enderunix.org/qsheff/) Received: from unknown (HELO AntauriPC) (86.121.161.176) by smtp1.rdslink.ro with SMTP; 4 Sep 2008 15:48:12 -0000 To: "'Diogo Neves'" Cc: "'PHP Internals List'" References: <000601c90e98$d5a57ca0$80f075e0$@ro> <000e01c90e99$94e04280$bea0c780$@ro> <87ae45950809040724q6660ea44xa527dc0670822333@mail.gmail.com> <001501c90e9b$3dca7d10$b95f7730$@ro> <001601c90e9b$ac0be430$0423ac90$@ro> <87ae45950809040828q122d0e4ds8f13627e57749684@mail.gmail.com> In-Reply-To: <87ae45950809040828q122d0e4ds8f13627e57749684@mail.gmail.com> Date: Thu, 4 Sep 2008 18:47:42 +0300 Message-ID: <003701c90ea5$9121bd70$b3653850$@ro> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AckOovl9kGTZLAl+TsW3njR55sipdQAAhrWg Content-Language: en-us Subject: RE: [PHP-DEV] Ob_start, "protected" obHandler method, nod detecting $this->geMe () kind of error! From: office@kitsoftware.ro ("Catalin Zamfir Alexandru | KIT Software CAZ") Abstract class Output_Buffering { Protected static function obStart () { Ob_start ('ErrorH::obHandler'); Set_our_error_handler ('some_error_h_we_have'); } } Class ErrorH extends Output_Buffering { Protected static obHandler { SNIPET OF CODE to detect parse errors, save the content in an array that will be outputted at the end of the script! } } If the "obHandler" method is "public" the "$this->getMe ()" from GLOBAL context will get detected. If "protected", the obHandler method, for the "$this->getMe ()" error isn't even called. I know this because when it's public I can generate the error and "error_log ()" it, but when it is "protected", the error_log isn't even called inside the obHandler method, so the obHandler method isn't even called. -----Original Message----- From: Diogo Neves [mailto:dafneves@gmail.com] Sent: Thursday, September 04, 2008 6:29 PM To: Catalin Zamfir Alexandru | KIT Software CAZ Cc: PHP Internals List Subject: Re: [PHP-DEV] Ob_start, "protected" obHandler method, nod detecting $this->geMe () kind of error! On Thu, Sep 4, 2008 at 3:36 PM, Catalin Zamfir Alexandru | KIT Software CAZ wrote: > This is my PHP: > PHP 5.2.6-pl6-gentoo (cli) (built: Aug 17 2008 01:02:28) > Copyright (c) 1997-2008 The PHP Group > Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies > > -----Original Message----- > From: Catalin Zamfir Alexandru | KIT Software CAZ > [mailto:office@kitsoftware.ro] > Sent: Thursday, September 04, 2008 5:34 PM > To: 'Diogo Neves' > Cc: 'PHP Internals List' > Subject: RE: [PHP-DEV] Ob_start, "protected" obHandler method, nod > detecting > $this->geMe () kind of error! > > Yes, that's the "so-called bug" I'm talking about. Having the obHandler > marked as "protected" makes "$this->getMe ()" kind of errors, from GLOBAL > context undetectable, while Parse/Notice/Warning errors are stil there, > even > if the "$this->getMe ()" error is marked as "Fatal Error:". Here: Fatal > error: Using $this when not in object context in > /var/www/localhost/htdocs/dev/ALFA/index.php on line 26 (this is when > obHandler = public). > > A blank page = when obHandler = protected, but Parse/Notice/any other kind > of errors are still detected. :) > > -----Original Message----- > From: Diogo Neves [mailto:dafneves@gmail.com] > Sent: Thursday, September 04, 2008 5:24 PM > To: Catalin Zamfir Alexandru | KIT Software CAZ > Cc: PHP Internals List > Subject: Re: [PHP-DEV] Ob_start, "protected" obHandler method, nod > detecting > $this->geMe () kind of error! > > On Thu, Sep 4, 2008 at 3:21 PM, Catalin Zamfir Alexandru | KIT Software CAZ > wrote: > > > Yes, excuse my English would be appropriate. I was in a hurry when > writing > > the email. Waiting for feedback from you guys ... > > > > -----Original Message----- > > From: Catalin Zamfir Alexandru | KIT Software CAZ > > [mailto:office@kitsoftware.ro] > > Sent: Thursday, September 04, 2008 5:17 PM > > To: 'PHP Internals List' > > Subject: [PHP-DEV] Ob_start, "protected" obHandler method, nod detecting > > $this->geMe () kind of error! > > > > Hello guys, > > > > We have too clases: > > > > - Abstract class OutputBuffering > > > > - Class ErrorHandler extends OutputBuffering, implements > obHandler > > as a "protected" method. I can detect: set_error_handler errors, through > a > > specific error handler (and obError method - I can detect any > > notice/warning/fatal) and also "Parse errors" in obHandler, through > > "parsing" error_prepend/error_append strings in the Output Buffer string. > > > > > > > > When the obHandler methos is "protected", the "$this->getMe ()" from > GLOBAL > > context cannot be detected. When the method is "public", the detection > goes > > as usual. The MANUAL Page on "ob_start" doesn't say anything about > > declaring > > the method "public". What if I want the "obHandler" method to not be > > accessible by the developer, but only by inheriting objects?! > > > > > > > > Thanks for any feedback. > > > > > > > > Regards, > > > > Catalin Z. Alexandru > > > > > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > Did you tried protected? I'm not really good with this things, but a > protected method can be inherited but not acessed outside the class ;) > > -- > Thanks, > > Diogo Neves > Web Developer @ SAPO.pt by PrimeIT.pt > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > Can you send a small example of code? -- Thanks, Diogo Neves Web Developer @ SAPO.pt by PrimeIT.pt