/** * Copy a file. * * @param string $path * @param string $newpath * * @return bool */ public function copy($path, $newpath) { $keyValue = $this->client->get($path); if ($keyValue === false) { return false; } return $this->client->set($newpath, $keyValue); }
public function test_set_get() { $client = new Client(); $client->addServers(array('127.0.0.1', 11211), array('127.0.0.1', 11212)); $this->assertFalse($client->isConnected()); $this->assertInstanceOf('\\Memcached', $client->getMemcached()); $this->assertTrue($client->isConnected()); $this->assertEquals(1, $client->set('foobar', 42)); $this->assertEquals(42, $client->get('foobar')); }
/** * {@inheritdoc} */ public function createClient() { $client = new Client(); $client->set('client_id_issued_at', time()); return $client; }
public function test_set_get() { $client = new Client(); $this->assertEquals(1, $client->set('foobar', 42)); $this->assertEquals(42, $client->get('foobar')); }