[fw-core] Reason for suppressing errors in call to Memcahe::set()?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[fw-core] Reason for suppressing errors in call to Memcahe::set()?

Carlton Gibson-2
Hi all,

I've got some issues with Memcache that I need to debug but I've a question
with Zend_Cache that I need to resolve first.

In Zend/Cache/Backend/Memcached.php line 224:

        $result = @$this->_memcache->set($id, array($data, time(),
$lifetime), $flag, $lifetime);

Why are the errors being suppressed? I'd like to delete this and have any
errors logged, but the "@" has been there a long time.
Can anyone say why? (Or, other than a log explosion, is there badness there?
:-)

For context, $this->_memcache references an instance of the Memcache class
http://php.net/manual/en/class.memcache.php but I can't find anything there.

Thanks in advance.
Carlton
Reply | Threaded
Open this post in threaded view
|

Re: [fw-core] Reason for suppressing errors in call to Memcahe::set()?

Konr Ness
The error suppression was added in Revision 20590 by Marc Bennewitz
related to http://framework.zend.com/issues/browse/ZF-8856

I don't see any reason why it should be suppressed. Revision 20590 was
reverting a previous change that first attempted to add() and if that
failed because the value already existed, it then set().

The PHP docs do not mention any possible warning or errors that this
method throws.

My recommendation would be to remove the @.

Konr

On Thu, Sep 15, 2011 at 7:02 AM, Carlton Gibson
<[hidden email]> wrote:

> Hi all,
>
> I've got some issues with Memcache that I need to debug but I've a question
> with Zend_Cache that I need to resolve first.
>
> In Zend/Cache/Backend/Memcached.php line 224:
>
>        $result = @$this->_memcache->set($id, array($data, time(),
> $lifetime), $flag, $lifetime);
>
> Why are the errors being suppressed? I'd like to delete this and have any
> errors logged, but the "@" has been there a long time.
> Can anyone say why? (Or, other than a log explosion, is there badness there?
> :-)
>
> For context, $this->_memcache references an instance of the Memcache class
> http://php.net/manual/en/class.memcache.php but I can't find anything there.
>
> Thanks in advance.
> Carlton
>

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]