website-comparison/comparison

43 lines
1.1 KiB
Text
Raw Normal View History

#!/usr/bin/env php
<?php
2018-09-03 16:13:47 +02:00
declare(ticks = 1);
pcntl_signal(SIGINT, function () {
exit(99);
});
require __DIR__ . '/vendor/autoload.php';
use Codappix\WebsiteComparison\Command\CompareCommand;
use Codappix\WebsiteComparison\Command\CreateBaseCommand;
use Facebook\WebDriver\Chrome\ChromeDriver;
use Facebook\WebDriver\Chrome\ChromeDriverService;
use Symfony\Component\Console\Application;
use Symfony\Component\EventDispatcher\EventDispatcher;
$eventDispatcher = new EventDispatcher();
$chromeDriver = (function () {
$chromeDriverService = new ChromeDriverService(
'/usr/lib/chromium-browser/chromedriver',
9515,
[
'--port=9515',
'--headless',
]
);
return ChromeDriver::start(null, $chromeDriverService);
})();
2018-09-03 16:13:47 +02:00
$application = new Application();
$application->setDispatcher($eventDispatcher);
// TODO: Use factory for commands, which injects event dispatcher and chrome driver?
$application->add(new CreateBaseCommand($eventDispatcher, $chromeDriver));
$application->add(new CompareCommand($eventDispatcher, $chromeDriver));
$application->run();