mkdir() public method

make a new directory
public mkdir ( string $key, integer $ttl ) : array
$key string
$ttl integer
return array $body
Exemplo n.º 1
0
 public function execute(InputInterface $input, OutputInterface $output)
 {
     $server = $input->getArgument('server');
     $key = $input->getArgument('key');
     $ttl = $input->getOption('ttl');
     $output->writeln("<info>making directory `{$key}`</info>");
     $client = new EtcdClient($server);
     $data = $client->mkdir($key, $ttl);
     $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');
 }