Re: Re: svn: /pecl/rrd/trunk/ rrd.c
| From: | koubel | Date: | Sun, 08 Aug 2010 22:54:29 +0000 |
| Subject: | Re: Re: svn: /pecl/rrd/trunk/ rrd.c | ||
| References: | 1 | Groups: | php.pecl.cvs |
| Request: | Send a blank email to pecl-cvs+get-14565@lists.php.net to get a copy of this message | ||
> ------------ Původní zpráva ------------
> Od: Derick Rethans <derick@php.net>
> Předmět: Re: [PECL-CVS] Re: svn: /pecl/rrd/trunk/ rrd.c
> Datum: 08.8.2010 23:35:29
> ----------------------------------------
>
> One more suggstion:
>
> On Sun, 8 Aug 2010, Johannes Schlüter wrote:
>
> > On Sun, 2010-08-08 at 14:46 +0000, Miroslav Kubelik wrote:
> > > Modified: pecl/rrd/trunk/rrd.c
> > > ===================================================================
> > > --- pecl/rrd/trunk/rrd.c 2010-08-08 14:10:55 UTC (rev 301987)
> > > +++ pecl/rrd/trunk/rrd.c 2010-08-08 14:46:16 UTC (rev 301988)
> > > @@ -27,11 +27,25 @@
> > > #include "rrd_create.h"
> > > #include "rrd_update.h"
> > >
> > > +/* {{{ proto string rrd_error()
> > > +Get the error message set by the last rrd tool function call, this
> function
> > > +clear error buffer also.
> > > +*/
> > > +PHP_FUNCTION(rrd_error)
> > > +{
> > > + if (rrd_test_error()) {
> > > + RETVAL_STRING(rrd_get_error(), 1);
> > > + rrd_clear_error();
> > > + }
>
> Right now nothing is returned if there is no error; so implicitly NULL
> is returned. AFAIK we return False in those cases.
>
> Derick
I wanted to be compatible with an old non pecl extension API, which returns NULL in this case. But
OK, I can return FALSE. What is the recommendation for this cases? It's make sense for me if
nothing is available return nothing (NULL). In OO PHP (userspace) code I didn't see any case
when getter return false if nothing is available. So can you send me any recommendation or PECL
convention?