@@ -12,7 +12,7 @@ |
||
12 | 12 | $fileSystem = new FileSystem(); |
13 | 13 | |
14 | 14 | if (!$configFilePath) { |
15 | - $configFilePath = SeleniumSetup::$APP_CONF_PATH . DIRECTORY_SEPARATOR . Config::DEFAULT_CONFIGURATION_FILENAME; |
|
15 | + $configFilePath = SeleniumSetup::$APP_CONF_PATH.DIRECTORY_SEPARATOR.Config::DEFAULT_CONFIGURATION_FILENAME; |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | $configContents = $fileSystem->readFile($configFilePath); |
@@ -19,11 +19,11 @@ discard block |
||
19 | 19 | |
20 | 20 | public function openLockFile() |
21 | 21 | { |
22 | - if (!$this->fileSystem->isFile(SeleniumSetup::$APP_ROOT_PATH . DIRECTORY_SEPARATOR . SeleniumSetup::DEFAULT_LOCK_FILENAME)) { |
|
22 | + if (!$this->fileSystem->isFile(SeleniumSetup::$APP_ROOT_PATH.DIRECTORY_SEPARATOR.SeleniumSetup::DEFAULT_LOCK_FILENAME)) { |
|
23 | 23 | return false; |
24 | 24 | } |
25 | 25 | |
26 | - $contents = $this->fileSystem->readFile(SeleniumSetup::$APP_ROOT_PATH . DIRECTORY_SEPARATOR . SeleniumSetup::DEFAULT_LOCK_FILENAME); |
|
26 | + $contents = $this->fileSystem->readFile(SeleniumSetup::$APP_ROOT_PATH.DIRECTORY_SEPARATOR.SeleniumSetup::DEFAULT_LOCK_FILENAME); |
|
27 | 27 | $lockerRaw = json_decode($contents); |
28 | 28 | foreach ($lockerRaw as $serverObj) { |
29 | 29 | $this->addServer(ServerItemFactory::createFromObj($serverObj)); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | public function writeToLockFile() |
35 | 35 | { |
36 | 36 | $this->fileSystem->writeToFile( |
37 | - SeleniumSetup::$APP_ROOT_PATH . DIRECTORY_SEPARATOR . SeleniumSetup::DEFAULT_LOCK_FILENAME, |
|
37 | + SeleniumSetup::$APP_ROOT_PATH.DIRECTORY_SEPARATOR.SeleniumSetup::DEFAULT_LOCK_FILENAME, |
|
38 | 38 | $this->toJson() |
39 | 39 | ); |
40 | 40 |
@@ -54,29 +54,29 @@ discard block |
||
54 | 54 | $writeln[] = '<error>[ ] Your Java version needs to be >= 1.6</error>'; |
55 | 55 | $canInstall = false; |
56 | 56 | } else { |
57 | - $writeln[] = '<info>[x] Your Java version ' . $javaVersion . ' seems up to date.</info>'; |
|
57 | + $writeln[] = '<info>[x] Your Java version '.$javaVersion.' seems up to date.</info>'; |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
61 | 61 | if ($this->isPHPVersionDeprecated()) { |
62 | - $writeln[] = '<error>[ ] Your PHP version ' . $this->getPHPVersion() . ' should be >= 5.3</error>'; |
|
62 | + $writeln[] = '<error>[ ] Your PHP version '.$this->getPHPVersion().' should be >= 5.3</error>'; |
|
63 | 63 | $canInstall = false; |
64 | 64 | } else { |
65 | - $writeln[] = '<info>[x] Your PHP version is ' . $this->getPHPVersion() . '</info>'; |
|
65 | + $writeln[] = '<info>[x] Your PHP version is '.$this->getPHPVersion().'</info>'; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | if (!$this->hasPHPCurlExtInstalled()) { |
69 | 69 | $writeln[] = '<error>[ ] cURL extension for PHP is missing.</error>'; |
70 | 70 | $canInstall = false; |
71 | 71 | } else { |
72 | - $writeln[] = '<info>[x] cURL ' . $this->getPHPCurlExtVersion() . ' extension is installed.</info>'; |
|
72 | + $writeln[] = '<info>[x] cURL '.$this->getPHPCurlExtVersion().' extension is installed.</info>'; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | if (!$this->hasPHPOpenSSLExtInstalled()) { |
76 | 76 | $writeln[] = '<error>[ ] OpenSSL extension for PHP is missing.</error>'; |
77 | 77 | $canInstall = false; |
78 | 78 | } else { |
79 | - $writeln[] = '<info>[x] ' . $this->getPHPOpenSSLExtVersion() . ' extension is installed.</info>'; |
|
79 | + $writeln[] = '<info>[x] '.$this->getPHPOpenSSLExtVersion().' extension is installed.</info>'; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | $this->output->writeln($writeln); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $output->write($line); |
149 | 149 | }); |
150 | 150 | |
151 | - return !(preg_match('/' . $lookForNegative . '/is', $output->fetch())); |
|
151 | + return !(preg_match('/'.$lookForNegative.'/is', $output->fetch())); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | public function getJavaVersion() |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | public function setEnvVar($varName, $varValue = '') |
238 | 238 | { |
239 | 239 | if ($varValue != '') { |
240 | - putenv($varName . '=' . $varValue); |
|
240 | + putenv($varName.'='.$varValue); |
|
241 | 241 | } else { |
242 | 242 | putenv($varName); |
243 | 243 | } |
@@ -251,14 +251,14 @@ discard block |
||
251 | 251 | $separator = ':'; |
252 | 252 | } |
253 | 253 | |
254 | - putenv('PATH=' . getenv('PATH') . $separator . $path); |
|
254 | + putenv('PATH='.getenv('PATH').$separator.$path); |
|
255 | 255 | $this->output->writeln(sprintf('Added %s to global path.', $path)); |
256 | 256 | } |
257 | 257 | |
258 | 258 | public function download($from, $to) |
259 | 259 | { |
260 | 260 | $client = new Client(); |
261 | - $client->setDefaultOption('verify', SeleniumSetup::$APP_ROOT_PATH . DIRECTORY_SEPARATOR . SeleniumSetup::SSL_CERT_FILENAME); |
|
261 | + $client->setDefaultOption('verify', SeleniumSetup::$APP_ROOT_PATH.DIRECTORY_SEPARATOR.SeleniumSetup::SSL_CERT_FILENAME); |
|
262 | 262 | $request = $client->createRequest('GET', $from, ['save_to'=> $to]); |
263 | 263 | |
264 | 264 | $computeRemainingSize = function(ProgressEvent $e) { |
@@ -405,14 +405,14 @@ discard block |
||
405 | 405 | // @todo Refactor this in 5.0; split binaries and drivers; Add Opera. |
406 | 406 | // @see https://github.com/bogdananton/Selenium-Setup/issues/12 |
407 | 407 | $cmdExtra = ''; |
408 | - if ($binary = $this->config->getBinary('chromedriver.' . $this->getOsName() . '.' . $this->getOsType())) { |
|
409 | - $cmdExtra .= sprintf(' -Dwebdriver.chrome.driver=%s', $this->config->getBuildPath() . DIRECTORY_SEPARATOR . $binary->getBinName()); |
|
408 | + if ($binary = $this->config->getBinary('chromedriver.'.$this->getOsName().'.'.$this->getOsType())) { |
|
409 | + $cmdExtra .= sprintf(' -Dwebdriver.chrome.driver=%s', $this->config->getBuildPath().DIRECTORY_SEPARATOR.$binary->getBinName()); |
|
410 | 410 | } |
411 | - if ($binary = $this->config->getBinary('iedriver.' . $this->getOsName() . '.' . $this->getOsType())) { |
|
412 | - $cmdExtra .= sprintf(' -Dwebdriver.ie.driver=%s', $this->config->getBuildPath() . DIRECTORY_SEPARATOR . $binary->getBinName()); |
|
411 | + if ($binary = $this->config->getBinary('iedriver.'.$this->getOsName().'.'.$this->getOsType())) { |
|
412 | + $cmdExtra .= sprintf(' -Dwebdriver.ie.driver=%s', $this->config->getBuildPath().DIRECTORY_SEPARATOR.$binary->getBinName()); |
|
413 | 413 | } |
414 | - if ($binary = $this->config->getBinary('phantomjs.' . $this->getOsName() . '.' . $this->getOsType())) { |
|
415 | - $cmdExtra .= sprintf(' -Dphantomjs.binary.path=%s', $this->config->getBuildPath() . DIRECTORY_SEPARATOR . $binary->getBinName()); |
|
414 | + if ($binary = $this->config->getBinary('phantomjs.'.$this->getOsName().'.'.$this->getOsType())) { |
|
415 | + $cmdExtra .= sprintf(' -Dphantomjs.binary.path=%s', $this->config->getBuildPath().DIRECTORY_SEPARATOR.$binary->getBinName()); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | if ($this->isWindows()) { |
@@ -423,11 +423,11 @@ discard block |
||
423 | 423 | } |
424 | 424 | |
425 | 425 | $cmd = vsprintf($cmd, [ |
426 | - 'binary' => $this->config->getBuildPath() . DIRECTORY_SEPARATOR . $this->config->getBinary('selenium')->getBinName(), |
|
426 | + 'binary' => $this->config->getBuildPath().DIRECTORY_SEPARATOR.$this->config->getBinary('selenium')->getBinName(), |
|
427 | 427 | 'port' => $this->config->getPort(), |
428 | 428 | 'proxyHost' => $this->config->getProxyHost(), |
429 | 429 | 'proxyPort' => $this->config->getProxyPort(), |
430 | - 'log' => $this->config->getLogsPath() . DIRECTORY_SEPARATOR . 'selenium.log', |
|
430 | + 'log' => $this->config->getLogsPath().DIRECTORY_SEPARATOR.'selenium.log', |
|
431 | 431 | 'cmdExtra' => $cmdExtra |
432 | 432 | ]); |
433 | 433 |
@@ -44,7 +44,7 @@ |
||
44 | 44 | $configFilePath = null; |
45 | 45 | |
46 | 46 | if ($input->getArgument('name')) { |
47 | - $configFilePath = SeleniumSetup::$APP_CONF_PATH . DIRECTORY_SEPARATOR . $input->getArgument('name') . '.json'; |
|
47 | + $configFilePath = SeleniumSetup::$APP_CONF_PATH.DIRECTORY_SEPARATOR.$input->getArgument('name').'.json'; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | if ($input->getOption('config')) { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | protected function getInstanceConfigFilename($name) |
72 | 72 | { |
73 | - return dirname($this->config->getFilePath()) . DIRECTORY_SEPARATOR . $name . '.json'; |
|
73 | + return dirname($this->config->getFilePath()).DIRECTORY_SEPARATOR.$name.'.json'; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -120,6 +120,6 @@ discard block |
||
120 | 120 | } |
121 | 121 | |
122 | 122 | protected function log($message, $value = null, $type = self::LOG_TYPE_INFO) { |
123 | - $this->output->writeln(sprintf('<' . $type . '>' . $message . '</' . $type . '>', $value)); |
|
123 | + $this->output->writeln(sprintf('<'.$type.'>'.$message.'</'.$type.'>', $value)); |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 | \ No newline at end of file |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | continue; |
35 | 35 | } |
36 | 36 | |
37 | - $binaryPath = $this->config->getBuildPath() . DIRECTORY_SEPARATOR . $binary->getBinName(); |
|
37 | + $binaryPath = $this->config->getBuildPath().DIRECTORY_SEPARATOR.$binary->getBinName(); |
|
38 | 38 | |
39 | 39 | if (!$this->fileSystem->isFile($binaryPath)) { |
40 | 40 | $this->output->writeln( |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | ); |
43 | 43 | |
44 | 44 | // Download. |
45 | - $downloadTo = $this->config->getBuildPath() . DIRECTORY_SEPARATOR . pathinfo($binary->getDownloadUrl(), PATHINFO_BASENAME); |
|
45 | + $downloadTo = $this->config->getBuildPath().DIRECTORY_SEPARATOR.pathinfo($binary->getDownloadUrl(), PATHINFO_BASENAME); |
|
46 | 46 | $download = $this->env->download($binary->getDownloadUrl(), $downloadTo); |
47 | 47 | $this->output->writeln($download); |
48 | 48 | |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | $zip->close(); |
59 | 59 | } |
60 | 60 | } else { |
61 | - $this->fileSystem->rename($downloadTo, $this->config->getBuildPath() . DIRECTORY_SEPARATOR . $binary->getBinName()); |
|
61 | + $this->fileSystem->rename($downloadTo, $this->config->getBuildPath().DIRECTORY_SEPARATOR.$binary->getBinName()); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | // Make executable. |
65 | - $this->env->makeExecutable($this->config->getBuildPath() . DIRECTORY_SEPARATOR . $binary->getBinName()); |
|
65 | + $this->env->makeExecutable($this->config->getBuildPath().DIRECTORY_SEPARATOR.$binary->getBinName()); |
|
66 | 66 | } else { |
67 | 67 | $this->output->writeln( |
68 | 68 | sprintf('Skipping %s %s. Binary already exists.', $binary->getLabel(), $binary->getVersion()) |
@@ -88,13 +88,13 @@ discard block |
||
88 | 88 | |
89 | 89 | // Warn if Chrome or Firefox binaries are not available. |
90 | 90 | if ($chromeVersion = $this->env->getChromeVersion()) { |
91 | - $this->output->writeln('Chrome binary found, v.' . $chromeVersion); |
|
91 | + $this->output->writeln('Chrome binary found, v.'.$chromeVersion); |
|
92 | 92 | } else { |
93 | 93 | $this->output->writeln('<info>WARNING: Chrome binary not found.</info>'); |
94 | 94 | } |
95 | 95 | |
96 | 96 | if ($firefoxVersion = $this->env->getFirefoxVersion()) { |
97 | - $this->output->writeln('Firefox binary found, v.' . $firefoxVersion); |
|
97 | + $this->output->writeln('Firefox binary found, v.'.$firefoxVersion); |
|
98 | 98 | } else { |
99 | 99 | $this->output->writeln('<info>WARNING: Firefox binary not found.</info>'); |
100 | 100 | } |
@@ -34,8 +34,8 @@ |
||
34 | 34 | |
35 | 35 | public function __construct() |
36 | 36 | { |
37 | - self::$APP_ROOT_PATH = realpath(dirname(__FILE__) . '/../'); |
|
38 | - self::$APP_CONF_PATH = realpath(dirname(__FILE__) . '/../config/'); |
|
37 | + self::$APP_ROOT_PATH = realpath(dirname(__FILE__).'/../'); |
|
38 | + self::$APP_CONF_PATH = realpath(dirname(__FILE__).'/../config/'); |
|
39 | 39 | self::$APP_PROCESS_ENV = array_merge($_SERVER, $_ENV); |
40 | 40 | } |
41 | 41 |