Permalink
Browse files

Warn if trying to use SASL when memcached.use_sasl is off.

Without this, a far less helpful error message from the underlying
libmemcached library would be reported.
  • Loading branch information...
1 parent 8230dc1 commit 699ac64abafa56560b003079d9ba563d03d7d787 David Terei committed Jan 3, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 php_memcached.c
View
@@ -2413,6 +2413,11 @@ static PHP_METHOD(Memcached, setSaslAuthData)
return;
}
+ if (!MEMC_G(use_sasl)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "SASL support (memcached.use_sasl) isn't enabled in php.ini");
+ RETURN_FALSE;
+ }
+
MEMC_METHOD_FETCH_OBJECT;
if (!memcached_behavior_get(m_obj->memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL)) {

0 comments on commit 699ac64

Please sign in to comment.