Changeset 20713
- Timestamp:
- 10/04/08 22:50:33 (3 months ago)
- Location:
- lang/php/Net_TokyoTyrant/trunk
- Files:
-
- 2 modified
-
Net/TokyoTyrant.php (modified) (4 diffs)
-
tests/tmp_test.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/php/Net_TokyoTyrant/trunk/Net/TokyoTyrant.php
r19380 r20713 10 10 private 11 11 $errorNo, $errorMessage; 12 13 const RDBXOLCKNON = 0; 14 const RDBXOLCKREC = 1; 15 const RDBXOLCKGLB = 2; 12 16 13 17 public function connect($server, $port, $timeout = 10) … … 254 258 public function putint($key, $num) 255 259 { 260 //This Code is non support 256 261 $value = pack('V', $num); 257 262 return $this->put($key, $value); … … 260 265 public function getint($key) 261 266 { 262 $data = $this->get($key); 263 if ($data === false) { 264 return false; 265 } 266 $value = unpack('V', $data); 267 return $value[1]; 267 return $this->addint($key, 0); 268 268 } 269 269 … … 278 278 } 279 279 280 281 public function ext($extname, $key, $value, $option = 0) 282 { 283 $cmd = pack('c*', 0xC8,0x68); 284 $this->_doRequest($cmd, array($extname, $option, $key, $value)); 285 if ($this->_getResponse() === false) { 286 return false; 287 } 288 return $this->_getData(); 289 } 290 280 291 public function vsize($key) 281 292 { -
lang/php/Net_TokyoTyrant/trunk/tests/tmp_test.php
r19380 r20713 8 8 $data2 = 'the test2 data'; 9 9 $count_key = 'count'; 10 $extname = 'echo'; 10 11 $error = null; 11 12 try { … … 73 74 assert($tt->addint($count_key, -3) === -1); 74 75 76 //$value = 'data'; 77 //assert($tt->ext($extname, $key, $value) === $value); 78 //assert($tt->ext($extname, $key, $value, Net_TokyoTyrant::RDBXOLCKNON) === $value); 79 //assert($tt->ext($extname, $key, $value, Net_TokyoTyrant::RDBXOLCKREC) === $value); 80 //assert($tt->ext($extname, $key, $value, Net_TokyoTyrant::RDBXOLCKGLB) === $value); 81 75 82 76 83 assert($tt->sync() === true);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)