Skip to content

Commit

Permalink
Handle old memcached configurations gracefully.
Browse files Browse the repository at this point in the history
When a new Couchbase command is called, trigger a E_WARNING error rather
than failing without a good error message.

Starting with the `touch()` method as it is the only one we have yet.
  • Loading branch information
janl committed Jul 1, 2011
1 parent 58f42f3 commit 4194fbb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Couchbase.php
Expand Up @@ -113,6 +113,16 @@ function addQuery($name, $query_definition)
return true;
}

function touch($key, $expriy = 0)
{
if(!method_exists("Memcached", "touch")) {
trigger_error(E_WARNING,
"Your memcached extension does not support the touch() method.");
return false;
}
return parent::touch($key, $expiry);
}

/**
* Utility method, updates a view group on the server
*
Expand Down

0 comments on commit 4194fbb

Please sign in to comment.