我正在使用
Memcached::set()
和
Memcached::get()
方法.文档说明如果发生错误,或者通常要检查这些方法的状态,我应该调用
Memcached::getResultCode()
.
我在哪里可以找到结果代码的完整列表,结果代码代表什么以及它的数值是什么?
到目前为止我发现的最好的事情是在Memcached::getResultCode()
的一些注释中,但列表不包括8和47.另一个列表在Memcached Predefined Constants页面中,但它不包括数值.
我在
the libmemcached source code中找到了错误代码.
原文链接:https://www.f2er.com/php/135201.html0 = MEMCACHED_SUCCESS 1 = MEMCACHED_FAILURE 2 = MEMCACHED_HOST_LOOKUP_FAILURE // getaddrinfo() and getnameinfo() only 3 = MEMCACHED_CONNECTION_FAILURE 4 = MEMCACHED_CONNECTION_BIND_FAILURE // DEPRECATED see MEMCACHED_HOST_LOOKUP_FAILURE 5 = MEMCACHED_WRITE_FAILURE 6 = MEMCACHED_READ_FAILURE 7 = MEMCACHED_UNKNOWN_READ_FAILURE 8 = MEMCACHED_PROTOCOL_ERROR 9 = MEMCACHED_CLIENT_ERROR 10 = MEMCACHED_SERVER_ERROR // Server returns "SERVER_ERROR" 11 = MEMCACHED_ERROR // Server returns "ERROR" 11 = MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE = MEMCACHED_ERROR 12 = MEMCACHED_DATA_EXISTS 13 = MEMCACHED_DATA_DOES_NOT_EXIST 14 = MEMCACHED_NOTSTORED 15 = MEMCACHED_STORED 16 = MEMCACHED_NOTFOUND 17 = MEMCACHED_MEMORY_ALLOCATION_FAILURE 18 = MEMCACHED_PARTIAL_READ 19 = MEMCACHED_SOME_ERRORS 20 = MEMCACHED_NO_SERVERS 21 = MEMCACHED_END 22 = MEMCACHED_DELETED 23 = MEMCACHED_VALUE 24 = MEMCACHED_STAT 25 = MEMCACHED_ITEM 26 = MEMCACHED_ERRNO 27 = MEMCACHED_FAIL_UNIX_SOCKET // DEPRECATED 28 = MEMCACHED_NOT_SUPPORTED 29 = MEMCACHED_NO_KEY_PROVIDED /* Deprecated. Use MEMCACHED_BAD_KEY_PROVIDED! */ 30 = MEMCACHED_FETCH_NOTFINISHED 31 = MEMCACHED_TIMEOUT 32 = MEMCACHED_BUFFERED 33 = MEMCACHED_BAD_KEY_PROVIDED 34 = MEMCACHED_INVALID_HOST_PROTOCOL 35 = MEMCACHED_SERVER_MARKED_DEAD 36 = MEMCACHED_UNKNOWN_STAT_KEY 37 = MEMCACHED_E2BIG 38 = MEMCACHED_INVALID_ARGUMENTS 39 = MEMCACHED_KEY_TOO_BIG 40 = MEMCACHED_AUTH_PROBLEM 41 = MEMCACHED_AUTH_FAILURE 42 = MEMCACHED_AUTH_CONTINUE 43 = MEMCACHED_PARSE_ERROR 44 = MEMCACHED_PARSE_USER_ERROR 45 = MEMCACHED_DEPRECATED 46 = MEMCACHED_IN_PROGRESS 47 = MEMCACHED_SERVER_TEMPORARILY_DISABLED 48 = MEMCACHED_SERVER_MEMORY_ALLOCATION_FAILURE 49 = MEMCACHED_MAXIMUM_RETURN /* Always add new error code before */