mirror of
https://github.com/php-win-ext/php-memcached.git
synced 2026-03-24 00:52:18 +01:00
Add a configuration option to enforce an item size limit on the client side. This avoids sending large items over the wire and getting rejected by the server which can cause delays. The default is 0 for no limit. The same error code RES_E2BIG is used for the client side limit as for the server side limit.
20 lines
382 B
PHP
20 lines
382 B
PHP
--TEST--
|
|
set large data
|
|
--SKIPIF--
|
|
<?php include "skipif.inc";?>
|
|
--FILE--
|
|
<?php
|
|
include dirname (__FILE__) . '/config.inc';
|
|
$m = memc_get_instance (array (
|
|
Memcached::OPT_ITEM_SIZE_LIMIT => 0,
|
|
));
|
|
|
|
$key = 'foobarbazDEADC0DE';
|
|
$value = str_repeat("foo bar", 1024 * 1024);
|
|
var_dump($m->set($key, $value, 360));
|
|
var_dump($m->get($key) === $value);
|
|
?>
|
|
--EXPECT--
|
|
bool(true)
|
|
bool(true)
|