rmdir() public method

Removes the key if it is directory
public rmdir ( string $key, boolean $recursive = false ) : mixed
$key string
$recursive boolean
return mixed
Exemplo n.º 1
0
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $server = $input->getArgument('server');
     $key = $input->getArgument('key');
     $recursive = $input->getOption('recursive');
     $output->writeln("<info>Removing key `{$key}`</info>");
     $client = new EtcdClient($server);
     $data = $client->rmdir($key, $recursive);
     $json = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
     echo $json;
 }
Exemplo n.º 2
0
 /**
  * @covers LinkORB\Component\Etcd\Client::rmdir
  * @expectedException \LinkORB\Component\Etcd\Exception\EtcdException
  */
 public function testRmdir()
 {
     $this->client->mkdir('testrmdir');
     $this->client->rmdir('testrmdir', true);
     $this->client->rmdir('testrmdir');
 }