updateDir() public method

Update directory
public updateDir ( string $key, integer $ttl ) : array
$key string
$ttl integer
return array $body
コード例 #1
0
ファイル: ClientTest.php プロジェクト: LeeSaferite/etcd-php
 /**
  * @covers LinkORB\Component\Etcd\Client::updatedir
  */
 public function testUpdatedir()
 {
     $dirname = '/test_updatedir';
     $this->client->mkdir($dirname);
     $this->client->updateDir($dirname, 10);
     $dir = $this->client->listDir($dirname);
     $this->assertLessThanOrEqual(10, $dir['node']['ttl']);
 }
コード例 #2
0
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $server = $input->getArgument('server');
     $key = $input->getArgument('key');
     $ttl = $input->getOption('ttl');
     $output->writeln("<info>Update ttl the dir with key `{$key}`</info>");
     $client = new EtcdClient($server);
     $data = $client->updateDir($key, $ttl);
     $json = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
     echo $json;
 }