add Process component
This commit is contained in:
parent
c60d40fe83
commit
356837b136
|
@ -5,6 +5,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"symfony/console": "^4.2"
|
"symfony/console": "^4.2",
|
||||||
|
"symfony/process": "^4.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Command\Command as BaseCommand;
|
use Symfony\Component\Console\Command\Command as BaseCommand;
|
||||||
use Symfony\Component\Console\Helper\Table;
|
use Symfony\Component\Console\Helper\Table;
|
||||||
|
use Symfony\Component\Process\Process;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class CheckCommand.
|
* class CheckCommand.
|
||||||
|
@ -83,7 +84,16 @@ class CheckCommand extends BaseCommand
|
||||||
|
|
||||||
protected function check($domain)
|
protected function check($domain)
|
||||||
{
|
{
|
||||||
$whois = shell_exec(sprintf('whois %s', escapeshellarg($domain)));
|
$process = new Process(['whois', $domain]);
|
||||||
|
$process->run();
|
||||||
|
|
||||||
|
if (!$process->isSuccessful()) {
|
||||||
|
$this->fails[] = [$domain, 'FAIL'];
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$whois = $process->getOutput();
|
||||||
|
|
||||||
preg_match('/Expiry Date: ([^\s]+)/i', $whois, $match);
|
preg_match('/Expiry Date: ([^\s]+)/i', $whois, $match);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue