The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.
Memcached::OPT_COMPRESSIONMemcached::OPT_COMPRESSION_TYPEMemcached::COMPRESSION_FASTLZ,
Memcached::COMPRESSION_ZLIB and
Memcached::COMPRESSION_ZSTD.
Type: int, default: Memcached::COMPRESSION_FASTLZ.
Memcached::COMPRESSION_FASTLZMemcached::COMPRESSION_ZLIBMemcached::COMPRESSION_ZSTDMemcached::OPT_COMPRESSION_LEVELMemcached::COMPRESSION_FASTLZ does not support compression levels.Memcached::COMPRESSION_ZSTD: minimum level is -22 and maximum level is 22.Memcached::COMPRESSION_ZLIB: minimum level is 0 and maximum level is 9.Type: int, default: 3.
Memcached::OPT_SERIALIZERMemcached::SERIALIZER_PHP,
Memcached::SERIALIZER_IGBINARY,
Memcached::SERIALIZER_JSON,
Memcached::SERIALIZER_JSON_ARRAY and
Memcached::SERIALIZER_MSGPACK.
Type: int, default: Memcached::SERIALIZER_IGBINARY if available,
then Memcached::SERIALIZER_MSGPACK if available,
then Memcached::SERIALIZER_PHP.
Memcached::SERIALIZER_PHPThe default PHP serializer.
Memcached::SERIALIZER_IGBINARYMemcached::SERIALIZER_JSONThe JSON serializer. This serializer deserializes JSON to an object.
Memcached::SERIALIZER_JSON_ARRAYMemcached::SERIALIZER_MSGPACKmsgpack extension is loaded.
Memcached::OPT_PREFIX_KEY128 characters and will reduce the
maximum available key size. The prefix is applied only to the item keys,
not to the server keys.
Type: string, default: "".
Memcached::OPT_HASHMemcached::HASH_* constants.
Each hash algorithm has its advantages and its disadvantages. Go with the
default if you don't know or don't care.
Type: int, default: Memcached::HASH_DEFAULT
Memcached::HASH_DEFAULTThe default (Jenkins one-at-a-time) item key hashing algorithm.
Memcached::HASH_MD5MD5 item key hashing algorithm.
Memcached::HASH_CRCCRC item key hashing algorithm.
Memcached::HASH_FNV1_64FNV1_64 item key hashing algorithm.
Memcached::HASH_FNV1A_64FNV1_64A item key hashing algorithm.
Memcached::HASH_FNV1_32FNV1_32 item key hashing algorithm.
Memcached::HASH_FNV1A_32FNV1_32A item key hashing algorithm.
Memcached::HASH_HSIEHHsieh item key hashing algorithm.
Memcached::HASH_MURMURMurmur item key hashing algorithm.
Memcached::OPT_DISTRIBUTIONType: int, default: Memcached::DISTRIBUTION_MODULA.
Memcached::DISTRIBUTION_MODULAModulo-based key distribution algorithm.
Memcached::DISTRIBUTION_CONSISTENTConsistent hashing key distribution algorithm (based on libketama).
Memcached::DISTRIBUTION_VIRTUAL_BUCKETMemcached::OPT_LIBKETAMA_COMPATIBLEEnables or disables compatibility with libketama-like behavior. When enabled, the item key hashing algorithm is set to MD5 and distribution is set to be weighted consistent hashing distribution. This is useful because other libketama-based clients (Python, Ruby, etc.) with the same server configuration will be able to access the keys transparently.
Note:
It is highly recommended to enable this option if you want to use consistent hashing, and it may be enabled by default in future releases.
Memcached::OPT_LIBKETAMA_HASHType: int.
Memcached::OPT_TCP_KEEPALIVEMemcached::OPT_BUFFER_WRITESMemcached::OPT_BINARY_PROTOCOLMemcached::OPT_NO_BLOCKMemcached::OPT_NOREPLYMemcached::OPT_TCP_NODELAYMemcached::OPT_SOCKET_SEND_SIZEType: int, default: varies by platform/kernel configuration.
Memcached::OPT_SOCKET_RECV_SIZEType: int, default: varies by platform/kernel configuration.
Memcached::OPT_CONNECT_TIMEOUTType: int, default: 1000.
Memcached::OPT_RETRY_TIMEOUTType: int, default: 2.
Memcached::OPT_DEAD_TIMEOUT0 means no retry.
Type: int, default: 0.
Memcached::OPT_SEND_TIMEOUTType: int, default: 0.
Memcached::OPT_RECV_TIMEOUTType: int, default: 0.
Memcached::OPT_POLL_TIMEOUTType: int, default: 1000.
Memcached::OPT_CACHE_LOOKUPSMemcached::OPT_SERVER_FAILURE_LIMITType: int, default: 5.
Memcached::OPT_SERVER_TIMEOUT_LIMITType: int, default: 0.
Memcached::OPT_AUTO_EJECT_HOSTS
Removes disabled servers from the list. Use together with
Memcached::OPT_SERVER_FAILURE_LIMIT and
Memcached::OPT_SERVER_TIMEOUT_LIMIT.
Note:
This option is replaced by
Memcached::OPT_REMOVE_FAILED_SERVERS.
Memcached::OPT_VERIFY_KEYMemcached::OPT_USE_UDPMemcached::OPT_NUMBER_OF_REPLICASType: int, default: 0.
Memcached::OPT_RANDOMIZE_REPLICA_READSMemcached::OPT_REMOVE_FAILED_SERVERSMemcached::OPT_SERVER_FAILURE_LIMIT and
Memcached::OPT_SERVER_TIMEOUT_LIMIT.
Memcached::HAVE_IGBINARYType: bool.
Memcached::HAVE_JSONType: bool.
Memcached::HAVE_MSGPACKType: bool.
Available as of Memcached 3.0.0.
Memcached::HAVE_ZSTDType: bool.
Available as of Memcached 3.3.0.
Memcached::HAVE_ENCODINGType: bool.
Available as of Memcached 3.1.0.
Memcached::HAVE_SESSIONType: bool.
Available as of Memcached 3.0.0.
Memcached::HAVE_SASLType: bool.
Available as of Memcached 3.0.0.
Memcached::GET_EXTENDEDA flag for Memcached::get(), Memcached::getMulti() and Memcached::getMultiByKey() to ensure that the CAS token values are returned as well.
Available as of Memcached 3.0.0.
Memcached::GET_PRESERVE_ORDER
A flag for Memcached::getMulti() and
Memcached::getMultiByKey() to ensure that the keys are
returned in the same order as they were requested in. Non-existing keys
get a default value of null.
Memcached::RES_SUCCESSThe operation was successful.
Memcached::RES_FAILUREThe operation failed in some fashion.
Memcached::RES_HOST_LOOKUP_FAILUREDNS lookup failed.
Memcached::RES_UNKNOWN_READ_FAILUREFailed to read network data.
Memcached::RES_PROTOCOL_ERRORBad command in memcached protocol.
Memcached::RES_CLIENT_ERRORError on the client side.
Memcached::RES_SERVER_ERRORError on the server side.
Memcached::RES_WRITE_FAILUREFailed to write network data.
Memcached::RES_DATA_EXISTSFailed to do compare-and-swap: item you are trying to store has been modified since you last fetched it.
Memcached::RES_NOTSTOREDItem was not stored: but not because of an error. This normally means that either the condition for an "add" or a "replace" command wasn't met, or that the item is in a delete queue.
Memcached::RES_NOTFOUNDItem with this key was not found (with "get" operation or "cas" operations).
Memcached::RES_PARTIAL_READPartial network data read error.
Memcached::RES_SOME_ERRORSSome errors occurred during multi-get.
Memcached::RES_NO_SERVERSServer list is empty.
Memcached::RES_ENDEnd of result set.
Memcached::RES_ERRNOSystem error.
Memcached::RES_BUFFEREDThe operation was buffered.
Memcached::RES_TIMEOUTThe operation timed out.
Memcached::RES_BAD_KEY_PROVIDEDBad key.
Memcached::RES_STOREDMemcached::RES_DELETEDMemcached::RES_STATMemcached::RES_ITEMMemcached::RES_NOT_SUPPORTEDMemcached::RES_FETCH_NOTFINISHEDMemcached::RES_SERVER_MARKED_DEADMemcached::RES_UNKNOWN_STAT_KEYMemcached::RES_INVALID_HOST_PROTOCOLMemcached::RES_MEMORY_ALLOCATION_FAILUREMemcached::RES_CONNECTION_SOCKET_CREATE_FAILUREFailed to create network socket.
Memcached::RES_PAYLOAD_FAILUREPayload failure: could not compress/decompress or serialize/unserialize the value.
Memcached::RES_AUTH_PROBLEMAvailable as of Memcached 3.0.0.
Memcached::RES_AUTH_FAILUREAvailable as of Memcached 3.0.0.
Memcached::RES_AUTH_CONTINUEAvailable as of Memcached 3.0.0.
Memcached::RES_E2BIGAvailable as of Memcached 3.0.0.
Memcached::RES_KEY_TOO_BIGAvailable as of Memcached 3.0.0.
Memcached::RES_SERVER_TEMPORARILY_DISABLEDAvailable as of Memcached 3.0.0.
Memcached::RES_SERVER_MEMORY_ALLOCATION_FAILUREAvailable as of Memcached 3.0.0.