Selaa lähdekoodia

增加远程浏览器工具

shawenguan 1 vuosi sitten
vanhempi
commit
acf8fc1403
100 muutettua tiedostoa jossa 5312 lisäystä ja 0 poistoa
  1. 504 0
      Current.conf
  2. 7 0
      Filter/GoogleVoice.list
  3. 5 0
      RemoteBrowser/composer.json
  4. 73 0
      RemoteBrowser/composer.lock
  5. 135 0
      RemoteBrowser/index.php
  6. 0 0
      RemoteBrowser/main.py
  7. 0 0
      RemoteBrowser/readme.md
  8. 6 0
      RemoteBrowser/stealth.min.js
  9. 7 0
      RemoteBrowser/vendor/autoload.php
  10. 572 0
      RemoteBrowser/vendor/composer/ClassLoader.php
  11. 357 0
      RemoteBrowser/vendor/composer/InstalledVersions.php
  12. 21 0
      RemoteBrowser/vendor/composer/LICENSE
  13. 10 0
      RemoteBrowser/vendor/composer/autoload_classmap.php
  14. 9 0
      RemoteBrowser/vendor/composer/autoload_namespaces.php
  15. 10 0
      RemoteBrowser/vendor/composer/autoload_psr4.php
  16. 57 0
      RemoteBrowser/vendor/composer/autoload_real.php
  17. 36 0
      RemoteBrowser/vendor/composer/autoload_static.php
  18. 63 0
      RemoteBrowser/vendor/composer/installed.json
  19. 32 0
      RemoteBrowser/vendor/composer/installed.php
  20. 26 0
      RemoteBrowser/vendor/composer/platform_check.php
  21. 10 0
      RemoteBrowser/vendor/php-webdriver/webdriver/.gitignore
  22. 36 0
      RemoteBrowser/vendor/php-webdriver/webdriver/.travis.yml
  23. 120 0
      RemoteBrowser/vendor/php-webdriver/webdriver/README.md
  24. 33 0
      RemoteBrowser/vendor/php-webdriver/webdriver/composer.json
  25. 54 0
      RemoteBrowser/vendor/php-webdriver/webdriver/example.php
  26. 86 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Chrome/ChromeDriver.php
  27. 33 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Chrome/ChromeDriverService.php
  28. 162 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Chrome/ChromeOptions.php
  29. 21 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/ElementNotSelectableException.php
  30. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/ElementNotVisibleException.php
  31. 21 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/ExpectedException.php
  32. 21 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/IMEEngineActivationFailedException.php
  33. 21 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/IMENotAvailableException.php
  34. 7 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/IndexOutOfBoundsException.php
  35. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/InvalidCookieDomainException.php
  36. 21 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/InvalidCoordinatesException.php
  37. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/InvalidElementStateException.php
  38. 21 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/InvalidSelectorException.php
  39. 21 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/MoveTargetOutOfBoundsException.php
  40. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoAlertOpenException.php
  41. 7 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoCollectionException.php
  42. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoScriptResultException.php
  43. 7 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoStringException.php
  44. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoStringLengthException.php
  45. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoStringWrapperException.php
  46. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoSuchCollectionException.php
  47. 21 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoSuchDocumentException.php
  48. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoSuchDriverException.php
  49. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoSuchElementException.php
  50. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoSuchFrameException.php
  51. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoSuchWindowException.php
  52. 21 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NullPointerException.php
  53. 21 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/ScriptTimeoutException.php
  54. 21 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/SessionNotCreatedException.php
  55. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/StaleElementReferenceException.php
  56. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/TimeOutException.php
  57. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnableToSetCookieException.php
  58. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnexpectedAlertOpenException.php
  59. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnexpectedJavascriptException.php
  60. 34 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnexpectedTagNameException.php
  61. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnknownCommandException.php
  62. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnknownServerException.php
  63. 21 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnrecognizedExceptionException.php
  64. 21 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnsupportedOperationException.php
  65. 21 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/WebDriverCurlException.php
  66. 165 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/WebDriverException.php
  67. 20 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/XPathLookupException.php
  68. 24 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Firefox/FirefoxDriver.php
  69. 33 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Firefox/FirefoxPreferences.php
  70. 257 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Firefox/FirefoxProfile.php
  71. 30 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverButtonReleaseAction.php
  72. 27 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverClickAction.php
  73. 30 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverClickAndHoldAction.php
  74. 30 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverContextClickAction.php
  75. 75 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverCoordinates.php
  76. 27 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverDoubleClickAction.php
  77. 28 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeyDownAction.php
  78. 28 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeyUpAction.php
  79. 53 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeysRelatedAction.php
  80. 60 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMouseAction.php
  81. 27 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMouseMoveAction.php
  82. 44 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMoveToOffsetAction.php
  83. 48 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverSendKeysAction.php
  84. 37 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverSingleKeyAction.php
  85. 27 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverDoubleTapAction.php
  86. 41 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverDownAction.php
  87. 38 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverFlickAction.php
  88. 54 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverFlickFromElementAction.php
  89. 27 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverLongPressAction.php
  90. 41 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverMoveAction.php
  91. 41 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverScrollAction.php
  92. 49 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverScrollFromElementAction.php
  93. 27 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverTapAction.php
  94. 56 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverTouchAction.php
  95. 122 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverTouchScreen.php
  96. 251 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/WebDriverActions.php
  97. 55 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/WebDriverCompositeAction.php
  98. 169 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/WebDriverTouchActions.php
  99. 29 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/Internal/WebDriverLocatable.php
  100. 49 0
      RemoteBrowser/vendor/php-webdriver/webdriver/lib/JavaScriptExecutor.php

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 504 - 0
Current.conf


+ 7 - 0
Filter/GoogleVoice.list

@@ -0,0 +1,7 @@
+# NAME: GoogleVoice
+# AUTHOR: blackmatrix7
+# REPO: https://github.com/blackmatrix7/ios_rule_script
+# UPDATED: 2024-07-03 16:16:59
+# HOST: 1
+# TOTAL: 1
+HOST,lens.l.google.com,GoogleVoice

+ 5 - 0
RemoteBrowser/composer.json

@@ -0,0 +1,5 @@
+{
+    "require": {
+        "php-webdriver/webdriver": "^1.1"
+    }
+}

+ 73 - 0
RemoteBrowser/composer.lock

@@ -0,0 +1,73 @@
+{
+    "_readme": [
+        "This file locks the dependencies of your project to a known state",
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+        "This file is @generated automatically"
+    ],
+    "content-hash": "e1890856b0a3c088a4c3a429fc523090",
+    "packages": [
+        {
+            "name": "php-webdriver/webdriver",
+            "version": "1.1.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-webdriver/php-webdriver.git",
+                "reference": "1c98108ba3eb435b681655764de11502a0653705"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/1c98108ba3eb435b681655764de11502a0653705",
+                "reference": "1c98108ba3eb435b681655764de11502a0653705",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "php": ">=5.3.19"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "4.6.*"
+            },
+            "suggest": {
+                "phpdocumentor/phpdocumentor": "2.*"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Facebook\\WebDriver\\": "lib/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "Apache-2.0"
+            ],
+            "description": "A PHP client for WebDriver",
+            "homepage": "https://github.com/facebook/php-webdriver",
+            "keywords": [
+                "facebook",
+                "php",
+                "selenium",
+                "webdriver"
+            ],
+            "support": {
+                "forum": "https://www.facebook.com/groups/phpwebdriver/",
+                "issues": "https://github.com/facebook/php-webdriver/issues",
+                "source": "https://github.com/facebook/php-webdriver"
+            },
+            "time": "2015-12-31T15:58:49+00:00"
+        }
+    ],
+    "packages-dev": [],
+    "aliases": [],
+    "minimum-stability": "stable",
+    "stability-flags": [],
+    "prefer-stable": false,
+    "prefer-lowest": false,
+    "platform": [],
+    "platform-dev": [],
+    "plugin-api-version": "2.2.0"
+}

+ 135 - 0
RemoteBrowser/index.php

@@ -0,0 +1,135 @@
+<?php
+// 设置错误报告级别,排除NOTICE和DEPRECATED
+error_reporting(E_ALL & ~(E_NOTICE | E_DEPRECATED));
+
+require_once('vendor/autoload.php'); // 导入WebDriver库
+
+use Facebook\WebDriver\Remote\RemoteWebDriver;
+use Facebook\WebDriver\Remote\DesiredCapabilities;
+use Facebook\WebDriver\Chrome\ChromeOptions;
+use Facebook\WebDriver\Firefox\FirefoxOptions;
+
+$driverType = 'chrome';
+$capabilities = null;
+
+// selenium-server-standalone-#.jar (version 2.x or 3.x)
+$serverUrl = 'http://localhost:4444/wd/hub';
+$webUrl = 'https://www.baidu.com/';
+$customHeaders = null;
+
+$postData = $_REQUEST;
+if ($_SERVER['REQUEST_METHOD'] == 'POST') {
+    $contentType = $_SERVER['CONTENT_TYPE'];
+    if (strpos($contentType, 'application/json') !== false) {
+        $jsonData = file_get_contents('php://input');
+        try {
+            $postData = json_decode($jsonData, true);
+        } catch (Exception $e) {
+            $postData = $_REQUEST;
+        }
+    } elseif (strpos($contentType, 'application/x-www-form-urlencoded') !== false) {
+        // echo "POST数据格式为表单数据";
+        $postData = $_REQUEST;
+    } elseif (strpos($contentType, 'multipart/form-data') !== false) {
+        $postData = $_FILES['file'];
+    } else {
+        $jsonData = file_get_contents('php://input');
+        try {
+            $postData = json_decode($jsonData, true);
+        } catch (Exception $e) {
+            $postData = $_REQUEST;
+        }
+    }
+}
+
+if (isset($postData['url'])) {
+    $webUrl = urldecode($postData['url']);
+    if (!preg_match('/^(http:\/\/|https:\/\/)/', $webUrl)) {
+        $webUrl = 'http://' . $webUrl;
+    }
+}
+if (isset($postData['headers'])) {
+    try {
+        if(is_string($postData['headers']) && !empty($postData['headers'])) {
+            $customHeaders = json_decode($postData['headers'], true);
+        } else {
+            $customHeaders = $postData['headers'];
+        }
+    } catch (Exception $e) {
+        $customHeaders = null;
+    }
+}
+
+// selenium-server-standalone-#.jar (version 4.x)
+switch ($driverType) {
+    case 'chrome':
+        // Chrome
+        $capabilities = DesiredCapabilities::chrome();
+        $options = new ChromeOptions();
+        $userAgent =  'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3';
+        if($customHeaders && isset($customHeaders['User-Agent'])){
+            $capabilities->setCapability('userAgent', $customHeaders['User-Agent']);
+            $capabilities->setCapability('user-agent', $customHeaders['User-Agent']);
+            $userAgent = $customHeaders['User-Agent'];
+        }
+        $options->addArguments([
+            // '--headless', // 启用无头模式
+            '--disable-gpu', // 禁用GPU加速
+            '--user-agent='.$userAgent,
+            '--disable-blink-features=AutomationControlled',
+            '--disable-browser-side-navigation',
+            '--disable-dev-shm-usage'
+        ]);
+        $capabilities->setCapability(ChromeOptions::CAPABILITY, $options);
+        break;
+    case 'firefox':
+        // Firefox
+        $capabilities = DesiredCapabilities::firefox();
+        break;
+    case 'edge':
+        // Microsoft Edge
+        $capabilities = DesiredCapabilities::microsoftEdge();
+        break;
+    default:
+        // Chrome
+        $capabilities = DesiredCapabilities::chrome();
+        break;
+}
+
+// Disable accepting SSL certificates
+$capabilities->setCapability('acceptSslCerts', false);
+
+$driver = RemoteWebDriver::create($serverUrl, $capabilities);
+
+$driver->get($webUrl);
+
+// 读取stealth.min.js文件内容
+$stealthJsPath = __DIR__ . '/stealth.min.js';
+$stealthJsContent = file_get_contents($stealthJsPath);
+// 注入stealth.min.js内容
+$driver->executeScript($stealthJsContent);
+
+if($customHeaders && isset($customHeaders['Cookie'])){
+    $cookieString = $customHeaders['Cookie'];
+    $cookies = explode('; ', $cookieString);
+    foreach ($cookies as $cookie) {
+        list($name, $value) = explode('=', $cookie, 2);
+        $driver->manage()->addCookie([
+            'name' => $name,
+            'value' => $value,
+        ]);
+    }
+    sleep(1);
+    // 刷新页面以确保Cookie生效
+    $driver->navigate()->refresh();
+    $driver->executeScript($stealthJsContent);
+}
+
+$content = $driver->getPageSource();
+
+$cookies = $driver->manage()->getCookies();
+
+echo $content;
+
+$driver->quit();
+?>

+ 0 - 0
BrowserProxy/main.py → RemoteBrowser/main.py


+ 0 - 0
BrowserProxy/readme.md → RemoteBrowser/readme.md


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 6 - 0
RemoteBrowser/stealth.min.js


+ 7 - 0
RemoteBrowser/vendor/autoload.php

@@ -0,0 +1,7 @@
+<?php
+
+// autoload.php @generated by Composer
+
+require_once __DIR__ . '/composer/autoload_real.php';
+
+return ComposerAutoloaderInit2441b680d5bab527f150524762f5f709::getLoader();

+ 572 - 0
RemoteBrowser/vendor/composer/ClassLoader.php

@@ -0,0 +1,572 @@
+<?php
+
+/*
+ * This file is part of Composer.
+ *
+ * (c) Nils Adermann <[email protected]>
+ *     Jordi Boggiano <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Autoload;
+
+/**
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
+ *
+ *     $loader = new \Composer\Autoload\ClassLoader();
+ *
+ *     // register classes with namespaces
+ *     $loader->add('Symfony\Component', __DIR__.'/component');
+ *     $loader->add('Symfony',           __DIR__.'/framework');
+ *
+ *     // activate the autoloader
+ *     $loader->register();
+ *
+ *     // to enable searching the include path (eg. for PEAR packages)
+ *     $loader->setUseIncludePath(true);
+ *
+ * In this example, if you try to use a class in the Symfony\Component
+ * namespace or one of its children (Symfony\Component\Console for instance),
+ * the autoloader will first look for the class under the component/
+ * directory, and it will then fallback to the framework/ directory if not
+ * found before giving up.
+ *
+ * This class is loosely based on the Symfony UniversalClassLoader.
+ *
+ * @author Fabien Potencier <[email protected]>
+ * @author Jordi Boggiano <[email protected]>
+ * @see    https://www.php-fig.org/psr/psr-0/
+ * @see    https://www.php-fig.org/psr/psr-4/
+ */
+class ClassLoader
+{
+    /** @var ?string */
+    private $vendorDir;
+
+    // PSR-4
+    /**
+     * @var array[]
+     * @psalm-var array<string, array<string, int>>
+     */
+    private $prefixLengthsPsr4 = array();
+    /**
+     * @var array[]
+     * @psalm-var array<string, array<int, string>>
+     */
+    private $prefixDirsPsr4 = array();
+    /**
+     * @var array[]
+     * @psalm-var array<string, string>
+     */
+    private $fallbackDirsPsr4 = array();
+
+    // PSR-0
+    /**
+     * @var array[]
+     * @psalm-var array<string, array<string, string[]>>
+     */
+    private $prefixesPsr0 = array();
+    /**
+     * @var array[]
+     * @psalm-var array<string, string>
+     */
+    private $fallbackDirsPsr0 = array();
+
+    /** @var bool */
+    private $useIncludePath = false;
+
+    /**
+     * @var string[]
+     * @psalm-var array<string, string>
+     */
+    private $classMap = array();
+
+    /** @var bool */
+    private $classMapAuthoritative = false;
+
+    /**
+     * @var bool[]
+     * @psalm-var array<string, bool>
+     */
+    private $missingClasses = array();
+
+    /** @var ?string */
+    private $apcuPrefix;
+
+    /**
+     * @var self[]
+     */
+    private static $registeredLoaders = array();
+
+    /**
+     * @param ?string $vendorDir
+     */
+    public function __construct($vendorDir = null)
+    {
+        $this->vendorDir = $vendorDir;
+    }
+
+    /**
+     * @return string[]
+     */
+    public function getPrefixes()
+    {
+        if (!empty($this->prefixesPsr0)) {
+            return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
+        }
+
+        return array();
+    }
+
+    /**
+     * @return array[]
+     * @psalm-return array<string, array<int, string>>
+     */
+    public function getPrefixesPsr4()
+    {
+        return $this->prefixDirsPsr4;
+    }
+
+    /**
+     * @return array[]
+     * @psalm-return array<string, string>
+     */
+    public function getFallbackDirs()
+    {
+        return $this->fallbackDirsPsr0;
+    }
+
+    /**
+     * @return array[]
+     * @psalm-return array<string, string>
+     */
+    public function getFallbackDirsPsr4()
+    {
+        return $this->fallbackDirsPsr4;
+    }
+
+    /**
+     * @return string[] Array of classname => path
+     * @psalm-return array<string, string>
+     */
+    public function getClassMap()
+    {
+        return $this->classMap;
+    }
+
+    /**
+     * @param string[] $classMap Class to filename map
+     * @psalm-param array<string, string> $classMap
+     *
+     * @return void
+     */
+    public function addClassMap(array $classMap)
+    {
+        if ($this->classMap) {
+            $this->classMap = array_merge($this->classMap, $classMap);
+        } else {
+            $this->classMap = $classMap;
+        }
+    }
+
+    /**
+     * Registers a set of PSR-0 directories for a given prefix, either
+     * appending or prepending to the ones previously set for this prefix.
+     *
+     * @param string          $prefix  The prefix
+     * @param string[]|string $paths   The PSR-0 root directories
+     * @param bool            $prepend Whether to prepend the directories
+     *
+     * @return void
+     */
+    public function add($prefix, $paths, $prepend = false)
+    {
+        if (!$prefix) {
+            if ($prepend) {
+                $this->fallbackDirsPsr0 = array_merge(
+                    (array) $paths,
+                    $this->fallbackDirsPsr0
+                );
+            } else {
+                $this->fallbackDirsPsr0 = array_merge(
+                    $this->fallbackDirsPsr0,
+                    (array) $paths
+                );
+            }
+
+            return;
+        }
+
+        $first = $prefix[0];
+        if (!isset($this->prefixesPsr0[$first][$prefix])) {
+            $this->prefixesPsr0[$first][$prefix] = (array) $paths;
+
+            return;
+        }
+        if ($prepend) {
+            $this->prefixesPsr0[$first][$prefix] = array_merge(
+                (array) $paths,
+                $this->prefixesPsr0[$first][$prefix]
+            );
+        } else {
+            $this->prefixesPsr0[$first][$prefix] = array_merge(
+                $this->prefixesPsr0[$first][$prefix],
+                (array) $paths
+            );
+        }
+    }
+
+    /**
+     * Registers a set of PSR-4 directories for a given namespace, either
+     * appending or prepending to the ones previously set for this namespace.
+     *
+     * @param string          $prefix  The prefix/namespace, with trailing '\\'
+     * @param string[]|string $paths   The PSR-4 base directories
+     * @param bool            $prepend Whether to prepend the directories
+     *
+     * @throws \InvalidArgumentException
+     *
+     * @return void
+     */
+    public function addPsr4($prefix, $paths, $prepend = false)
+    {
+        if (!$prefix) {
+            // Register directories for the root namespace.
+            if ($prepend) {
+                $this->fallbackDirsPsr4 = array_merge(
+                    (array) $paths,
+                    $this->fallbackDirsPsr4
+                );
+            } else {
+                $this->fallbackDirsPsr4 = array_merge(
+                    $this->fallbackDirsPsr4,
+                    (array) $paths
+                );
+            }
+        } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
+            // Register directories for a new namespace.
+            $length = strlen($prefix);
+            if ('\\' !== $prefix[$length - 1]) {
+                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+            }
+            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+            $this->prefixDirsPsr4[$prefix] = (array) $paths;
+        } elseif ($prepend) {
+            // Prepend directories for an already registered namespace.
+            $this->prefixDirsPsr4[$prefix] = array_merge(
+                (array) $paths,
+                $this->prefixDirsPsr4[$prefix]
+            );
+        } else {
+            // Append directories for an already registered namespace.
+            $this->prefixDirsPsr4[$prefix] = array_merge(
+                $this->prefixDirsPsr4[$prefix],
+                (array) $paths
+            );
+        }
+    }
+
+    /**
+     * Registers a set of PSR-0 directories for a given prefix,
+     * replacing any others previously set for this prefix.
+     *
+     * @param string          $prefix The prefix
+     * @param string[]|string $paths  The PSR-0 base directories
+     *
+     * @return void
+     */
+    public function set($prefix, $paths)
+    {
+        if (!$prefix) {
+            $this->fallbackDirsPsr0 = (array) $paths;
+        } else {
+            $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
+        }
+    }
+
+    /**
+     * Registers a set of PSR-4 directories for a given namespace,
+     * replacing any others previously set for this namespace.
+     *
+     * @param string          $prefix The prefix/namespace, with trailing '\\'
+     * @param string[]|string $paths  The PSR-4 base directories
+     *
+     * @throws \InvalidArgumentException
+     *
+     * @return void
+     */
+    public function setPsr4($prefix, $paths)
+    {
+        if (!$prefix) {
+            $this->fallbackDirsPsr4 = (array) $paths;
+        } else {
+            $length = strlen($prefix);
+            if ('\\' !== $prefix[$length - 1]) {
+                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+            }
+            $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+            $this->prefixDirsPsr4[$prefix] = (array) $paths;
+        }
+    }
+
+    /**
+     * Turns on searching the include path for class files.
+     *
+     * @param bool $useIncludePath
+     *
+     * @return void
+     */
+    public function setUseIncludePath($useIncludePath)
+    {
+        $this->useIncludePath = $useIncludePath;
+    }
+
+    /**
+     * Can be used to check if the autoloader uses the include path to check
+     * for classes.
+     *
+     * @return bool
+     */
+    public function getUseIncludePath()
+    {
+        return $this->useIncludePath;
+    }
+
+    /**
+     * Turns off searching the prefix and fallback directories for classes
+     * that have not been registered with the class map.
+     *
+     * @param bool $classMapAuthoritative
+     *
+     * @return void
+     */
+    public function setClassMapAuthoritative($classMapAuthoritative)
+    {
+        $this->classMapAuthoritative = $classMapAuthoritative;
+    }
+
+    /**
+     * Should class lookup fail if not found in the current class map?
+     *
+     * @return bool
+     */
+    public function isClassMapAuthoritative()
+    {
+        return $this->classMapAuthoritative;
+    }
+
+    /**
+     * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
+     *
+     * @param string|null $apcuPrefix
+     *
+     * @return void
+     */
+    public function setApcuPrefix($apcuPrefix)
+    {
+        $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
+    }
+
+    /**
+     * The APCu prefix in use, or null if APCu caching is not enabled.
+     *
+     * @return string|null
+     */
+    public function getApcuPrefix()
+    {
+        return $this->apcuPrefix;
+    }
+
+    /**
+     * Registers this instance as an autoloader.
+     *
+     * @param bool $prepend Whether to prepend the autoloader or not
+     *
+     * @return void
+     */
+    public function register($prepend = false)
+    {
+        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+
+        if (null === $this->vendorDir) {
+            return;
+        }
+
+        if ($prepend) {
+            self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
+        } else {
+            unset(self::$registeredLoaders[$this->vendorDir]);
+            self::$registeredLoaders[$this->vendorDir] = $this;
+        }
+    }
+
+    /**
+     * Unregisters this instance as an autoloader.
+     *
+     * @return void
+     */
+    public function unregister()
+    {
+        spl_autoload_unregister(array($this, 'loadClass'));
+
+        if (null !== $this->vendorDir) {
+            unset(self::$registeredLoaders[$this->vendorDir]);
+        }
+    }
+
+    /**
+     * Loads the given class or interface.
+     *
+     * @param  string    $class The name of the class
+     * @return true|null True if loaded, null otherwise
+     */
+    public function loadClass($class)
+    {
+        if ($file = $this->findFile($class)) {
+            includeFile($file);
+
+            return true;
+        }
+
+        return null;
+    }
+
+    /**
+     * Finds the path to the file where the class is defined.
+     *
+     * @param string $class The name of the class
+     *
+     * @return string|false The path if found, false otherwise
+     */
+    public function findFile($class)
+    {
+        // class map lookup
+        if (isset($this->classMap[$class])) {
+            return $this->classMap[$class];
+        }
+        if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
+            return false;
+        }
+        if (null !== $this->apcuPrefix) {
+            $file = apcu_fetch($this->apcuPrefix.$class, $hit);
+            if ($hit) {
+                return $file;
+            }
+        }
+
+        $file = $this->findFileWithExtension($class, '.php');
+
+        // Search for Hack files if we are running on HHVM
+        if (false === $file && defined('HHVM_VERSION')) {
+            $file = $this->findFileWithExtension($class, '.hh');
+        }
+
+        if (null !== $this->apcuPrefix) {
+            apcu_add($this->apcuPrefix.$class, $file);
+        }
+
+        if (false === $file) {
+            // Remember that this class does not exist.
+            $this->missingClasses[$class] = true;
+        }
+
+        return $file;
+    }
+
+    /**
+     * Returns the currently registered loaders indexed by their corresponding vendor directories.
+     *
+     * @return self[]
+     */
+    public static function getRegisteredLoaders()
+    {
+        return self::$registeredLoaders;
+    }
+
+    /**
+     * @param  string       $class
+     * @param  string       $ext
+     * @return string|false
+     */
+    private function findFileWithExtension($class, $ext)
+    {
+        // PSR-4 lookup
+        $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
+
+        $first = $class[0];
+        if (isset($this->prefixLengthsPsr4[$first])) {
+            $subPath = $class;
+            while (false !== $lastPos = strrpos($subPath, '\\')) {
+                $subPath = substr($subPath, 0, $lastPos);
+                $search = $subPath . '\\';
+                if (isset($this->prefixDirsPsr4[$search])) {
+                    $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
+                    foreach ($this->prefixDirsPsr4[$search] as $dir) {
+                        if (file_exists($file = $dir . $pathEnd)) {
+                            return $file;
+                        }
+                    }
+                }
+            }
+        }
+
+        // PSR-4 fallback dirs
+        foreach ($this->fallbackDirsPsr4 as $dir) {
+            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
+                return $file;
+            }
+        }
+
+        // PSR-0 lookup
+        if (false !== $pos = strrpos($class, '\\')) {
+            // namespaced class name
+            $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
+                . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
+        } else {
+            // PEAR-like class name
+            $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
+        }
+
+        if (isset($this->prefixesPsr0[$first])) {
+            foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
+                if (0 === strpos($class, $prefix)) {
+                    foreach ($dirs as $dir) {
+                        if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+                            return $file;
+                        }
+                    }
+                }
+            }
+        }
+
+        // PSR-0 fallback dirs
+        foreach ($this->fallbackDirsPsr0 as $dir) {
+            if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+                return $file;
+            }
+        }
+
+        // PSR-0 include paths.
+        if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
+            return $file;
+        }
+
+        return false;
+    }
+}
+
+/**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ *
+ * @param  string $file
+ * @return void
+ * @private
+ */
+function includeFile($file)
+{
+    include $file;
+}

+ 357 - 0
RemoteBrowser/vendor/composer/InstalledVersions.php

@@ -0,0 +1,357 @@
+<?php
+
+/*
+ * This file is part of Composer.
+ *
+ * (c) Nils Adermann <[email protected]>
+ *     Jordi Boggiano <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer;
+
+use Composer\Autoload\ClassLoader;
+use Composer\Semver\VersionParser;
+
+/**
+ * This class is copied in every Composer installed project and available to all
+ *
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
+ *
+ * To require its presence, you can require `composer-runtime-api ^2.0`
+ */
+class InstalledVersions
+{
+    /**
+     * @var mixed[]|null
+     * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
+     */
+    private static $installed;
+
+    /**
+     * @var bool|null
+     */
+    private static $canGetVendors;
+
+    /**
+     * @var array[]
+     * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
+     */
+    private static $installedByVendor = array();
+
+    /**
+     * Returns a list of all package names which are present, either by being installed, replaced or provided
+     *
+     * @return string[]
+     * @psalm-return list<string>
+     */
+    public static function getInstalledPackages()
+    {
+        $packages = array();
+        foreach (self::getInstalled() as $installed) {
+            $packages[] = array_keys($installed['versions']);
+        }
+
+        if (1 === \count($packages)) {
+            return $packages[0];
+        }
+
+        return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
+    }
+
+    /**
+     * Returns a list of all package names with a specific type e.g. 'library'
+     *
+     * @param  string   $type
+     * @return string[]
+     * @psalm-return list<string>
+     */
+    public static function getInstalledPackagesByType($type)
+    {
+        $packagesByType = array();
+
+        foreach (self::getInstalled() as $installed) {
+            foreach ($installed['versions'] as $name => $package) {
+                if (isset($package['type']) && $package['type'] === $type) {
+                    $packagesByType[] = $name;
+                }
+            }
+        }
+
+        return $packagesByType;
+    }
+
+    /**
+     * Checks whether the given package is installed
+     *
+     * This also returns true if the package name is provided or replaced by another package
+     *
+     * @param  string $packageName
+     * @param  bool   $includeDevRequirements
+     * @return bool
+     */
+    public static function isInstalled($packageName, $includeDevRequirements = true)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (isset($installed['versions'][$packageName])) {
+                return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Checks whether the given package satisfies a version constraint
+     *
+     * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
+     *
+     *   Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
+     *
+     * @param  VersionParser $parser      Install composer/semver to have access to this class and functionality
+     * @param  string        $packageName
+     * @param  string|null   $constraint  A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
+     * @return bool
+     */
+    public static function satisfies(VersionParser $parser, $packageName, $constraint)
+    {
+        $constraint = $parser->parseConstraints($constraint);
+        $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
+
+        return $provided->matches($constraint);
+    }
+
+    /**
+     * Returns a version constraint representing all the range(s) which are installed for a given package
+     *
+     * It is easier to use this via isInstalled() with the $constraint argument if you need to check
+     * whether a given version of a package is installed, and not just whether it exists
+     *
+     * @param  string $packageName
+     * @return string Version constraint usable with composer/semver
+     */
+    public static function getVersionRanges($packageName)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (!isset($installed['versions'][$packageName])) {
+                continue;
+            }
+
+            $ranges = array();
+            if (isset($installed['versions'][$packageName]['pretty_version'])) {
+                $ranges[] = $installed['versions'][$packageName]['pretty_version'];
+            }
+            if (array_key_exists('aliases', $installed['versions'][$packageName])) {
+                $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
+            }
+            if (array_key_exists('replaced', $installed['versions'][$packageName])) {
+                $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
+            }
+            if (array_key_exists('provided', $installed['versions'][$packageName])) {
+                $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
+            }
+
+            return implode(' || ', $ranges);
+        }
+
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+    }
+
+    /**
+     * @param  string      $packageName
+     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+     */
+    public static function getVersion($packageName)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (!isset($installed['versions'][$packageName])) {
+                continue;
+            }
+
+            if (!isset($installed['versions'][$packageName]['version'])) {
+                return null;
+            }
+
+            return $installed['versions'][$packageName]['version'];
+        }
+
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+    }
+
+    /**
+     * @param  string      $packageName
+     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+     */
+    public static function getPrettyVersion($packageName)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (!isset($installed['versions'][$packageName])) {
+                continue;
+            }
+
+            if (!isset($installed['versions'][$packageName]['pretty_version'])) {
+                return null;
+            }
+
+            return $installed['versions'][$packageName]['pretty_version'];
+        }
+
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+    }
+
+    /**
+     * @param  string      $packageName
+     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
+     */
+    public static function getReference($packageName)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (!isset($installed['versions'][$packageName])) {
+                continue;
+            }
+
+            if (!isset($installed['versions'][$packageName]['reference'])) {
+                return null;
+            }
+
+            return $installed['versions'][$packageName]['reference'];
+        }
+
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+    }
+
+    /**
+     * @param  string      $packageName
+     * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
+     */
+    public static function getInstallPath($packageName)
+    {
+        foreach (self::getInstalled() as $installed) {
+            if (!isset($installed['versions'][$packageName])) {
+                continue;
+            }
+
+            return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
+        }
+
+        throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+    }
+
+    /**
+     * @return array
+     * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
+     */
+    public static function getRootPackage()
+    {
+        $installed = self::getInstalled();
+
+        return $installed[0]['root'];
+    }
+
+    /**
+     * Returns the raw installed.php data for custom implementations
+     *
+     * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
+     * @return array[]
+     * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
+     */
+    public static function getRawData()
+    {
+        @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
+
+        if (null === self::$installed) {
+            // only require the installed.php file if this file is loaded from its dumped location,
+            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+            if (substr(__DIR__, -8, 1) !== 'C') {
+                self::$installed = include __DIR__ . '/installed.php';
+            } else {
+                self::$installed = array();
+            }
+        }
+
+        return self::$installed;
+    }
+
+    /**
+     * Returns the raw data of all installed.php which are currently loaded for custom implementations
+     *
+     * @return array[]
+     * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
+     */
+    public static function getAllRawData()
+    {
+        return self::getInstalled();
+    }
+
+    /**
+     * Lets you reload the static array from another file
+     *
+     * This is only useful for complex integrations in which a project needs to use
+     * this class but then also needs to execute another project's autoloader in process,
+     * and wants to ensure both projects have access to their version of installed.php.
+     *
+     * A typical case would be PHPUnit, where it would need to make sure it reads all
+     * the data it needs from this class, then call reload() with
+     * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
+     * the project in which it runs can then also use this class safely, without
+     * interference between PHPUnit's dependencies and the project's dependencies.
+     *
+     * @param  array[] $data A vendor/composer/installed.php data set
+     * @return void
+     *
+     * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
+     */
+    public static function reload($data)
+    {
+        self::$installed = $data;
+        self::$installedByVendor = array();
+    }
+
+    /**
+     * @return array[]
+     * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
+     */
+    private static function getInstalled()
+    {
+        if (null === self::$canGetVendors) {
+            self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
+        }
+
+        $installed = array();
+
+        if (self::$canGetVendors) {
+            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
+                if (isset(self::$installedByVendor[$vendorDir])) {
+                    $installed[] = self::$installedByVendor[$vendorDir];
+                } elseif (is_file($vendorDir.'/composer/installed.php')) {
+                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
+                    $required = require $vendorDir.'/composer/installed.php';
+                    $installed[] = self::$installedByVendor[$vendorDir] = $required;
+                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
+                        self::$installed = $installed[count($installed) - 1];
+                    }
+                }
+            }
+        }
+
+        if (null === self::$installed) {
+            // only require the installed.php file if this file is loaded from its dumped location,
+            // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+            if (substr(__DIR__, -8, 1) !== 'C') {
+                /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
+                $required = require __DIR__ . '/installed.php';
+                self::$installed = $required;
+            } else {
+                self::$installed = array();
+            }
+        }
+
+        if (self::$installed !== array()) {
+            $installed[] = self::$installed;
+        }
+
+        return $installed;
+    }
+}

+ 21 - 0
RemoteBrowser/vendor/composer/LICENSE

@@ -0,0 +1,21 @@
+
+Copyright (c) Nils Adermann, Jordi Boggiano
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+

+ 10 - 0
RemoteBrowser/vendor/composer/autoload_classmap.php

@@ -0,0 +1,10 @@
+<?php
+
+// autoload_classmap.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
+);

+ 9 - 0
RemoteBrowser/vendor/composer/autoload_namespaces.php

@@ -0,0 +1,9 @@
+<?php
+
+// autoload_namespaces.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+);

+ 10 - 0
RemoteBrowser/vendor/composer/autoload_psr4.php

@@ -0,0 +1,10 @@
+<?php
+
+// autoload_psr4.php @generated by Composer
+
+$vendorDir = dirname(dirname(__FILE__));
+$baseDir = dirname($vendorDir);
+
+return array(
+    'Facebook\\WebDriver\\' => array($vendorDir . '/php-webdriver/webdriver/lib'),
+);

+ 57 - 0
RemoteBrowser/vendor/composer/autoload_real.php

@@ -0,0 +1,57 @@
+<?php
+
+// autoload_real.php @generated by Composer
+
+class ComposerAutoloaderInit2441b680d5bab527f150524762f5f709
+{
+    private static $loader;
+
+    public static function loadClassLoader($class)
+    {
+        if ('Composer\Autoload\ClassLoader' === $class) {
+            require __DIR__ . '/ClassLoader.php';
+        }
+    }
+
+    /**
+     * @return \Composer\Autoload\ClassLoader
+     */
+    public static function getLoader()
+    {
+        if (null !== self::$loader) {
+            return self::$loader;
+        }
+
+        require __DIR__ . '/platform_check.php';
+
+        spl_autoload_register(array('ComposerAutoloaderInit2441b680d5bab527f150524762f5f709', 'loadClassLoader'), true, true);
+        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
+        spl_autoload_unregister(array('ComposerAutoloaderInit2441b680d5bab527f150524762f5f709', 'loadClassLoader'));
+
+        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
+        if ($useStaticLoader) {
+            require __DIR__ . '/autoload_static.php';
+
+            call_user_func(\Composer\Autoload\ComposerStaticInit2441b680d5bab527f150524762f5f709::getInitializer($loader));
+        } else {
+            $map = require __DIR__ . '/autoload_namespaces.php';
+            foreach ($map as $namespace => $path) {
+                $loader->set($namespace, $path);
+            }
+
+            $map = require __DIR__ . '/autoload_psr4.php';
+            foreach ($map as $namespace => $path) {
+                $loader->setPsr4($namespace, $path);
+            }
+
+            $classMap = require __DIR__ . '/autoload_classmap.php';
+            if ($classMap) {
+                $loader->addClassMap($classMap);
+            }
+        }
+
+        $loader->register(true);
+
+        return $loader;
+    }
+}

+ 36 - 0
RemoteBrowser/vendor/composer/autoload_static.php

@@ -0,0 +1,36 @@
+<?php
+
+// autoload_static.php @generated by Composer
+
+namespace Composer\Autoload;
+
+class ComposerStaticInit2441b680d5bab527f150524762f5f709
+{
+    public static $prefixLengthsPsr4 = array (
+        'F' => 
+        array (
+            'Facebook\\WebDriver\\' => 19,
+        ),
+    );
+
+    public static $prefixDirsPsr4 = array (
+        'Facebook\\WebDriver\\' => 
+        array (
+            0 => __DIR__ . '/..' . '/php-webdriver/webdriver/lib',
+        ),
+    );
+
+    public static $classMap = array (
+        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
+    );
+
+    public static function getInitializer(ClassLoader $loader)
+    {
+        return \Closure::bind(function () use ($loader) {
+            $loader->prefixLengthsPsr4 = ComposerStaticInit2441b680d5bab527f150524762f5f709::$prefixLengthsPsr4;
+            $loader->prefixDirsPsr4 = ComposerStaticInit2441b680d5bab527f150524762f5f709::$prefixDirsPsr4;
+            $loader->classMap = ComposerStaticInit2441b680d5bab527f150524762f5f709::$classMap;
+
+        }, null, ClassLoader::class);
+    }
+}

+ 63 - 0
RemoteBrowser/vendor/composer/installed.json

@@ -0,0 +1,63 @@
+{
+    "packages": [
+        {
+            "name": "php-webdriver/webdriver",
+            "version": "1.1.1",
+            "version_normalized": "1.1.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-webdriver/php-webdriver.git",
+                "reference": "1c98108ba3eb435b681655764de11502a0653705"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/1c98108ba3eb435b681655764de11502a0653705",
+                "reference": "1c98108ba3eb435b681655764de11502a0653705",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "php": ">=5.3.19"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "4.6.*"
+            },
+            "suggest": {
+                "phpdocumentor/phpdocumentor": "2.*"
+            },
+            "time": "2015-12-31T15:58:49+00:00",
+            "type": "library",
+            "installation-source": "dist",
+            "autoload": {
+                "psr-4": {
+                    "Facebook\\WebDriver\\": "lib/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "Apache-2.0"
+            ],
+            "description": "A PHP client for WebDriver",
+            "homepage": "https://github.com/facebook/php-webdriver",
+            "keywords": [
+                "facebook",
+                "php",
+                "selenium",
+                "webdriver"
+            ],
+            "support": {
+                "forum": "https://www.facebook.com/groups/phpwebdriver/",
+                "issues": "https://github.com/facebook/php-webdriver/issues",
+                "source": "https://github.com/facebook/php-webdriver"
+            },
+            "install-path": "../php-webdriver/webdriver"
+        }
+    ],
+    "dev": true,
+    "dev-package-names": []
+}

+ 32 - 0
RemoteBrowser/vendor/composer/installed.php

@@ -0,0 +1,32 @@
+<?php return array(
+    'root' => array(
+        'pretty_version' => 'dev-master',
+        'version' => 'dev-master',
+        'type' => 'library',
+        'install_path' => __DIR__ . '/../../',
+        'aliases' => array(),
+        'reference' => '318ce07f6c36d6408ea2d39919568187ab02c51b',
+        'name' => '__root__',
+        'dev' => true,
+    ),
+    'versions' => array(
+        '__root__' => array(
+            'pretty_version' => 'dev-master',
+            'version' => 'dev-master',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../../',
+            'aliases' => array(),
+            'reference' => '318ce07f6c36d6408ea2d39919568187ab02c51b',
+            'dev_requirement' => false,
+        ),
+        'php-webdriver/webdriver' => array(
+            'pretty_version' => '1.1.1',
+            'version' => '1.1.1.0',
+            'type' => 'library',
+            'install_path' => __DIR__ . '/../php-webdriver/webdriver',
+            'aliases' => array(),
+            'reference' => '1c98108ba3eb435b681655764de11502a0653705',
+            'dev_requirement' => false,
+        ),
+    ),
+);

+ 26 - 0
RemoteBrowser/vendor/composer/platform_check.php

@@ -0,0 +1,26 @@
+<?php
+
+// platform_check.php @generated by Composer
+
+$issues = array();
+
+if (!(PHP_VERSION_ID >= 50319)) {
+    $issues[] = 'Your Composer dependencies require a PHP version ">= 5.3.19". You are running ' . PHP_VERSION . '.';
+}
+
+if ($issues) {
+    if (!headers_sent()) {
+        header('HTTP/1.1 500 Internal Server Error');
+    }
+    if (!ini_get('display_errors')) {
+        if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
+            fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
+        } elseif (!headers_sent()) {
+            echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
+        }
+    }
+    trigger_error(
+        'Composer detected issues in your platform: ' . implode(' ', $issues),
+        E_USER_ERROR
+    );
+}

+ 10 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/.gitignore

@@ -0,0 +1,10 @@
+composer.phar
+composer.lock
+vendor
+
+# generic files to ignore
+*.lock
+*.DS_Store
+*~
+*.swp
+.idea

+ 36 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/.travis.yml

@@ -0,0 +1,36 @@
+language: php
+
+sudo: false
+
+php:
+  - 5.3
+  - 5.4
+  - 5.5
+  - 5.6
+  - 7
+  - hhvm
+
+env:
+  global:
+    - DISPLAY=:99.0
+
+cache:
+  directories:
+    - $HOME/.composer/cache
+
+before_install:
+  - composer self-update
+
+install:
+  - composer install --no-interaction --prefer-source
+
+before_script:
+  - sh -e /etc/init.d/xvfb start
+  - wget -q -t 3 http://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar
+  - java -jar selenium-server-standalone-2.45.0.jar -log selenium.log &
+  - until $(echo | nc localhost 4444); do sleep 1; echo waiting for selenium-server...; done;
+
+script: ./vendor/bin/phpunit
+
+after_script:
+  - cat selenium.log

+ 120 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/README.md

@@ -0,0 +1,120 @@
+php-webdriver -- WebDriver bindings for PHP
+===========================================
+
+##  DESCRIPTION
+
+This WebDriver client aims to be as close as possible to bindings in other languages. The concepts are very similar to the Java, .NET, Python and Ruby bindings for WebDriver.
+
+Looking for documentation about php-webdriver? See http://facebook.github.io/php-webdriver/
+
+The PHP client was rewritten from scratch. Using the old version? Check out Adam Goucher's fork of it at https://github.com/Element-34/php-webdriver
+
+Any complaint, question, idea? You can post it on the user group https://www.facebook.com/groups/phpwebdriver/.
+
+##  GETTING THE CODE
+
+There are two ways of getting the code:
+
+### Via Github
+    git clone [email protected]:facebook/php-webdriver.git
+
+### Via Packagist
+Add the dependency to composer.json (see https://packagist.org/packages/facebook/webdriver)
+
+```json
+{
+  "require": {
+    "facebook/webdriver": "~1.0"
+  }
+}
+```
+
+## INSTALLATION
+
+Download the composer.phar
+
+    curl -sS https://getcomposer.org/installer | php
+
+Install the library.
+
+    php composer.phar install
+
+
+##  GETTING STARTED
+
+*   All you need as the server for this client is the selenium-server-standalone-#.jar file provided here: http://selenium-release.storage.googleapis.com/index.html
+
+*   Download and run that file, replacing # with the current server version.
+
+    ```
+    java -jar selenium-server-standalone-#.jar
+    ```
+
+*   Then when you create a session, be sure to pass the url to where your server is running.
+
+    ```php
+    // This would be the url of the host running the server-standalone.jar
+    $host = 'http://localhost:4444/wd/hub'; // this is the default
+    ```
+
+*   Launch Firefox
+
+    ```php
+    $driver = RemoteWebDriver::create($host, DesiredCapabilities::firefox());
+    ```
+
+*   Launch Chrome
+
+    ```php
+    $driver = RemoteWebDriver::create($host, DesiredCapabilities::chrome());
+    ```
+
+*   You can also customize the desired capabilities.
+
+    ```php
+    $desired_capabilities = DesiredCapabilities::firefox();
+    $desired_capabilities->setJavascriptEnabled(false);
+    RemoteWebDriver::create($host, $desired_capabilities);
+    ```
+
+*   See https://code.google.com/p/selenium/wiki/DesiredCapabilities for more details.
+
+## RUN UNIT TESTS
+
+To run unit tests simply run:
+
+    ./vendor/bin/phpunit -c ./tests
+
+Note: For the functional test suite, a running selenium server is required.
+
+## MORE INFORMATION
+
+Check out the Selenium docs and wiki at http://docs.seleniumhq.org/docs/ and https://code.google.com/p/selenium/wiki
+
+Learn how to integrate it with PHPUnit [Blogpost](http://codeception.com/11-12-2013/working-with-phpunit-and-selenium-webdriver.html) | [Demo Project](https://github.com/DavertMik/php-webdriver-demo)
+
+## SUPPORT
+
+We have a great community willing to try and help you!
+
+Currently we offer support in two manners:
+
+### Via our Facebook Group
+
+If you have questions or are an active contributor consider joining our facebook group and contributing to the communal discussion and support
+
+https://www.facebook.com/groups/phpwebdriver/
+
+### Via Github
+
+If you're reading this you've already found our Github repository. If you have a question, feel free to submit it as an issue and our staff will do their best to help you as soon as possible.
+
+## CONTRIBUTING
+
+We love to have your help to make php-webdriver better. Feel free to 
+
+*   open an [issue](https://github.com/facebook/php-webdriver/issues) if you run into any problem. 
+*   fork the project and submit [pull request](https://github.com/facebook/php-webdriver/pulls). Before the pull requests can be accepted, a [Contributors Licensing Agreement](http://developers.facebook.com/opensource/cla) must be signed. 
+
+When you are going to contribute, please keep in mind that this webdriver client aims to be as close as possible to other languages Java/Ruby/Python/C#.
+FYI, here is the overview of [the official Java API](http://selenium.googlecode.com/svn/trunk/docs/api/java/index.html?overview-summary.html)

+ 33 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/composer.json

@@ -0,0 +1,33 @@
+{
+  "name": "facebook/webdriver",
+  "description": "A PHP client for WebDriver",
+  "keywords": ["webdriver", "selenium", "php", "facebook"],
+  "homepage": "https://github.com/facebook/php-webdriver",
+  "type": "library",
+  "license": "Apache-2.0",
+  "support": {
+    "issues": "https://github.com/facebook/php-webdriver/issues",
+    "forum": "https://www.facebook.com/groups/phpwebdriver/",
+    "source": "https://github.com/facebook/php-webdriver"
+  },
+  "require": {
+    "php": ">=5.3.19"
+  },
+  "require-dev": {
+    "phpunit/phpunit": "4.6.*"
+  },
+  "suggest": {
+    "phpdocumentor/phpdocumentor": "2.*"
+  },
+  "autoload": {
+    "psr-4": {
+      "Facebook\\WebDriver\\": "lib/"
+    }
+  },
+  "autoload-dev": {
+    "psr-4": {
+      "Facebook\\WebDriver\\": "tests/unit"
+    },
+    "classmap": ["tests/functional/"]
+  }
+}

+ 54 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/example.php

@@ -0,0 +1,54 @@
+<?php
+// An example of using php-webdriver.
+
+namespace Facebook\WebDriver;
+
+use Facebook\WebDriver\Remote\DesiredCapabilities;
+use Facebook\WebDriver\Remote\RemoteWebDriver;
+
+require_once('vendor/autoload.php');
+
+// start Firefox with 5 second timeout
+$host = 'http://localhost:4444/wd/hub'; // this is the default
+$capabilities = DesiredCapabilities::firefox();
+$driver = RemoteWebDriver::create($host, $capabilities, 5000);
+
+// navigate to 'http://docs.seleniumhq.org/'
+$driver->get('http://docs.seleniumhq.org/');
+
+// adding cookie
+$driver->manage()->deleteAllCookies();
+$driver->manage()->addCookie(array(
+  'name' => 'cookie_name',
+  'value' => 'cookie_value',
+));
+$cookies = $driver->manage()->getCookies();
+print_r($cookies);
+
+// click the link 'About'
+$link = $driver->findElement(
+  WebDriverBy::id('menu_about')
+);
+$link->click();
+
+// print the title of the current page
+echo "The title is '" . $driver->getTitle() . "'\n";
+
+// print the URI of the current page
+echo "The current URI is '" . $driver->getCurrentURL() . "'\n";
+
+// Search 'php' in the search box
+$input = $driver->findElement(
+  WebDriverBy::id('q')
+);
+$input->sendKeys('php')->submit();
+
+// wait at most 10 seconds until at least one result is shown
+$driver->wait(10)->until(
+  WebDriverExpectedCondition::presenceOfAllElementsLocatedBy(
+    WebDriverBy::className('gsc-result')
+  )
+);
+
+// close the Firefox
+$driver->quit();

+ 86 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Chrome/ChromeDriver.php

@@ -0,0 +1,86 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Chrome;
+
+use Facebook\WebDriver\Remote\DesiredCapabilities;
+use Facebook\WebDriver\Remote\DriverCommand;
+use Facebook\WebDriver\Remote\Service\DriverCommandExecutor;
+use Facebook\WebDriver\Exception\WebDriverException;
+use Facebook\WebDriver\Remote\RemoteWebDriver;
+use Facebook\WebDriver\Remote\WebDriverCommand;
+
+class ChromeDriver extends RemoteWebDriver {
+
+  public static function start(
+    DesiredCapabilities $desired_capabilities = null,
+    ChromeDriverService $service = null
+  ) {
+    if ($desired_capabilities === null) {
+      $desired_capabilities = DesiredCapabilities::chrome();
+    }
+    if ($service === null) {
+      $service = ChromeDriverService::createDefaultService();
+    }
+    $executor = new DriverCommandExecutor($service);
+    $driver = new static();
+    $driver->setCommandExecutor($executor)
+           ->startSession($desired_capabilities);
+    return $driver;
+  }
+
+  public function startSession($desired_capabilities) {
+    $command = new WebDriverCommand(
+      null,
+      DriverCommand::NEW_SESSION,
+      array(
+        'desiredCapabilities' => $desired_capabilities->toArray(),
+      )
+    );
+    $response = $this->executor->execute($command);
+    $this->setSessionID($response->getSessionID());
+  }
+
+  /**
+   * Always throws an exception. Use ChromeDriver::start() instead.
+   *
+   * @throws WebDriverException
+   */
+  public static function create(
+    $url = 'http://localhost:4444/wd/hub',
+    $desired_capabilities = null,
+    $connection_timeout_in_ms = null,
+    $request_timeout_in_ms = null,
+    $http_proxy = null,
+    $http_proxy_port = null
+  ) {
+    throw new WebDriverException('Please use ChromeDriver::start() instead.');
+  }
+
+  /**
+   * Always throws an exception. Use ChromeDriver::start() instead.
+   *
+   * @param string $session_id The existing session id
+   * @param string $url        The url of the remote server
+   *
+   * @throws WebDriverException
+   */
+  public static function createBySessionID(
+    $session_id,
+    $url = 'http://localhost:4444/wd/hub'
+  ) {
+    throw new WebDriverException('Please use ChromeDriver::start() instead.');
+  }
+}

+ 33 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Chrome/ChromeDriverService.php

@@ -0,0 +1,33 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Chrome;
+
+use Facebook\WebDriver\Remote\Service\DriverService;
+
+class ChromeDriverService extends DriverService {
+
+  // The environment variable storing the path to the chrome driver executable.
+  const CHROME_DRIVER_EXE_PROPERTY = "webdriver.chrome.driver";
+
+  public static function createDefaultService() {
+    $exe = getenv(self::CHROME_DRIVER_EXE_PROPERTY);
+    $port = 9515; // TODO: Get another port if the default port is used.
+    $args = array("--port=$port");
+    $service = new ChromeDriverService($exe, $port, $args);
+    return $service;
+  }
+
+}

+ 162 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Chrome/ChromeOptions.php

@@ -0,0 +1,162 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Chrome;
+
+use Facebook\WebDriver\Remote\DesiredCapabilities;
+
+/**
+ * The class manages the capabilities in ChromeDriver.
+ *
+ * @see https://sites.google.com/a/chromium.org/chromedriver/capabilities
+ */
+class ChromeOptions {
+
+  /**
+   * The key of chrome options in desired capabilities.
+   */
+  const CAPABILITY = "chromeOptions";
+
+  /**
+   * @var array
+   */
+  private $arguments = array();
+
+  /**
+   * @var string
+   */
+  private $binary = '';
+
+  /**
+   * @var array
+   */
+  private $extensions = array();
+
+  /**
+   * @var array
+   */
+  private $experimentalOptions = array();
+
+  /**
+   * Sets the path of the Chrome executable. The path should be either absolute
+   * or relative to the location running ChromeDriver server.
+   *
+   * @param string $path
+   * @return ChromeOptions
+   */
+  public function setBinary($path) {
+    $this->binary = $path;
+    return $this;
+  }
+
+  /**
+   * @param array $arguments
+   * @return ChromeOptions
+   */
+  public function addArguments(array $arguments) {
+    $this->arguments = array_merge($this->arguments, $arguments);
+    return $this;
+  }
+
+  /**
+   * Add a Chrome extension to install on browser startup. Each path should be
+   * a packed Chrome extension.
+   *
+   * @param array $paths
+   * @return ChromeOptions
+   */
+  public function addExtensions(array $paths) {
+    foreach ($paths as $path) {
+      $this->addExtension($path);
+    }
+    return $this;
+  }
+
+  /**
+   * @param array $encoded_extensions An array of base64 encoded of the extensions.
+   * @return ChromeOptions
+   */
+  public function addEncodedExtensions(array $encoded_extensions) {
+    foreach ($encoded_extensions as $encoded_extension) {
+      $this->addEncodedExtension($encoded_extension);
+    }
+    return $this;
+  }
+
+  /**
+   * Sets an experimental option which has not exposed officially.
+   *
+   * @param string $name
+   * @param mixed $value
+   * @return ChromeOptions
+   */
+  public function setExperimentalOption($name, $value) {
+    $this->experimentalOptions[$name] = $value;
+    return $this;
+  }
+
+  /**
+   * @return DesiredCapabilities The DesiredCapabilities for Chrome with this options.
+   */
+  public function toCapabilities() {
+    $capabilities = DesiredCapabilities::chrome();
+    $capabilities->setCapability(self::CAPABILITY, $this);
+    return $capabilities;
+  }
+
+  /**
+   * @return array
+   */
+  public function toArray() {
+    $options = $this->experimentalOptions;
+
+    // The selenium server expects a 'dictionary' instead of a 'list' when
+    // reading the chrome option. However, an empty array in PHP will be
+    // converted to a 'list' instead of a 'dictionary'. To fix it, we always
+    // set the 'binary' to avoid returning an empty array.
+    $options['binary'] = $this->binary;
+
+    if ($this->arguments) {
+      $options['args'] = $this->arguments;
+    }
+
+    if ($this->extensions) {
+      $options['extensions'] = $this->extensions;
+    }
+
+    return $options;
+  }
+
+  /**
+   * Add a Chrome extension to install on browser startup. Each path should be a
+   * packed Chrome extension.
+   *
+   * @param string $path
+   * @return ChromeOptions
+   */
+  private function addExtension($path) {
+    $this->addEncodedExtension(base64_encode(file_get_contents($path)));
+    return $this;
+  }
+
+  /**
+   * @param string $encoded_extension Base64 encoded of the extension.
+   * @return ChromeOptions
+   */
+  private function addEncodedExtension($encoded_extension) {
+    $this->extensions[] = $encoded_extension;
+    return $this;
+  }
+}

+ 21 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/ElementNotSelectableException.php

@@ -0,0 +1,21 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+
+class ElementNotSelectableException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/ElementNotVisibleException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class ElementNotVisibleException extends WebDriverException {
+
+}

+ 21 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/ExpectedException.php

@@ -0,0 +1,21 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+
+class ExpectedException extends WebDriverException {
+
+}

+ 21 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/IMEEngineActivationFailedException.php

@@ -0,0 +1,21 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+
+class IMEEngineActivationFailedException extends WebDriverException {
+
+}

+ 21 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/IMENotAvailableException.php

@@ -0,0 +1,21 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+
+class IMENotAvailableException extends WebDriverException {
+
+}

+ 7 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/IndexOutOfBoundsException.php

@@ -0,0 +1,7 @@
+<?php
+
+namespace Facebook\WebDriver\Exception;
+
+class IndexOutOfBoundsException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/InvalidCookieDomainException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class InvalidCookieDomainException extends WebDriverException {
+
+}

+ 21 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/InvalidCoordinatesException.php

@@ -0,0 +1,21 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+
+class InvalidCoordinatesException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/InvalidElementStateException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class InvalidElementStateException extends WebDriverException {
+
+}

+ 21 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/InvalidSelectorException.php

@@ -0,0 +1,21 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+
+class InvalidSelectorException extends WebDriverException {
+
+}

+ 21 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/MoveTargetOutOfBoundsException.php

@@ -0,0 +1,21 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+
+class MoveTargetOutOfBoundsException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoAlertOpenException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class NoAlertOpenException extends WebDriverException {
+
+}

+ 7 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoCollectionException.php

@@ -0,0 +1,7 @@
+<?php
+
+namespace Facebook\WebDriver\Exception;
+
+class NoCollectionException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoScriptResultException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class NoScriptResultException extends WebDriverException {
+
+}

+ 7 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoStringException.php

@@ -0,0 +1,7 @@
+<?php
+
+namespace Facebook\WebDriver\Exception;
+
+class NoStringException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoStringLengthException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class NoStringLengthException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoStringWrapperException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class NoStringWrapperException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoSuchCollectionException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class NoSuchCollectionException extends WebDriverException {
+
+}

+ 21 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoSuchDocumentException.php

@@ -0,0 +1,21 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+
+class NoSuchDocumentException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoSuchDriverException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class NoSuchDriverException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoSuchElementException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class NoSuchElementException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoSuchFrameException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class NoSuchFrameException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NoSuchWindowException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class NoSuchWindowException extends WebDriverException {
+
+}

+ 21 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/NullPointerException.php

@@ -0,0 +1,21 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+
+class NullPointerException extends WebDriverException {
+
+}

+ 21 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/ScriptTimeoutException.php

@@ -0,0 +1,21 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+
+class ScriptTimeoutException extends WebDriverException {
+
+}

+ 21 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/SessionNotCreatedException.php

@@ -0,0 +1,21 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+
+class SessionNotCreatedException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/StaleElementReferenceException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class StaleElementReferenceException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/TimeOutException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class TimeOutException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnableToSetCookieException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class UnableToSetCookieException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnexpectedAlertOpenException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class UnexpectedAlertOpenException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnexpectedJavascriptException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class UnexpectedJavascriptException extends WebDriverException {
+
+}

+ 34 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnexpectedTagNameException.php

@@ -0,0 +1,34 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class UnexpectedTagNameException extends WebDriverException {
+
+  /**
+   * @param string $expected_tag_name
+   * @param string $actual_tag_name
+   */
+  public function __construct(
+    $expected_tag_name,
+    $actual_tag_name) {
+    parent::__construct(
+      sprintf(
+        "Element should have been \"%s\" but was \"%s\"",
+        $expected_tag_name, $actual_tag_name
+      )
+    );
+  }
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnknownCommandException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class UnknownCommandException extends WebDriverException {
+
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnknownServerException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class UnknownServerException extends WebDriverException {
+
+}

+ 21 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnrecognizedExceptionException.php

@@ -0,0 +1,21 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+
+class UnrecognizedExceptionException extends WebDriverException {
+
+}

+ 21 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/UnsupportedOperationException.php

@@ -0,0 +1,21 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+
+class UnsupportedOperationException extends WebDriverException {
+
+}

+ 21 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/WebDriverCurlException.php

@@ -0,0 +1,21 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+
+class WebDriverCurlException extends WebDriverException {
+
+}

+ 165 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/WebDriverException.php

@@ -0,0 +1,165 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+use Exception;
+
+class WebDriverException extends Exception {
+
+  private $results;
+
+  /**
+   * @param string $message
+   * @param mixed $results
+   */
+  public function __construct($message, $results = null) {
+    parent::__construct($message);
+    $this->results = $results;
+  }
+
+  /**
+   * @return mixed
+   */
+  public function getResults() {
+    return $this->results;
+  }
+
+  /**
+   * Throw WebDriverExceptions.
+   * For $status_code >= 0, they are errors defined in the json wired protocol.
+   * For $status_code < 0, they are errors defined in php-webdriver.
+   *
+   * @param int    $status_code
+   * @param string $message
+   * @param mixed  $results
+   *
+   * @throws ElementNotSelectableException
+   * @throws ElementNotVisibleException
+   * @throws ExpectedException
+   * @throws IMEEngineActivationFailedException
+   * @throws IMENotAvailableException
+   * @throws IndexOutOfBoundsException
+   * @throws InvalidCookieDomainException
+   * @throws InvalidCoordinatesException
+   * @throws InvalidElementStateException
+   * @throws InvalidSelectorException
+   * @throws MoveTargetOutOfBoundsException
+   * @throws NoAlertOpenException
+   * @throws NoCollectionException
+   * @throws NoScriptResultException
+   * @throws NoStringException
+   * @throws NoStringLengthException
+   * @throws NoStringWrapperException
+   * @throws NoSuchCollectionException
+   * @throws NoSuchDocumentException
+   * @throws NoSuchDriverException
+   * @throws NoSuchElementException
+   * @throws NoSuchFrameException
+   * @throws NoSuchWindowException
+   * @throws NullPointerException
+   * @throws ScriptTimeoutException
+   * @throws SessionNotCreatedException
+   * @throws StaleElementReferenceException
+   * @throws TimeOutException
+   * @throws UnableToSetCookieException
+   * @throws UnexpectedAlertOpenException
+   * @throws UnexpectedJavascriptException
+   * @throws UnknownCommandException
+   * @throws UnknownServerException
+   * @throws UnrecognizedExceptionException
+   * @throws WebDriverCurlException
+   * @throws XPathLookupException
+   */
+  public static function throwException($status_code, $message, $results) {
+    switch ($status_code) {
+      case -1:
+        throw new WebDriverCurlException($message);
+      case 0:
+        // Success
+        break;
+      case 1:
+        throw new IndexOutOfBoundsException($message, $results);
+      case 2:
+        throw new NoCollectionException($message, $results);
+      case 3:
+        throw new NoStringException($message, $results);
+      case 4:
+        throw new NoStringLengthException($message, $results);
+      case 5:
+        throw new NoStringWrapperException($message, $results);
+      case 6:
+        throw new NoSuchDriverException($message, $results);
+      case 7:
+        throw new NoSuchElementException($message, $results);
+      case 8:
+        throw new NoSuchFrameException($message, $results);
+      case 9:
+        throw new UnknownCommandException($message, $results);
+      case 10:
+        throw new StaleElementReferenceException($message, $results);
+      case 11:
+        throw new ElementNotVisibleException($message, $results);
+      case 12:
+        throw new InvalidElementStateException($message, $results);
+      case 13:
+        throw new UnknownServerException($message, $results);
+      case 14:
+        throw new ExpectedException($message, $results);
+      case 15:
+        throw new ElementNotSelectableException($message, $results);
+      case 16:
+        throw new NoSuchDocumentException($message, $results);
+      case 17:
+        throw new UnexpectedJavascriptException($message, $results);
+      case 18:
+        throw new NoScriptResultException($message, $results);
+      case 19:
+        throw new XPathLookupException($message, $results);
+      case 20:
+        throw new NoSuchCollectionException($message, $results);
+      case 21:
+        throw new TimeOutException($message, $results);
+      case 22:
+        throw new NullPointerException($message, $results);
+      case 23:
+        throw new NoSuchWindowException($message, $results);
+      case 24:
+        throw new InvalidCookieDomainException($message, $results);
+      case 25:
+        throw new UnableToSetCookieException($message, $results);
+      case 26:
+        throw new UnexpectedAlertOpenException($message, $results);
+      case 27:
+        throw new NoAlertOpenException($message, $results);
+      case 28:
+        throw new ScriptTimeoutException($message, $results);
+      case 29:
+        throw new InvalidCoordinatesException($message, $results);
+      case 30:
+        throw new IMENotAvailableException($message, $results);
+      case 31:
+        throw new IMEEngineActivationFailedException($message, $results);
+      case 32:
+        throw new InvalidSelectorException($message, $results);
+      case 33:
+        throw new SessionNotCreatedException($message, $results);
+      case 34:
+        throw new MoveTargetOutOfBoundsException($message, $results);
+      default:
+        throw new UnrecognizedExceptionException($message, $results);
+    }
+  }
+}

+ 20 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Exception/XPathLookupException.php

@@ -0,0 +1,20 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Exception;
+
+class XPathLookupException extends WebDriverException {
+
+}

+ 24 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Firefox/FirefoxDriver.php

@@ -0,0 +1,24 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Firefox;
+
+class FirefoxDriver {
+  const PROFILE = 'firefox_profile';
+
+  private function __construct()
+  {
+  }
+}

+ 33 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Firefox/FirefoxPreferences.php

@@ -0,0 +1,33 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Firefox;
+
+/**
+ * Constants of common Firefox profile preferences (about:config values).
+ * @see http://kb.mozillazine.org/Firefox_:_FAQs_:_About:config_Entries
+ */
+class FirefoxPreferences {
+  /** @var string Port WebDriver uses to communicate with Firefox instance */
+  const WEBDRIVER_FIREFOX_PORT = 'webdriver_firefox_port';
+  /** @var string Should the reader view (FF 38+) be enabled? */
+  const READER_PARSE_ON_LOAD_ENABLED = 'reader.parse-on-load.enabled';
+  /** @var string Browser homepage */
+  const BROWSER_STARTUP_HOMEPAGE = 'browser.startup.homepage';
+
+  private function __construct()
+  {
+  }
+}

+ 257 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Firefox/FirefoxProfile.php

@@ -0,0 +1,257 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Firefox;
+
+use Facebook\WebDriver\Exception\WebDriverException;
+use FilesystemIterator;
+use RecursiveDirectoryIterator;
+use RecursiveIteratorIterator;
+use ZipArchive;
+
+class FirefoxProfile {
+
+  /**
+   * @var array
+   */
+  private $preferences = array();
+
+  /**
+   * @var array
+   */
+  private $extensions = array();
+
+  /**
+   * @var array
+   */
+  private $extensions_datas = array();
+
+  /**
+   * @var string
+   */
+  private $rdf_file;
+
+  /**
+   * @param string $extension The path to the xpi extension.
+   * @return FirefoxProfile
+   */
+  public function addExtension($extension) {
+    $this->extensions[] = $extension;
+    return $this;
+  }
+
+  /**
+   * @param string $extension_datas The path to the folder containing the datas to add to the extension
+   * @return FirefoxProfile
+   */
+  public function addExtensionDatas($extension_datas) {
+    if (!is_dir($extension_datas)) {
+      return;
+    }
+
+    $this->extensions_datas[basename($extension_datas)] = $extension_datas;
+    return $this;
+  }
+
+  /**
+   * @param string $rdf_file The path to the rdf file
+   * @return FirefoxProfile
+   */
+  public function setRdfFile($rdf_file) {
+    if (!is_file($rdf_file)) {
+      return;
+    }
+
+    $this->rdf_file = $rdf_file;
+    return $this;
+  }
+
+  /**
+   * @param string $key
+   * @param string|bool|int $value
+   * @return FirefoxProfile
+   * @throws WebDriverException
+   */
+  public function setPreference($key, $value) {
+    if (is_string($value)) {
+      $value = sprintf('"%s"', $value);
+    } else if (is_int($value)) {
+      $value = sprintf('%d', $value);
+    } else if (is_bool($value)) {
+      $value = $value ? 'true' : 'false';
+    } else {
+      throw new WebDriverException(
+        'The value of the preference should be either a string, int or bool.');
+    }
+    $this->preferences[$key] = $value;
+    return $this;
+  }
+
+  /**
+   * @param $key
+   * @return mixed
+   */
+  public function getPreference($key)
+  {
+    if (array_key_exists($key, $this->preferences)) {
+      return $this->preferences[$key];
+    }
+
+    return null;
+  }
+
+  /**
+   * @return string
+   */
+  public function encode() {
+    $temp_dir = $this->createTempDirectory('WebDriverFirefoxProfile');
+
+    if (isset($this->rdf_file)) {
+      copy($this->rdf_file, $temp_dir . DIRECTORY_SEPARATOR . "mimeTypes.rdf");
+    }
+
+    foreach ($this->extensions as $extension) {
+      $this->installExtension($extension, $temp_dir);
+    }
+
+    foreach ($this->extensions_datas as $dirname => $extension_datas) {
+      mkdir($temp_dir . DIRECTORY_SEPARATOR . $dirname);
+      $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($extension_datas, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST);
+      foreach ($iterator as $item) {
+        if ($item->isDir()) {
+	  mkdir($temp_dir . DIRECTORY_SEPARATOR . $dirname . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
+	} else {
+	  copy($item, $temp_dir . DIRECTORY_SEPARATOR . $dirname . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
+	}
+      }
+    }
+
+    $content = "";
+    foreach ($this->preferences as $key => $value) {
+      $content .= sprintf("user_pref(\"%s\", %s);\n", $key, $value);
+    }
+    file_put_contents($temp_dir.'/user.js', $content);
+
+    $zip = new ZipArchive();
+    $temp_zip = tempnam(sys_get_temp_dir(), 'WebDriverFirefoxProfileZip');
+    $zip->open($temp_zip, ZipArchive::CREATE);
+
+    $dir = new RecursiveDirectoryIterator($temp_dir);
+    $files = new RecursiveIteratorIterator($dir);
+    foreach ($files as $name => $object) {
+      if (is_dir($name)) {
+        continue;
+      }
+      $dir_prefix = preg_replace(
+        '#\\\\#',
+        '\\\\\\\\',
+        $temp_dir.DIRECTORY_SEPARATOR
+      );
+      $path = preg_replace("#^{$dir_prefix}#", "", $name);
+      $zip->addFile($name, $path);
+    }
+    $zip->close();
+
+    $profile = base64_encode(file_get_contents($temp_zip));
+
+    // clean up
+    $this->deleteDirectory($temp_dir);
+    unlink($temp_zip);
+
+    return $profile;
+  }
+
+  /**
+   * @param string $extension The path to the extension.
+   * @param string $profile_dir The path to the profile directory.
+   * @return string The path to the directory of this extension.
+   */
+  private function installExtension($extension, $profile_dir) {
+    $temp_dir = $this->createTempDirectory('WebDriverFirefoxProfileExtension');
+
+    $this->extractTo($extension, $temp_dir);
+
+    $install_rdf_path = $temp_dir.'/install.rdf';
+    // This is a hacky way to parse the id since there is no offical
+    // RDF parser library.
+    $matches = array();
+    $xml = file_get_contents($install_rdf_path);
+    preg_match('#<em:id>([^<]+)</em:id>#', $xml, $matches);
+    $ext_dir = $profile_dir.'/extensions/'.$matches[1];
+
+    mkdir($ext_dir, 0777, true);
+
+    $this->extractTo($extension, $ext_dir);
+
+    // clean up
+    $this->deleteDirectory($temp_dir);
+
+    return $ext_dir;
+  }
+
+  /**
+   * @param string $prefix Prefix of the temp directory.
+   *
+   * @return string The path to the temp directory created.
+   * @throws WebDriverException
+   */
+  private function createTempDirectory($prefix = '') {
+    $temp_dir = tempnam(sys_get_temp_dir(), $prefix);
+    if (file_exists($temp_dir)) {
+      unlink($temp_dir);
+      mkdir($temp_dir);
+      if (!is_dir($temp_dir)) {
+        throw new WebDriverException('Cannot create firefox profile.');
+      }
+    }
+    return $temp_dir;
+  }
+
+  /**
+   * @param string $directory The path to the directory.
+   */
+  private function deleteDirectory($directory) {
+    $dir = new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS);
+    $paths = new RecursiveIteratorIterator($dir, RecursiveIteratorIterator::CHILD_FIRST);
+
+    foreach ($paths as $path) {
+      if ($path->isDir() && !$path->isLink()) {
+        rmdir($path->getPathname());
+      } else {
+        unlink($path->getPathname());
+      }
+    }
+
+    rmdir($directory);
+  }
+
+  /**
+   * @param string $xpi        The path to the .xpi extension.
+   * @param string $target_dir The path to the unzip directory.
+   *
+   * @return FirefoxProfile
+   * @throws \Exception
+   */
+  private function extractTo($xpi, $target_dir) {
+    $zip = new ZipArchive();
+    if ($zip->open($xpi)) {
+      $zip->extractTo($target_dir);
+      $zip->close();
+    } else {
+      throw new \Exception("Failed to open the firefox extension. '$xpi'");
+    }
+    return $this;
+  }
+}

+ 30 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverButtonReleaseAction.php

@@ -0,0 +1,30 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Internal;
+
+use Facebook\WebDriver\WebDriverAction;
+
+/**
+ * Move to the location and then release the mouse key.
+ */
+class WebDriverButtonReleaseAction
+    extends WebDriverMouseAction
+    implements WebDriverAction {
+
+  public function perform() {
+    $this->mouse->mouseUp($this->getActionLocation());
+  }
+}

+ 27 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverClickAction.php

@@ -0,0 +1,27 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Internal;
+
+use Facebook\WebDriver\WebDriverAction;
+
+class WebDriverClickAction
+    extends WebDriverMouseAction
+    implements WebDriverAction {
+
+  public function perform() {
+    $this->mouse->click($this->getActionLocation());
+  }
+}

+ 30 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverClickAndHoldAction.php

@@ -0,0 +1,30 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Internal;
+
+use Facebook\WebDriver\WebDriverAction;
+
+/**
+ * Move the the location, click and hold.
+ */
+class WebDriverClickAndHoldAction
+    extends WebDriverMouseAction
+    implements WebDriverAction {
+
+  public function perform() {
+    $this->mouse->mouseDown($this->getActionLocation());
+  }
+}

+ 30 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverContextClickAction.php

@@ -0,0 +1,30 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Internal;
+
+use Facebook\WebDriver\WebDriverAction;
+
+/**
+ * You can call it 'Right Click' if you like.
+ */
+class WebDriverContextClickAction
+    extends WebDriverMouseAction
+    implements WebDriverAction {
+
+  public function perform() {
+    $this->mouse->contextClick($this->getActionLocation());
+  }
+}

+ 75 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverCoordinates.php

@@ -0,0 +1,75 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Internal;
+
+use Closure;
+use Facebook\WebDriver\Exception\UnsupportedOperationException;
+use Facebook\WebDriver\WebDriverPoint;
+
+/**
+ * Interface representing basic mouse operations.
+ */
+class WebDriverCoordinates {
+
+  private
+    $onScreen,
+    $inViewPort,
+    $onPage,
+    $auxiliary;
+
+  public function __construct(
+      $on_screen,
+      Closure $in_view_port,
+      Closure $on_page,
+      $auxiliary) {
+
+    $this->onScreen = $on_screen;
+    $this->inViewPort = $in_view_port;
+    $this->onPage = $on_page;
+    $this->auxiliary = $auxiliary;
+  }
+
+  /**
+   * @return WebDriverPoint
+   * @throws UnsupportedOperationException
+   */
+  public function onScreen() {
+    throw new UnsupportedOperationException(
+      'onScreen is planned but not yet supported by Selenium'
+    );
+  }
+
+  /**
+   * @return WebDriverPoint
+   */
+  public function inViewPort() {
+    return call_user_func($this->inViewPort);
+  }
+
+  /**
+   * @return WebDriverPoint
+   */
+  public function onPage() {
+    return call_user_func($this->onPage);
+  }
+
+  /**
+   * @return Object The attached object.
+   */
+  public function getAuxiliary() {
+    return $this->auxiliary;
+  }
+}

+ 27 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverDoubleClickAction.php

@@ -0,0 +1,27 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Internal;
+
+use Facebook\WebDriver\WebDriverAction;
+
+class WebDriverDoubleClickAction
+    extends WebDriverMouseAction
+    implements WebDriverAction {
+
+  public function perform() {
+    $this->mouse->doubleClick($this->getActionLocation());
+  }
+}

+ 28 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeyDownAction.php

@@ -0,0 +1,28 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Internal;
+
+use Facebook\WebDriver\WebDriverAction;
+
+class WebDriverKeyDownAction
+    extends WebDriverSingleKeyAction
+    implements WebDriverAction {
+
+  public function perform() {
+    $this->focusOnElement();
+    $this->keyboard->pressKey($this->key);
+  }
+}

+ 28 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeyUpAction.php

@@ -0,0 +1,28 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Internal;
+
+use Facebook\WebDriver\WebDriverAction;
+
+class WebDriverKeyUpAction
+    extends WebDriverSingleKeyAction
+    implements WebDriverAction {
+
+  public function perform() {
+    $this->focusOnElement();
+    $this->keyboard->releaseKey($this->key);
+  }
+}

+ 53 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverKeysRelatedAction.php

@@ -0,0 +1,53 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Internal;
+
+use Facebook\WebDriver\Internal\WebDriverLocatable;
+use Facebook\WebDriver\WebDriverMouse;
+use Facebook\WebDriver\WebDriverKeyboard;
+
+/**
+ * Base class for all keyboard-related actions.
+ */
+abstract class WebDriverKeysRelatedAction {
+
+  protected $keyboard;
+  protected $mouse;
+  protected $locationProvider;
+
+  /**
+   * @param WebDriverKeyboard $keyboard
+   * @param WebDriverMouse $mouse
+   * @param WebDriverLocatable $location_provider
+   */
+  public function __construct(
+      WebDriverKeyboard $keyboard,
+      WebDriverMouse $mouse,
+      WebDriverLocatable $location_provider = null) {
+    $this->keyboard = $keyboard;
+    $this->mouse = $mouse;
+    $this->locationProvider = $location_provider;
+  }
+
+  /**
+   * @return void
+   */
+  protected function focusOnElement() {
+    if ($this->locationProvider) {
+      $this->mouse->click($this->locationProvider->getCoordinates());
+    }
+  }
+}

+ 60 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMouseAction.php

@@ -0,0 +1,60 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Internal;
+
+use Facebook\WebDriver\WebDriverMouse;
+use Facebook\WebDriver\Internal\WebDriverLocatable;
+
+/**
+ * Base class for all mouse-related actions.
+ */
+class WebDriverMouseAction {
+
+  /**
+   * @var WebDriverMouse
+   */
+  protected $mouse;
+
+  /**
+   * @var WebDriverLocatable
+   */
+  protected $locationProvider;
+
+  public function __construct(
+      WebDriverMouse $mouse,
+      WebDriverLocatable $location_provider = null) {
+    $this->mouse = $mouse;
+    $this->locationProvider = $location_provider;
+  }
+
+  /**
+   * @return null|WebDriverCoordinates
+   */
+  protected function getActionLocation() {
+    if ($this->locationProvider !== null) {
+      return $this->locationProvider->getCoordinates();
+    }
+
+    return null;
+  }
+
+  /**
+   * @return void
+   */
+  protected function moveToLocation() {
+    $this->mouse->mouseMove($this->locationProvider);
+  }
+}

+ 27 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMouseMoveAction.php

@@ -0,0 +1,27 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Internal;
+
+use Facebook\WebDriver\WebDriverAction;
+
+class WebDriverMouseMoveAction
+    extends WebDriverMouseAction
+    implements WebDriverAction {
+
+  public function perform() {
+    $this->mouse->mouseMove($this->getActionLocation());
+  }
+}

+ 44 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverMoveToOffsetAction.php

@@ -0,0 +1,44 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Internal;
+
+use Facebook\WebDriver\WebDriverAction;
+use Facebook\WebDriver\Internal\WebDriverLocatable;
+use Facebook\WebDriver\WebDriverMouse;
+
+class WebDriverMoveToOffsetAction
+    extends WebDriverMouseAction
+    implements WebDriverAction {
+
+  private $xOffset, $yOffset;
+
+  public function __construct(WebDriverMouse $mouse,
+                              WebDriverLocatable $location_provider = null,
+                              $x_offset = null,
+                              $y_offset = null) {
+    parent::__construct($mouse, $location_provider);
+    $this->xOffset = $x_offset;
+    $this->yOffset = $y_offset;
+  }
+
+  public function perform() {
+    $this->mouse->mouseMove(
+      $this->getActionLocation(),
+      $this->xOffset,
+      $this->yOffset
+    );
+  }
+}

+ 48 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverSendKeysAction.php

@@ -0,0 +1,48 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Internal;
+
+use Facebook\WebDriver\WebDriverAction;
+use Facebook\WebDriver\WebDriverKeyboard;
+use Facebook\WebDriver\Internal\WebDriverLocatable;
+use Facebook\WebDriver\WebDriverMouse;
+
+class WebDriverSendKeysAction
+    extends WebDriverKeysRelatedAction
+    implements WebDriverAction {
+
+  private $keys;
+
+  /**
+   * @param WebDriverKeyboard $keyboard
+   * @param WebDriverMouse $mouse
+   * @param WebDriverLocatable $location_provider
+   * @param string $keys
+   */
+  public function __construct(
+      WebDriverKeyboard $keyboard,
+      WebDriverMouse $mouse,
+      WebDriverLocatable $location_provider = null,
+      $keys = null) {
+    parent::__construct($keyboard, $mouse, $location_provider);
+    $this->keys = $keys;
+  }
+
+  public function perform() {
+    $this->focusOnElement();
+    $this->keyboard->sendKeys($this->keys);
+  }
+}

+ 37 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Internal/WebDriverSingleKeyAction.php

@@ -0,0 +1,37 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Internal;
+
+use Facebook\WebDriver\WebDriverAction;
+use Facebook\WebDriver\WebDriverKeyboard;
+use Facebook\WebDriver\Internal\WebDriverLocatable;
+use Facebook\WebDriver\WebDriverMouse;
+
+abstract class WebDriverSingleKeyAction
+    extends WebDriverKeysRelatedAction
+    implements WebDriverAction {
+
+  protected $key;
+
+  public function __construct(
+      WebDriverKeyboard $keyboard,
+      WebDriverMouse $mouse,
+      WebDriverLocatable $location_provider = null,
+      $key = null) {
+    parent::__construct($keyboard, $mouse, $location_provider);
+    $this->key = $key;
+  }
+}

+ 27 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverDoubleTapAction.php

@@ -0,0 +1,27 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Touch;
+
+use Facebook\WebDriver\WebDriverAction;
+
+class WebDriverDoubleTapAction
+  extends WebDriverTouchAction
+  implements WebDriverAction {
+
+  public function perform() {
+    $this->touchScreen->doubleTap($this->locationProvider);
+  }
+}

+ 41 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverDownAction.php

@@ -0,0 +1,41 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Touch;
+
+use Facebook\WebDriver\WebDriverAction;
+
+class WebDriverDownAction
+  extends WebDriverTouchAction
+  implements WebDriverAction {
+
+  private $x;
+  private $y;
+
+  /**
+   * @param WebDriverTouchScreen $touch_screen
+   * @param int $x
+   * @param int $y
+   */
+  public function __construct(WebDriverTouchScreen $touch_screen, $x, $y) {
+    $this->x = $x;
+    $this->y = $y;
+    parent::__construct($touch_screen);
+  }
+
+  public function perform() {
+    $this->touchScreen->down($this->x, $this->y);
+  }
+}

+ 38 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverFlickAction.php

@@ -0,0 +1,38 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Touch;
+
+use Facebook\WebDriver\WebDriverAction;
+
+class WebDriverFlickAction
+  extends WebDriverTouchAction
+  implements WebDriverAction {
+
+  /**
+   * @param WebDriverTouchScreen $touch_screen
+   * @param int $x
+   * @param int $y
+   */
+  public function __construct(WebDriverTouchScreen $touch_screen, $x, $y) {
+    $this->x = $x;
+    $this->y = $y;
+    parent::__construct($touch_screen);
+  }
+
+  public function perform() {
+    $this->touchScreen->flick($this->x, $this->y);
+  }
+}

+ 54 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverFlickFromElementAction.php

@@ -0,0 +1,54 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Touch;
+
+use Facebook\WebDriver\WebDriverAction;
+use Facebook\WebDriver\WebDriverElement;
+
+class WebDriverFlickFromElementAction
+  extends WebDriverTouchAction
+  implements WebDriverAction {
+
+  private $x;
+  private $y;
+  private $speed;
+
+  /**
+   * @param WebDriverTouchScreen $touch_screen
+   * @param WebDriverElement $element
+   * @param int $x
+   * @param int $y
+   * @param int $speed
+   */
+  public function __construct(
+    WebDriverTouchScreen $touch_screen,
+    WebDriverElement $element, $x, $y, $speed
+  ) {
+    $this->x = $x;
+    $this->y = $y;
+    $this->speed = $speed;
+    parent::__construct($touch_screen, $element);
+  }
+
+  public function perform() {
+    $this->touchScreen->flickFromElement(
+      $this->locationProvider,
+      $this->x,
+      $this->y,
+      $this->speed
+    );
+  }
+}

+ 27 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverLongPressAction.php

@@ -0,0 +1,27 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Touch;
+
+use Facebook\WebDriver\WebDriverAction;
+
+class WebDriverLongPressAction
+  extends WebDriverTouchAction
+  implements WebDriverAction {
+
+  public function perform() {
+    $this->touchScreen->longPress($this->locationProvider);
+  }
+}

+ 41 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverMoveAction.php

@@ -0,0 +1,41 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Touch;
+
+use Facebook\WebDriver\WebDriverAction;
+
+class WebDriverMoveAction
+  extends WebDriverTouchAction
+  implements WebDriverAction {
+
+  private $x;
+  private $y;
+
+  /**
+   * @param WebDriverTouchScreen $touch_screen
+   * @param int $x
+   * @param int $y
+   */
+  public function __construct(WebDriverTouchScreen $touch_screen, $x, $y) {
+    $this->x = $x;
+    $this->y = $y;
+    parent::__construct($touch_screen);
+  }
+
+  public function perform() {
+    $this->touchScreen->move($this->x, $this->y);
+  }
+}

+ 41 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverScrollAction.php

@@ -0,0 +1,41 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Touch;
+
+use Facebook\WebDriver\WebDriverAction;
+
+class WebDriverScrollAction
+  extends WebDriverTouchAction
+  implements WebDriverAction {
+
+  private $x;
+  private $y;
+
+  /**
+   * @param WebDriverTouchScreen $touch_screen
+   * @param int $x
+   * @param int $y
+   */
+  public function __construct(WebDriverTouchScreen $touch_screen, $x, $y) {
+    $this->x = $x;
+    $this->y = $y;
+    parent::__construct($touch_screen);
+  }
+
+  public function perform() {
+    $this->touchScreen->scroll($this->x, $this->y);
+  }
+}

+ 49 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverScrollFromElementAction.php

@@ -0,0 +1,49 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Touch;
+
+use Facebook\WebDriver\WebDriverAction;
+use Facebook\WebDriver\WebDriverElement;
+
+class WebDriverScrollFromElementAction
+  extends WebDriverTouchAction
+  implements WebDriverAction {
+
+  private $x;
+  private $y;
+
+  /**
+   * @param WebDriverTouchScreen $touch_screen
+   * @param WebDriverElement $element
+   * @param int $x
+   * @param int $y
+   */
+  public function __construct(
+      WebDriverTouchScreen $touch_screen, WebDriverElement $element, $x, $y
+  ) {
+    $this->x = $x;
+    $this->y = $y;
+    parent::__construct($touch_screen, $element);
+  }
+
+  public function perform() {
+    $this->touchScreen->scrollFromElement(
+      $this->locationProvider,
+      $this->x,
+      $this->y
+    );
+  }
+}

+ 27 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverTapAction.php

@@ -0,0 +1,27 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Touch;
+
+use Facebook\WebDriver\WebDriverAction;
+
+class WebDriverTapAction
+  extends WebDriverTouchAction
+  implements WebDriverAction {
+
+  public function perform() {
+    $this->touchScreen->tap($this->locationProvider);
+  }
+}

+ 56 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverTouchAction.php

@@ -0,0 +1,56 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Touch;
+
+use Facebook\WebDriver\Internal\WebDriverLocatable;
+use Facebook\WebDriver\Interactions\Internal\WebDriverCoordinates;
+
+/**
+ * Base class for all touch-related actions.
+ */
+abstract class WebDriverTouchAction {
+
+  /**
+   * @var WebDriverTouchScreen
+   */
+  protected $touchScreen;
+
+  /**
+   * @var WebDriverLocatable
+   */
+  protected $locationProvider;
+
+  /**
+   * @param WebDriverTouchScreen $touch_screen
+   * @param WebDriverLocatable $location_provider
+   */
+  public function __construct(
+    WebDriverTouchScreen $touch_screen,
+    WebDriverLocatable $location_provider = null
+  ) {
+    $this->touchScreen = $touch_screen;
+    $this->locationProvider = $location_provider;
+  }
+
+  /**
+   * @return null|WebDriverCoordinates
+   */
+  protected function getActionLocation() {
+    return $this->locationProvider !== null
+      ? $this->locationProvider->getCoordinates() : null;
+  }
+
+}

+ 122 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/Touch/WebDriverTouchScreen.php

@@ -0,0 +1,122 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions\Touch;
+
+use Facebook\WebDriver\WebDriverElement;
+
+/**
+ * Interface representing touch screen operations.
+ */
+interface WebDriverTouchScreen {
+
+  /**
+   * Single tap on the touch enabled device.
+   *
+   * @param WebDriverElement $element
+   * @return $this
+   */
+  public function tap(WebDriverElement $element);
+
+  /**
+   * Double tap on the touch screen using finger motion events.
+   *
+   * @param WebDriverElement $element
+   * @return $this
+   */
+  public function doubleTap(WebDriverElement $element);
+
+  /**
+   * Finger down on the screen.
+   *
+   * @param int $x
+   * @param int $y
+   * @return $this
+   */
+  public function down($x, $y);
+
+  /**
+   * Flick on the touch screen using finger motion events. Use this flick
+   * command if you don't care where the flick starts on the screen.
+   *
+   * @param int $xspeed
+   * @param int $yspeed
+   * @return $this
+   */
+  public function flick($xspeed, $yspeed);
+
+  /**
+   * Flick on the touch screen using finger motion events.
+   * This flickcommand starts at a particular screen location.
+   *
+   * @param WebDriverElement $element
+   * @param int              $xoffset
+   * @param int              $yoffset
+   * @param int              $speed
+   * @return $this
+   */
+  public function flickFromElement(
+    WebDriverElement $element, $xoffset, $yoffset, $speed);
+
+  /**
+   * Long press on the touch screen using finger motion events.
+   *
+   * @param WebDriverElement $element
+   * @return $this
+   */
+  public function longPress(WebDriverElement $element);
+
+  /**
+   * Finger move on the screen.
+   *
+   * @param int $x
+   * @param int $y
+   * @return $this
+   */
+  public function move($x, $y);
+
+
+  /**
+   * Scroll on the touch screen using finger based motion events. Use this
+   * command if you don't care where the scroll starts on the screen.
+   *
+   * @param int $xoffset
+   * @param int $yoffset
+   * @return $this
+   */
+  public function scroll($xoffset, $yoffset);
+
+  /**
+   * Scroll on the touch screen using finger based motion events. Use this
+   * command to start scrolling at a particular screen location.
+   *
+   * @param WebDriverElement $element
+   * @param int              $xoffset
+   * @param int              $yoffset
+   * @return $this
+   */
+  public function scrollFromElement(
+    WebDriverElement $element, $xoffset, $yoffset);
+
+  /**
+   * Finger up on the screen.
+   *
+   * @param int $x
+   * @param int $y
+   * @return $this
+   */
+  public function up($x, $y);
+
+}

+ 251 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/WebDriverActions.php

@@ -0,0 +1,251 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions;
+
+use Facebook\WebDriver\Interactions\Internal\WebDriverClickAndHoldAction;
+use Facebook\WebDriver\Interactions\Internal\WebDriverMoveToOffsetAction;
+use Facebook\WebDriver\Interactions\Internal\WebDriverButtonReleaseAction;
+use Facebook\WebDriver\Interactions\Internal\WebDriverDoubleClickAction;
+use Facebook\WebDriver\Interactions\Internal\WebDriverSendKeysAction;
+use Facebook\WebDriver\Interactions\Internal\WebDriverClickAction;
+use Facebook\WebDriver\Interactions\Internal\WebDriverKeyDownAction;
+use Facebook\WebDriver\Interactions\Internal\WebDriverContextClickAction;
+use Facebook\WebDriver\Interactions\Internal\WebDriverKeyUpAction;
+use Facebook\WebDriver\Interactions\Internal\WebDriverMouseMoveAction;
+use Facebook\WebDriver\WebDriverElement;
+use Facebook\WebDriver\WebDriver;
+
+/**
+ * WebDriver action builder. It implements the builder pattern.
+ */
+class WebDriverActions {
+
+  protected $driver;
+  protected $keyboard;
+  protected $mouse;
+  protected $action;
+
+  public function __construct(WebDriver $driver) {
+    $this->driver = $driver;
+    $this->keyboard = $driver->getKeyboard();
+    $this->mouse = $driver->getMouse();
+    $this->action = new WebDriverCompositeAction();
+  }
+
+  /**
+   * A convenience method for performing the actions without calling build().
+   * @return void
+   */
+  public function perform() {
+    $this->action->perform();
+  }
+
+  /**
+   * Mouse click.
+   * If $element is provided, move to the middle of the element first.
+   *
+   * @param WebDriverElement $element
+   * @return WebDriverActions
+   */
+  public function click(WebDriverElement $element = null) {
+    $this->action->addAction(
+      new WebDriverClickAction($this->mouse, $element)
+    );
+    return $this;
+  }
+
+  /**
+   * Mouse click and hold.
+   * If $element is provided, move to the middle of the element first.
+   *
+   * @param WebDriverElement $element
+   * @return WebDriverActions
+   */
+  public function clickAndHold(WebDriverElement $element = null) {
+    $this->action->addAction(
+      new WebDriverClickAndHoldAction($this->mouse, $element)
+    );
+    return $this;
+  }
+
+  /**
+   * Context-click (right click).
+   * If $element is provided, move to the middle of the element first.
+   *
+   * @param WebDriverElement $element
+   * @return WebDriverActions
+   */
+  public function contextClick(WebDriverElement $element = null) {
+    $this->action->addAction(
+      new WebDriverContextClickAction($this->mouse, $element)
+    );
+    return $this;
+  }
+
+  /**
+   * Double click.
+   * If $element is provided, move to the middle of the element first.
+   *
+   * @param WebDriverElement $element
+   * @return WebDriverActions
+   */
+  public function doubleClick(WebDriverElement $element = null) {
+    $this->action->addAction(
+      new WebDriverDoubleClickAction($this->mouse, $element)
+    );
+    return $this;
+  }
+
+  /**
+   * Drag and drop from $source to $target.
+   *
+   * @param WebDriverElement $source
+   * @param WebDriverElement $target
+   * @return WebDriverActions
+   */
+  public function dragAndDrop(WebDriverElement $source,
+                              WebDriverElement $target) {
+    $this->action->addAction(
+      new WebDriverClickAndHoldAction($this->mouse, $source)
+    );
+    $this->action->addAction(
+      new WebDriverMouseMoveAction($this->mouse, $target)
+    );
+    $this->action->addAction(
+      new WebDriverButtonReleaseAction($this->mouse, $target)
+    );
+    return $this;
+  }
+
+  /**
+   * Drag $source and drop by offset ($x_offset, $y_offset).
+   *
+   * @param WebDriverElement $source
+   * @param int $x_offset
+   * @param int $y_offset
+   * @return WebDriverActions
+   */
+  public function dragAndDropBy(WebDriverElement $source,
+                                $x_offset,
+                                $y_offset) {
+    $this->action->addAction(
+      new WebDriverClickAndHoldAction($this->mouse, $source)
+    );
+    $this->action->addAction(
+      new WebDriverMoveToOffsetAction($this->mouse, null, $x_offset, $y_offset)
+    );
+    $this->action->addAction(
+      new WebDriverButtonReleaseAction($this->mouse, null)
+    );
+    return $this;
+  }
+
+  /**
+   * Mouse move by offset.
+   *
+   * @param int $x_offset
+   * @param int $y_offset
+   * @return WebDriverActions
+   */
+  public function moveByOffset($x_offset, $y_offset) {
+    $this->action->addAction(
+      new WebDriverMoveToOffsetAction($this->mouse, null, $x_offset, $y_offset)
+    );
+    return $this;
+  }
+
+  /**
+   * Move to the middle of the given WebDriverElement. If offset are provided,
+   * move the an offset from the top-left cornerof that element.
+   *
+   * @param WebDriverElement $element
+   * @param int $x_offset
+   * @param int $y_offset
+   * @return WebDriverActions
+   */
+  public function moveToElement(WebDriverElement $element,
+                                $x_offset = null,
+                                $y_offset = null) {
+    $this->action->addAction(new WebDriverMoveToOffsetAction(
+      $this->mouse, $element, $x_offset, $y_offset
+    ));
+    return $this;
+  }
+
+  /**
+   * Release the mouse button.
+   * If $element is provided, move to the middle of the element first.
+   *
+   * @param WebDriverElement $element
+   * @return WebDriverActions
+   */
+  public function release(WebDriverElement $element = null) {
+    $this->action->addAction(
+      new WebDriverButtonReleaseAction($this->mouse, $element)
+    );
+    return $this;
+  }
+
+  /**
+   * Press a key on keyboard.
+   * If $element is provided, focus on that element first.
+   *
+   * @see WebDriverKeys for special keys like CONTROL, ALT, etc.
+   * @param WebDriverElement $element
+   * @param string $key
+   * @return WebDriverActions
+   */
+  public function keyDown(WebDriverElement $element = null, $key = null) {
+    $this->action->addAction(
+      new WebDriverKeyDownAction($this->keyboard, $this->mouse, $element, $key)
+    );
+    return $this;
+  }
+
+  /**
+   * Release a key on keyboard.
+   * If $element is provided, focus on that element first.
+   *
+   * @see WebDriverKeys for special keys like CONTROL, ALT, etc.
+   * @param WebDriverElement $element
+   * @param string $key
+   * @return WebDriverActions
+   */
+  public function keyUp(WebDriverElement $element = null, $key = null) {
+    $this->action->addAction(
+      new WebDriverKeyUpAction($this->keyboard, $this->mouse, $element, $key)
+    );
+    return $this;
+  }
+
+  /**
+   * Send keys by keyboard.
+   * If $element is provided, focus on that element first.
+   *
+   * @see WebDriverKeys for special keys like CONTROL, ALT, etc.
+   * @param WebDriverElement $element
+   * @param string $keys
+   * @return WebDriverActions
+   */
+  public function sendKeys(WebDriverElement $element = null, $keys = null) {
+    $this->action->addAction(
+      new WebDriverSendKeysAction(
+        $this->keyboard, $this->mouse, $element, $keys
+      )
+    );
+    return $this;
+  }
+}

+ 55 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/WebDriverCompositeAction.php

@@ -0,0 +1,55 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions;
+
+use Facebook\WebDriver\WebDriverAction;
+
+/**
+ * An action for aggregating actions and triggering all of them afterwards.
+ */
+class WebDriverCompositeAction implements WebDriverAction {
+
+  private $actions = array();
+
+  /**
+   * Add an WebDriverAction to the sequence.
+   *
+   * @param WebDriverAction $action
+   * @return WebDriverCompositeAction The current instance.
+   */
+  public function addAction(WebDriverAction $action) {
+    $this->actions[] = $action;
+    return $this;
+  }
+
+  /**
+   * Get the number of actions in the sequence.
+   *
+   * @return int The number of actions.
+   */
+  public function getNumberOfActions() {
+    return count($this->actions);
+  }
+
+  /**
+   * Perform the seqeunce of actions.
+   */
+  public function perform() {
+    foreach ($this->actions as $action) {
+      $action->perform();
+    }
+  }
+}

+ 169 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Interactions/WebDriverTouchActions.php

@@ -0,0 +1,169 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver\Interactions;
+
+use Facebook\WebDriver\Interactions\Touch\WebDriverTouchScreen;
+use Facebook\WebDriver\Interactions\Touch\WebDriverDoubleTapAction;
+use Facebook\WebDriver\Interactions\Touch\WebDriverFlickAction;
+use Facebook\WebDriver\Interactions\Touch\WebDriverFlickFromElementAction;
+use Facebook\WebDriver\Interactions\Touch\WebDriverLongPressAction;
+use Facebook\WebDriver\Interactions\Touch\WebDriverTapAction;
+use Facebook\WebDriver\Interactions\Touch\WebDriverScrollFromElementAction;
+use Facebook\WebDriver\Interactions\Touch\WebDriverDownAction;
+use Facebook\WebDriver\Interactions\Touch\WebDriverMoveAction;
+use Facebook\WebDriver\Interactions\Touch\WebDriverScrollAction;
+use Facebook\WebDriver\WebDriverUpAction;
+use Facebook\WebDriver\WebDriverElement;
+use Facebook\WebDriver\WebDriver;
+
+/**
+ * WebDriver action builder for touch events
+ */
+class WebDriverTouchActions extends WebDriverActions {
+
+  /**
+   * @var WebDriverTouchScreen
+   */
+  protected $touchScreen;
+
+  public function __construct(WebDriver $driver) {
+    parent::__construct($driver);
+    $this->touchScreen = $driver->getTouch();
+  }
+
+  /**
+   * @param WebDriverElement $element
+   * @return WebDriverTouchActions
+   */
+  public function tap(WebDriverElement $element) {
+    $this->action->addAction(
+      new WebDriverTapAction($this->touchScreen, $element)
+    );
+    return $this;
+  }
+
+  /**
+   * @param int $x
+   * @param int $y
+   * @return WebDriverTouchActions
+   */
+  public function down($x, $y) {
+    $this->action->addAction(
+      new WebDriverDownAction($this->touchScreen, $x, $y)
+    );
+    return $this;
+  }
+
+  /**
+   * @param int $x
+   * @param int $y
+   * @return WebDriverTouchActions
+   */
+  public function up($x, $y) {
+    $this->action->addAction(
+      new WebDriverUpAction($this->touchScreen, $x, $y)
+    );
+    return $this;
+  }
+
+  /**
+   * @param int $x
+   * @param int $y
+   * @return WebDriverTouchActions
+   */
+  public function move($x, $y) {
+    $this->action->addAction(
+      new WebDriverMoveAction($this->touchScreen, $x, $y)
+    );
+    return $this;
+  }
+
+  /**
+   * @param int $x
+   * @param int $y
+   * @return WebDriverTouchActions
+   */
+  public function scroll($x, $y) {
+    $this->action->addAction(
+      new WebDriverScrollAction($this->touchScreen, $x, $y)
+    );
+    return $this;
+  }
+
+  /**
+   * @param WebDriverElement $element
+   * @param int $x
+   * @param int $y
+   * @return WebDriverTouchActions
+   */
+  public function scrollFromElement(WebDriverElement $element, $x, $y) {
+    $this->action->addAction(
+      new WebDriverScrollFromElementAction($this->touchScreen, $element, $x, $y)
+    );
+    return $this;
+  }
+
+  /**
+   * @param WebDriverElement $element
+   * @return WebDriverTouchActions
+   */
+  public function doubleTap(WebDriverElement $element) {
+    $this->action->addAction(
+      new WebDriverDoubleTapAction($this->touchScreen, $element)
+    );
+    return $this;
+  }
+
+  /**
+   * @param WebDriverElement $element
+   * @return WebDriverTouchActions
+   */
+  public function longPress(WebDriverElement $element) {
+    $this->action->addAction(
+      new WebDriverLongPressAction($this->touchScreen, $element)
+    );
+    return $this;
+  }
+
+  /**
+   * @param int $x
+   * @param int $y
+   * @return WebDriverTouchActions
+   */
+  public function flick($x, $y) {
+    $this->action->addAction(
+      new WebDriverFlickAction($this->touchScreen, $x, $y)
+    );
+    return $this;
+  }
+
+  /**
+   * @param WebDriverElement $element
+   * @param int $x
+   * @param int $y
+   * @param int $speed
+   * @return WebDriverTouchActions
+   */
+  public function flickFromElement(WebDriverElement $element, $x, $y, $speed) {
+    $this->action->addAction(
+      new WebDriverFlickFromElementAction(
+        $this->touchScreen, $element, $x, $y, $speed
+      )
+    );
+    return $this;
+  }
+
+}

+ 29 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/Internal/WebDriverLocatable.php

@@ -0,0 +1,29 @@
+<?php
+// copyright 2004-present facebook. all rights reserved.
+//
+// licensed under the apache license, version 2.0 (the "license");
+// you may not use this file except in compliance with the license.
+// you may obtain a copy of the license at
+//
+//   http://www.apache.org/licenses/license-2.0
+//
+// unless required by applicable law or agreed to in writing, software
+// distributed under the license is distributed on an "as is" basis,
+// without warranties or conditions of any kind, either express or implied.
+// see the license for the specific language governing permissions and
+// limitations under the license.
+
+namespace Facebook\WebDriver\Internal;
+
+use Facebook\WebDriver\Interactions\Internal\WebDriverCoordinates;
+
+/**
+ * interface representing basic mouse operations.
+ */
+interface WebDriverLocatable {
+
+  /**
+   * @return WebDriverCoordinates
+   */
+  public function getCoordinates();
+}

+ 49 - 0
RemoteBrowser/vendor/php-webdriver/webdriver/lib/JavaScriptExecutor.php

@@ -0,0 +1,49 @@
+<?php
+// Copyright 2004-present Facebook. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Facebook\WebDriver;
+
+/**
+ * WebDriver interface implemented by drivers that support JavaScript.
+ */
+interface JavaScriptExecutor {
+
+  /**
+   * Inject a snippet of JavaScript into the page for execution in the context
+   * of the currently selected frame. The executed script is assumed to be
+   * synchronous and the result of evaluating the script will be returned.
+   *
+   * @param string $script The script to inject.
+   * @param array $arguments The arguments of the script.
+   * @return mixed The return value of the script.
+   */
+  public function executeScript($script, array $arguments = array());
+
+  /**
+   * Inject a snippet of JavaScript into the page for asynchronous execution in
+   * the context of the currently selected frame.
+   *
+   * The driver will pass a callback as the last argument to the snippet, and
+   * block until the callback is invoked.
+   *
+   * @see WebDriverExecuteAsyncScriptTestCase
+   *
+   * @param string $script The script to inject.
+   * @param array $arguments The arguments of the script.
+   * @return mixed The value passed by the script to the callback.
+   */
+  public function executeAsyncScript($script, array $arguments = array());
+
+}

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä