Changeset 744 -- 2009-04-25 23:22:21
- Author
εγ
δΈηͺ
- Comment
- new protcol TokyoTyrant
Diffs
Net_TokyoTyrant/trunk/tests/tmp_test.php
@@ -21,6 +21,7 @@
$tt->connect('localhost', 1978, 1000);
assert($tt->vanish() === true);
+
assert($tt->put($key, $data) === true);
$getdata = $tt->get($key);
assert($getdata === $data);
@@ -99,4 +100,9 @@
assert($tt->copy('/tmp/test.net_tokyotyrant.db') === true);
assert(file_exists('/tmp/test.net_tokyotyrant.db') === true);
assert(strlen($tt->stat()) > 1);
+
+
+assert($tt->optimize('') === true);
+assert($tt->copy('/tmp/test.net_tokyotyrant.db') === true);
+
$tt->close();
Net_TokyoTyrant/trunk/Net/TokyoTyrant.php
@@ -375,23 +375,23 @@
return true;
}
- public function vanish()
+ public function optimize($param)
{
$cmd = pack('c*', 0xC8,0x71);
- $this->_doRequest($cmd);
+ $this->_doRequest($cmd, array((string) $param));
$this->_getResponse();
return true;
}
-
- public function copy($path)
+
+ public function vanish()
{
$cmd = pack('c*', 0xC8,0x72);
- $this->_doRequest($cmd, array((string) $path));
+ $this->_doRequest($cmd);
$this->_getResponse();
return true;
}
- public function restore($path)
+ public function copy($path)
{
$cmd = pack('c*', 0xC8,0x73);
$this->_doRequest($cmd, array((string) $path));
@@ -399,6 +399,14 @@
return true;
}
+// public function restore($path)
+// {
+// $cmd = pack('c*', 0xC8,0x74);
+// $this->_doRequest($cmd, array((string) $path));
+// $this->_getResponse();
+// return true;
+// }
+
public function setmst($host, $port)
{
$cmd = pack('c*', 0xC8,0x78);