function unit_coolxiu_memcached_test() { $memcached = new MemDb(); global $g_arr_memcache; $memcached->connectMemcached($g_arr_memcache['memcache']); $memcached->setSearchResult("AAAA", "BBBB"); $result = $memcached->getSearchResult("AAAA"); echo $result; }
} $arr_memcache_config = $g_arr_memcache_config = array(array('host' => '127.0.0.1', 'port' => '11211', 'persistent' => true, 'weight' => 2), array('host' => '127.0.0.1', 'port' => '11211', 'persistent' => true, 'weight' => 2)); if ($nType == 1) { $arr_memcache_config = $g_arr_memcache_config = array(array('host' => '127.0.0.1', 'port' => '11211', 'persistent' => true, 'weight' => 2), array('host' => '127.0.0.1', 'port' => '11211', 'persistent' => true, 'weight' => 2)); } $memcached->connectMemcached($arr_memcache_config); if ($bClear) { $result = $memcached->clearMemcache(); if (!$result) { echo get_rsp_result(0); exit; } echo get_rsp_result(1) . 'clear mem'; } if (!empty($strSet)) { $bResult = $memcached->setSearchResult('4a03c8f22641741b6e1d35b87d71a571', $strSet); if (!$bResult) { echo "MemDb:setSearchResult() failed"; exit; } $bResult = $memcached->getSearchResult('4a03c8f22641741b6e1d35b87d71a571'); if (!$bResult) { echo "getSearchResult() failed"; exit; } echo get_rsp_result(1) . 'set mem' . $bResult; } if (!empty($strGet)) { $bResult = $memcached->getSearchResult($strGet); if (!$bResult) { echo "getSearchResult() failed";