本文整理汇总了PHP中Helpers::doLocal方法的典型用法代码示例。如果您正苦于以下问题:PHP Helpers::doLocal方法的具体用法?PHP Helpers::doLocal怎么用?PHP Helpers::doLocal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Helpers
的用法示例。
在下文中一共展示了Helpers::doLocal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ensure
public function ensure()
{
writeln('Ensure docker-machine ' . $this->name);
if (!$this->exists()) {
$this->run();
}
$command = "docker-machine status {$this->name}";
$output = Helpers::doLocal($command);
if (!preg_match('#Running#i', $output, $matches)) {
$this->start();
}
$this->ip = Helpers::getMachineIp();
}
示例2: kill
public function kill()
{
if ($this->exists()) {
writeln('<comment>Kill web container</comment>');
$command = "docker rm -f {$this->container}";
Helpers::doLocal($command);
}
$command = "cd {$this->dir} && docker images";
$output = Helpers::doLocal($command);
if (preg_match('/' . $this->image . '\\s.*latest\\s*([[:alnum:]]+).*/i', $output, $matches)) {
$command = "cd {$this->dir} && docker rmi {$this->image}";
Helpers::doLocal($command);
}
}
示例3: cleanup
public static function cleanup()
{
$web_name = basename(self::getProjectDir());
$web_name .= '_web';
$web = new Web($web_name);
$web->stop();
$web->kill();
$image_id = null;
$command = "docker images";
$output = Helpers::doLocal($command);
$container = env('container');
$pattern = '#' . $container . '\\s.*latest\\s+(.*?)\\s#i';
if (preg_match($pattern, $output, $matches)) {
$image_id = $matches[1];
}
if ($image_id) {
Helpers::doLocal('docker rmi -f ' . $image_id);
}
}
示例4: stop
public function stop()
{
writeln("<comment>Stop running elasticsearch {$this->container}</comment>");
$command = "docker stop {$this->container}";
Helpers::doLocal($command);
}
示例5: kill
public function kill()
{
if ($this->exists()) {
writeln("<comment>Kill Mysql container {$this->container}</comment>");
$command = "docker rm -f {$this->container}";
Helpers::doLocal($command);
}
}