diff --git a/composer.json b/composer.json index d8ac671051093e540a8b14112c8fa268d1676dca..8a20b7a7aaed6105011fd934925b3b11758d1cd6 100644 --- a/composer.json +++ b/composer.json @@ -1,60 +1,50 @@ -{ - "name": "vufind/vufind", - "description": "A flexible discovery layer.", - "authors": [ - { - "name": "Demian Katz", - "email": "demian.katz@villanova.edu" - } - ], - "license": "GPL-2.0", - "repositories": [ - { - "type": "composer", - "url": "https://packages.zendframework.com/" - }, - { - "type": "pear", - "url": "http://pear.php.net" - }, - { - "type": "package", - "package": { - "name": "mobileesp/mdetect", - "version": "dev-master", - "dist": { - "url": "https://raw.githubusercontent.com/ahand/mobileesp/master/PHP/mdetect.php", - "type": "file" - }, - "autoload": { - "classmap": ["/"] - } - } - } - ], - "require": { - "aferrandini/phpqrcode": "1.0.1", - "jasig/phpcas": "1.3.3", - "cap60552/php-sip2": "1.0.0", - "los/losrecaptcha": "1.0.0", - "mobileesp/mdetect": "dev-master", - "ocramius/proxy-manager": "1.0.2", - "oyejorge/less.php": "1.7.0.9", - "pear-pear.php.net/file_marc": "1.1.2", - "pear-pear.php.net/pear": "1.10.1", - "pear-pear.php.net/validate_ispn": "0.6.1", - "serialssolutions/summon": "1.0.0", - "symfony/yaml": "2.7.6", - "vufind-org/vufindcode": "1.0.2", - "vufind-org/vufindhttp": "2.0.0", - "zendframework/zendframework": "2.4.6", - "zendframework/zendrest": "2.0.2", - "zendframework/zendservice-amazon": "2.0.4", - "zf-commons/zfc-rbac": "2.5.2" - }, - "require-dev": { - "behat/mink": "1.7.0", - "behat/mink-selenium2-driver": "1.3.0", - "behat/mink-zombie-driver": "1.3.0" - } -} +{ + "name": "vufind/vufind", + "description": "A flexible discovery layer.", + "authors": [ + { + "name": "Demian Katz", + "email": "demian.katz@villanova.edu" + } + ], + "license": "GPL-2.0", + "repositories": [ + { + "type": "composer", + "url": "https://packages.zendframework.com/" + }, + { + "type": "pear", + "url": "http://pear.php.net" + }, + { + "type": "vcs", + "url": "https://github.com/ahand/mobileesp" + } + ], + "require": { + "aferrandini/phpqrcode": "1.0.1", + "jasig/phpcas": "1.3.3", + "cap60552/php-sip2": "1.0.0", + "los/losrecaptcha": "1.0.0", + "ahand/mobileesp": "dev-master", + "ocramius/proxy-manager": "1.0.2", + "oyejorge/less.php": "1.7.0.9", + "pear-pear.php.net/file_marc": "1.1.2", + "pear-pear.php.net/pear": "1.10.1", + "pear-pear.php.net/validate_ispn": "0.6.1", + "serialssolutions/summon": "1.0.0", + "symfony/yaml": "2.7.6", + "vufind-org/vufindcode": "1.0.2", + "vufind-org/vufindhttp": "2.0.0", + "zendframework/zendframework": "2.4.6", + "zendframework/zendrest": "2.0.2", + "zendframework/zendservice-amazon": "2.0.4", + "zf-commons/zfc-rbac": "2.5.2" + }, + "require-dev": { + "behat/mink": "1.7.0", + "behat/mink-selenium2-driver": "1.3.0", + "behat/mink-zombie-driver": "1.3.0" + } +} diff --git a/composer.lock b/composer.lock index 4b8d070e19e0acdaeeccacf2ecfafc4e6c560697..164cae7238c6cfa5a292eefb5a59bd0ee55b56b6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "9420a0bbc2e584b4023a6c43958b1a07", - "content-hash": "a0447b7d3321558bb291167cabb9097d", + "hash": "70752de0b828ea3005b2308508a5ec38", + "content-hash": "0bfc46ce6a8b8acd28e89a131f59c002", "packages": [ { "name": "aferrandini/phpqrcode", @@ -52,123 +52,61 @@ "time": "2013-07-08 09:39:08" }, { - "name": "behat/mink", - "version": "v1.7.0", + "name": "ahand/mobileesp", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/minkphp/Mink.git", - "reference": "6c129030ec2cc029905cf969a56ca8f087b2dfdf" + "url": "https://github.com/ahand/mobileesp.git", + "reference": "098bc79938fceec7bbb298456ed1aba6271a0bac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/minkphp/Mink/zipball/6c129030ec2cc029905cf969a56ca8f087b2dfdf", - "reference": "6c129030ec2cc029905cf969a56ca8f087b2dfdf", + "url": "https://api.github.com/repos/ahand/mobileesp/zipball/098bc79938fceec7bbb298456ed1aba6271a0bac", + "reference": "098bc79938fceec7bbb298456ed1aba6271a0bac", "shasum": "" }, - "require": { - "php": ">=5.3.1", - "symfony/css-selector": "~2.1" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "suggest": { - "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", - "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", - "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", - "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" - }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7.x-dev" - } - }, "autoload": { - "psr-4": { - "Behat\\Mink\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Browser controller/emulator abstraction for PHP", - "homepage": "http://mink.behat.org/", - "keywords": [ - "browser", - "testing", - "web" - ], - "time": "2015-09-20 20:24:03" - }, - { - "name": "behat/mink-selenium2-driver", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/minkphp/MinkSelenium2Driver.git", - "reference": "bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9", - "reference": "bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9", - "shasum": "" - }, - "require": { - "behat/mink": "~1.7@dev", - "instaclick/php-webdriver": "~1.1", - "php": ">=5.3.1" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" - }, - "type": "mink-driver", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Behat\\Mink\\Driver\\": "src/" - } + "classmap": [ + "PHP" + ] }, - "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "Apache-2.0" ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Pete Otaqui", - "email": "pete@otaqui.com", - "homepage": "https://github.com/pete-otaqui" + "name": "Anthony Hand", + "email": "anthony.hand@gmail.com", + "role": "Maintainer" } ], - "description": "Selenium2 (WebDriver) driver for Mink framework", - "homepage": "http://mink.behat.org/", + "description": "Since 2008, MobileESP provides web site developers an easy-to-use and lightweight API for detecting whether visitors are using a mobile device, and if so, what kind. The APIs provide simple boolean results ('true' or 'false') for identifying individual device categories (such as iPhone, BlackBerry, Android, and Windows Mobile), device capabilities (e.g., J2ME), and broad classes of devices, such as 'iPhone Tier' (iPhone/Android/Tizen) or 'Tablet Tier.' APIs are available in PHP, JavaScript, Java, C#, Ruby Python, and more.", + "homepage": "http://www.mobileesp.org", "keywords": [ - "ajax", "browser", - "javascript", - "selenium", - "testing", - "webdriver" - ], - "time": "2015-09-21 21:02:54" + "detect android", + "detect ipad", + "detect iphone", + "detect tablet", + "mobile", + "mobile detect", + "mobile detector", + "mobile device", + "mobile esp", + "mobile redirect", + "mobile view managing", + "mobile-detect", + "mobiledetect", + "responsive web", + "user agent", + "useragent" + ], + "support": { + "issues": "https://github.com/ahand/mobileesp/issues", + "source": "https://github.com/ahand/mobileesp/" + }, + "time": "2015-12-03 05:20:25" }, { "name": "cap60552/php-sip2", @@ -205,64 +143,6 @@ "homepage": "https://github.com/cap60552/php-sip2", "time": "2015-11-03 04:42:39" }, - { - "name": "instaclick/php-webdriver", - "version": "1.4.3", - "source": { - "type": "git", - "url": "https://github.com/instaclick/php-webdriver.git", - "reference": "0c20707dcf30a32728fd6bdeeab996c887fdb2fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/0c20707dcf30a32728fd6bdeeab996c887fdb2fb", - "reference": "0c20707dcf30a32728fd6bdeeab996c887fdb2fb", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.3.2" - }, - "require-dev": { - "satooshi/php-coveralls": "dev-master" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "psr-0": { - "WebDriver": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Justin Bishop", - "email": "jubishop@gmail.com", - "role": "Developer" - }, - { - "name": "Anthon Pang", - "email": "apang@softwaredevelopment.ca", - "role": "Fork Maintainer" - } - ], - "description": "PHP WebDriver for Selenium 2", - "homepage": "http://instaclick.com/", - "keywords": [ - "browser", - "selenium", - "webdriver", - "webtest" - ], - "time": "2015-06-15 20:19:33" - }, { "name": "jasig/phpcas", "version": "1.3.3", @@ -376,22 +256,6 @@ ], "time": "2015-04-28 15:40:23" }, - { - "name": "mobileesp/mdetect", - "version": "dev-master", - "dist": { - "type": "file", - "url": "https://raw.githubusercontent.com/ahand/mobileesp/master/PHP/mdetect.php", - "reference": null, - "shasum": null - }, - "type": "library", - "autoload": { - "classmap": [ - "/" - ] - } - }, { "name": "ocramius/proxy-manager", "version": "1.0.2", @@ -791,56 +655,6 @@ "description": "Library for interacting with Serials Solutions' Summon API.", "time": "2013-11-13 19:07:09" }, - { - "name": "symfony/css-selector", - "version": "v2.7.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "e1b865b26be4a56d22a8dee398375044a80c865b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/e1b865b26be4a56d22a8dee398375044a80c865b", - "reference": "e1b865b26be4a56d22a8dee398375044a80c865b", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com", - "time": "2015-10-11 09:39:48" - }, { "name": "symfony/yaml", "version": "v2.7.6", @@ -1365,6 +1179,125 @@ } ], "packages-dev": [ + { + "name": "behat/mink", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/minkphp/Mink.git", + "reference": "6c129030ec2cc029905cf969a56ca8f087b2dfdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/Mink/zipball/6c129030ec2cc029905cf969a56ca8f087b2dfdf", + "reference": "6c129030ec2cc029905cf969a56ca8f087b2dfdf", + "shasum": "" + }, + "require": { + "php": ">=5.3.1", + "symfony/css-selector": "~2.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "suggest": { + "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", + "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", + "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", + "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Browser controller/emulator abstraction for PHP", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "testing", + "web" + ], + "time": "2015-09-20 20:24:03" + }, + { + "name": "behat/mink-selenium2-driver", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/minkphp/MinkSelenium2Driver.git", + "reference": "bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9", + "reference": "bedbf1999c7ba1bc6921b30ee2eadf383e7ff5c9", + "shasum": "" + }, + "require": { + "behat/mink": "~1.7@dev", + "instaclick/php-webdriver": "~1.1", + "php": ">=5.3.1" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "mink-driver", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Behat\\Mink\\Driver\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Pete Otaqui", + "email": "pete@otaqui.com", + "homepage": "https://github.com/pete-otaqui" + } + ], + "description": "Selenium2 (WebDriver) driver for Mink framework", + "homepage": "http://mink.behat.org/", + "keywords": [ + "ajax", + "browser", + "javascript", + "selenium", + "testing", + "webdriver" + ], + "time": "2015-09-21 21:02:54" + }, { "name": "behat/mink-zombie-driver", "version": "v1.3.0", @@ -1427,18 +1360,129 @@ ], "time": "2015-09-21 21:07:53" }, + { + "name": "instaclick/php-webdriver", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/instaclick/php-webdriver.git", + "reference": "0c20707dcf30a32728fd6bdeeab996c887fdb2fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/0c20707dcf30a32728fd6bdeeab996c887fdb2fb", + "reference": "0c20707dcf30a32728fd6bdeeab996c887fdb2fb", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.2" + }, + "require-dev": { + "satooshi/php-coveralls": "dev-master" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "WebDriver": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Justin Bishop", + "email": "jubishop@gmail.com", + "role": "Developer" + }, + { + "name": "Anthon Pang", + "email": "apang@softwaredevelopment.ca", + "role": "Fork Maintainer" + } + ], + "description": "PHP WebDriver for Selenium 2", + "homepage": "http://instaclick.com/", + "keywords": [ + "browser", + "selenium", + "webdriver", + "webtest" + ], + "time": "2015-06-15 20:19:33" + }, + { + "name": "symfony/css-selector", + "version": "v2.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "b600fec37c0efca08046d481d79e7eabc07108ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/b600fec37c0efca08046d481d79e7eabc07108ff", + "reference": "b600fec37c0efca08046d481d79e7eabc07108ff", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "https://symfony.com", + "time": "2015-10-30 20:15:42" + }, { "name": "symfony/process", - "version": "v2.7.6", + "version": "v2.8.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "4a959dd4e19c2c5d7512689413921e0a74386ec7" + "reference": "1b988a88e3551102f3c2d9e1d47a18c3a78d6312" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4a959dd4e19c2c5d7512689413921e0a74386ec7", - "reference": "4a959dd4e19c2c5d7512689413921e0a74386ec7", + "url": "https://api.github.com/repos/symfony/process/zipball/1b988a88e3551102f3c2d9e1d47a18c3a78d6312", + "reference": "1b988a88e3551102f3c2d9e1d47a18c3a78d6312", "shasum": "" }, "require": { @@ -1447,13 +1491,16 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Process\\": "" - } + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1471,13 +1518,13 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2015-10-23 14:47:27" + "time": "2015-11-30 12:35:10" } ], "aliases": [], "minimum-stability": "stable", "stability-flags": { - "mobileesp/mdetect": 20 + "ahand/mobileesp": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/vendor/ahand/mobileesp b/vendor/ahand/mobileesp new file mode 160000 index 0000000000000000000000000000000000000000..098bc79938fceec7bbb298456ed1aba6271a0bac --- /dev/null +++ b/vendor/ahand/mobileesp @@ -0,0 +1 @@ +Subproject commit 098bc79938fceec7bbb298456ed1aba6271a0bac diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 940237b3316d89f638968e78415e2c18afae0e90..3e976676cdeb1503b028c175a6ee7a528e1eef9a 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -151,5 +151,5 @@ return array( 'lessc' => $vendorDir . '/oyejorge/less.php/lessc.inc.php', 'phpCAS' => $vendorDir . '/jasig/phpcas/source/CAS.php', 'sip2' => $vendorDir . '/cap60552/php-sip2/sip2.class.php', - 'uagent_info' => $vendorDir . '/mobileesp/mdetect/mdetect.php', + 'uagent_info' => $vendorDir . '/ahand/mobileesp/PHP/mdetect.php', ); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 6b753a4cc4862dbf00310a0b5e1260f68e6cca42..1175685b1454096df65b3e8054db923de1d424eb 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -336,24 +336,6 @@ "zf2" ] }, - { - "name": "mobileesp/mdetect", - "version": "dev-master", - "version_normalized": "9999999-dev", - "dist": { - "type": "file", - "url": "https://raw.githubusercontent.com/ahand/mobileesp/master/PHP/mdetect.php", - "reference": null, - "shasum": null - }, - "type": "library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "/" - ] - } - }, { "name": "ocramius/proxy-manager", "version": "1.0.2", @@ -1039,106 +1021,6 @@ "zf2" ] }, - { - "name": "symfony/process", - "version": "v2.7.6", - "version_normalized": "2.7.6.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "4a959dd4e19c2c5d7512689413921e0a74386ec7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4a959dd4e19c2c5d7512689413921e0a74386ec7", - "reference": "4a959dd4e19c2c5d7512689413921e0a74386ec7", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "time": "2015-10-23 14:47:27", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/css-selector", - "version": "v2.7.6", - "version_normalized": "2.7.6.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "e1b865b26be4a56d22a8dee398375044a80c865b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/e1b865b26be4a56d22a8dee398375044a80c865b", - "reference": "e1b865b26be4a56d22a8dee398375044a80c865b", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "time": "2015-10-11 09:39:48", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com" - }, { "name": "behat/mink", "version": "v1.7.0", @@ -1524,5 +1406,170 @@ "testing", "webdriver" ] + }, + { + "name": "symfony/css-selector", + "version": "v2.8.0", + "version_normalized": "2.8.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "b600fec37c0efca08046d481d79e7eabc07108ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/b600fec37c0efca08046d481d79e7eabc07108ff", + "reference": "b600fec37c0efca08046d481d79e7eabc07108ff", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "time": "2015-10-30 20:15:42", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "https://symfony.com" + }, + { + "name": "symfony/process", + "version": "v2.8.0", + "version_normalized": "2.8.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "1b988a88e3551102f3c2d9e1d47a18c3a78d6312" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/1b988a88e3551102f3c2d9e1d47a18c3a78d6312", + "reference": "1b988a88e3551102f3c2d9e1d47a18c3a78d6312", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "time": "2015-11-30 12:35:10", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com" + }, + { + "name": "ahand/mobileesp", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/ahand/mobileesp.git", + "reference": "098bc79938fceec7bbb298456ed1aba6271a0bac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ahand/mobileesp/zipball/098bc79938fceec7bbb298456ed1aba6271a0bac", + "reference": "098bc79938fceec7bbb298456ed1aba6271a0bac", + "shasum": "" + }, + "time": "2015-12-03 05:20:25", + "type": "library", + "installation-source": "source", + "autoload": { + "classmap": [ + "PHP" + ] + }, + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Anthony Hand", + "email": "anthony.hand@gmail.com", + "role": "Maintainer" + } + ], + "description": "Since 2008, MobileESP provides web site developers an easy-to-use and lightweight API for detecting whether visitors are using a mobile device, and if so, what kind. The APIs provide simple boolean results ('true' or 'false') for identifying individual device categories (such as iPhone, BlackBerry, Android, and Windows Mobile), device capabilities (e.g., J2ME), and broad classes of devices, such as 'iPhone Tier' (iPhone/Android/Tizen) or 'Tablet Tier.' APIs are available in PHP, JavaScript, Java, C#, Ruby Python, and more.", + "homepage": "http://www.mobileesp.org", + "keywords": [ + "browser", + "detect android", + "detect ipad", + "detect iphone", + "detect tablet", + "mobile", + "mobile detect", + "mobile detector", + "mobile device", + "mobile esp", + "mobile redirect", + "mobile view managing", + "mobile-detect", + "mobiledetect", + "responsive web", + "user agent", + "useragent" + ], + "support": { + "issues": "https://github.com/ahand/mobileesp/issues", + "source": "https://github.com/ahand/mobileesp/" + } } ] diff --git a/vendor/mobileesp/mdetect/mdetect.php b/vendor/mobileesp/mdetect/mdetect.php deleted file mode 100644 index 47810a45b0beb3eb408a3124912c414223eb8a46..0000000000000000000000000000000000000000 --- a/vendor/mobileesp/mdetect/mdetect.php +++ /dev/null @@ -1,1287 +0,0 @@ -<?php - -/* ******************************************* -// Copyright 2010-2015, Anthony Hand -// -// -// File version 2015.05.13 (May 13, 2015) -// Updates: -// - Moved MobileESP to GitHub. https://github.com/ahand/mobileesp -// - Opera Mobile/Mini browser has the same UA string on multiple platforms and doesn't differentiate phone vs. tablet. -// - Removed DetectOperaAndroidPhone(). This method is no longer reliable. -// - Removed DetectOperaAndroidTablet(). This method is no longer reliable. -// - Added support for Windows Phone 10: variable and DetectWindowsPhone10() -// - Updated DetectWindowsPhone() to include WP10. -// - Added support for Firefox OS. -// - A variable plus DetectFirefoxOS(), DetectFirefoxOSPhone(), DetectFirefoxOSTablet() -// - NOTE: Firefox doesn't add UA tokens to definitively identify Firefox OS vs. their browsers on other mobile platforms. -// - Added support for Sailfish OS. Not enough info to add a tablet detection method at this time. -// - A variable plus DetectSailfish(), DetectSailfishPhone() -// - Added support for Ubuntu Mobile OS. -// - DetectUbuntu(), DetectUbuntuPhone(), DetectUbuntuTablet() -// - Added support for 2 smart TV OSes. They lack browsers but do have WebViews for use by HTML apps. -// - One variable for Samsung Tizen TVs, plus DetectTizenTV() -// - One variable for LG WebOS TVs, plus DetectWebOSTV() -// - Updated DetectTizen(). Now tests for “mobile†to disambiguate from Samsung Smart TVs -// - Removed variables for obsolete devices: deviceHtcFlyer, deviceXoom. -// - Updated DetectAndroid(). No longer has a special test case for the HTC Flyer tablet. -// - Updated DetectAndroidPhone(). -// - Updated internal detection code for Android. -// - No longer has a special test case for the HTC Flyer tablet. -// - Checks against DetectOperaMobile() on Android and reports here if relevant. -// - Updated DetectAndroidTablet(). -// - No longer has a special test case for the HTC Flyer tablet. -// - Checks against DetectOperaMobile() on Android to exclude it from here. -// - DetectMeego(): Changed definition for this method. Now detects any Meego OS device, not just phones. -// - DetectMeegoPhone(): NEW. For Meego phones. Ought to detect Opera browsers on Meego, as well. -// - DetectTierIphone(): Added support for phones running Sailfish, Ubuntu and Firefox Mobile. -// - DetectTierTablet(): Added support for tablets running Ubuntu and Firefox Mobile. -// - DetectSmartphone(): Added support for Meego phones. -// - Reorganized DetectMobileQuick(). Moved the following to DetectMobileLong(): -// - DetectDangerHiptop(), DetectMaemoTablet(), DetectSonyMylo(), DetectArchos() -// - Removed the variable for Obigo, an embedded browser. The browser is on old devices. -// - Couldn’t find info on current Obigo embedded browser user agent strings. -// -// -// -// LICENSE INFORMATION -// 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. -// -// -// ABOUT THIS PROJECT -// Project Owner: Anthony Hand -// Email: anthony.hand@gmail.com -// Web Site: http://www.mobileesp.com -// Source Files: https://github.com/ahand/mobileesp -// -// Versions of this code are available for: -// PHP, JavaScript, Java, ASP.NET (C#), and Ruby -// -// ******************************************* -*/ - - - -//************************** -// The uagent_info class encapsulates information about -// a browser's connection to your web site. -// You can use it to find out whether the browser asking for -// your site's content is probably running on a mobile device. -// The methods were written so you can be as granular as you want. -// For example, enquiring whether it's as specific as an iPod Touch or -// as general as a smartphone class device. -// The object's methods return 1 for true, or 0 for false. -class uagent_info -{ - var $useragent = ""; - var $httpaccept = ""; - - //standardized values for true and false. - var $true = 1; - var $false = 0; - - //Let's store values for quickly accessing the same info multiple times. InitCompleted - var $initCompleted = 0; //Stores whether we're currently initializing the most popular functions. - var $isWebkit = 0; //Stores the result of DetectWebkit() - var $isMobilePhone = 0; //Stores the result of DetectMobileQuick() - var $isIphone = 0; //Stores the result of DetectIphone() - var $isAndroid = 0; //Stores the result of DetectAndroid() - var $isAndroidPhone = 0; //Stores the result of DetectAndroidPhone() - var $isTierTablet = 0; //Stores the result of DetectTierTablet() - var $isTierIphone = 0; //Stores the result of DetectTierIphone() - var $isTierRichCss = 0; //Stores the result of DetectTierRichCss() - var $isTierGenericMobile = 0; //Stores the result of DetectTierOtherPhones() - - //Initialize some initial smartphone string variables. - var $engineWebKit = 'webkit'; - var $deviceIphone = 'iphone'; - var $deviceIpod = 'ipod'; - var $deviceIpad = 'ipad'; - var $deviceMacPpc = 'macintosh'; //Used for disambiguation - - var $deviceAndroid = 'android'; - var $deviceGoogleTV = 'googletv'; - - var $deviceWinPhone7 = 'windows phone os 7'; - var $deviceWinPhone8 = 'windows phone 8'; - var $deviceWinPhone10 = 'windows phone 10'; - var $deviceWinMob = 'windows ce'; - var $deviceWindows = 'windows'; - var $deviceIeMob = 'iemobile'; - var $devicePpc = 'ppc'; //Stands for PocketPC - var $enginePie = 'wm5 pie'; //An old Windows Mobile - - var $deviceBB = 'blackberry'; - var $deviceBB10 = 'bb10'; //For the new BB 10 OS - var $vndRIM = 'vnd.rim'; //Detectable when BB devices emulate IE or Firefox - var $deviceBBStorm = 'blackberry95'; //Storm 1 and 2 - var $deviceBBBold = 'blackberry97'; //Bold 97x0 (non-touch) - var $deviceBBBoldTouch = 'blackberry 99'; //Bold 99x0 (touchscreen) - var $deviceBBTour = 'blackberry96'; //Tour - var $deviceBBCurve = 'blackberry89'; //Curve2 - var $deviceBBCurveTouch = 'blackberry 938'; //Curve Touch - var $deviceBBTorch = 'blackberry 98'; //Torch - var $deviceBBPlaybook = 'playbook'; //PlayBook tablet - - var $deviceSymbian = 'symbian'; - var $deviceS60 = 'series60'; - var $deviceS70 = 'series70'; - var $deviceS80 = 'series80'; - var $deviceS90 = 'series90'; - - var $devicePalm = 'palm'; - var $deviceWebOS = 'webos'; //For Palm devices - var $deviceWebOStv = 'web0s'; //For LG TVs - var $deviceWebOShp = 'hpwos'; //For HP's line of WebOS devices - - var $deviceNuvifone = 'nuvifone'; //Garmin Nuvifone - var $deviceBada = 'bada'; //Samsung's Bada OS - var $deviceTizen = 'tizen'; //Tizen OS - var $deviceMeego = 'meego'; //Meego OS - var $deviceSailfish = 'sailfish'; //Sailfish OS - var $deviceUbuntu = 'ubuntu'; //Ubuntu Mobile OS - - var $deviceKindle = 'kindle'; //Amazon Kindle, eInk one - var $engineSilk = 'silk-accelerated'; //Amazon's accelerated Silk browser for Kindle Fire - - var $engineBlazer = 'blazer'; //Old Palm browser - var $engineXiino = 'xiino'; //Another old Palm - - //Initialize variables for mobile-specific content. - var $vndwap = 'vnd.wap'; - var $wml = 'wml'; - - //Initialize variables for other random devices and mobile browsers. - var $deviceTablet = 'tablet'; //Generic term for slate and tablet devices - var $deviceBrew = 'brew'; - var $deviceDanger = 'danger'; - var $deviceHiptop = 'hiptop'; - var $devicePlaystation = 'playstation'; - var $devicePlaystationVita = 'vita'; - var $deviceNintendoDs = 'nitro'; - var $deviceNintendo = 'nintendo'; - var $deviceWii = 'wii'; - var $deviceXbox = 'xbox'; - var $deviceArchos = 'archos'; - - var $engineFirefox = 'firefox'; //For Firefox OS - var $engineOpera = 'opera'; //Popular browser - var $engineNetfront = 'netfront'; //Common embedded OS browser - var $engineUpBrowser = 'up.browser'; //common on some phones - var $engineOpenWeb = 'openweb'; //Transcoding by OpenWave server - var $deviceMidp = 'midp'; //a mobile Java technology - var $uplink = 'up.link'; - var $engineTelecaQ = 'teleca q'; //a modern feature phone browser - - var $devicePda = 'pda'; //some devices report themselves as PDAs - var $mini = 'mini'; //Some mobile browsers put 'mini' in their names. - var $mobile = 'mobile'; //Some mobile browsers put 'mobile' in their user agent strings. - var $mobi = 'mobi'; //Some mobile browsers put 'mobi' in their user agent strings. - - //Smart TV strings - var $smartTV1 = 'smart-tv'; //Samsung Tizen smart TVs - var $smartTV2 = 'smarttv'; //LG WebOS smart TVs - - //Use Maemo, Tablet, and Linux to test for Nokia's Internet Tablets. - var $maemo = 'maemo'; - var $linux = 'linux'; - var $qtembedded = 'qt embedded'; //for Sony Mylo and others - var $mylocom2 = 'com2'; //for Sony Mylo also - - //In some UserAgents, the only clue is the manufacturer. - var $manuSonyEricsson = "sonyericsson"; - var $manuericsson = "ericsson"; - var $manuSamsung1 = "sec-sgh"; - var $manuSony = "sony"; - var $manuHtc = "htc"; //Popular Android and WinMo manufacturer - - //In some UserAgents, the only clue is the operator. - var $svcDocomo = "docomo"; - var $svcKddi = "kddi"; - var $svcVodafone = "vodafone"; - - //Disambiguation strings. - var $disUpdate = "update"; //pda vs. update - - - //************************** - //The constructor. Allows the latest PHP (5.0+) to locate a constructor object and initialize the object. - function __construct() - { - $this->uagent_info(); - } - - - //************************** - //The object initializer. Initializes several default variables. - function uagent_info() - { - $this->useragent = isset($_SERVER['HTTP_USER_AGENT'])?strtolower($_SERVER['HTTP_USER_AGENT']):''; - $this->httpaccept = isset($_SERVER['HTTP_ACCEPT'])?strtolower($_SERVER['HTTP_ACCEPT']):''; - - //Let's initialize some values to save cycles later. - $this->InitDeviceScan(); - } - - //************************** - // Initialize Key Stored Values. - function InitDeviceScan() - { - //Save these properties to speed processing - global $isWebkit, $isIphone, $isAndroid, $isAndroidPhone; - $this->isWebkit = $this->DetectWebkit(); - $this->isIphone = $this->DetectIphone(); - $this->isAndroid = $this->DetectAndroid(); - $this->isAndroidPhone = $this->DetectAndroidPhone(); - - //These tiers are the most useful for web development - global $isMobilePhone, $isTierTablet, $isTierIphone; - $this->isMobilePhone = $this->DetectMobileQuick(); - $this->isTierIphone = $this->DetectTierIphone(); - $this->isTierTablet = $this->DetectTierTablet(); - - //Optional: Comment these out if you NEVER use them. - global $isTierRichCss, $isTierGenericMobile; - $this->isTierRichCss = $this->DetectTierRichCss(); - $this->isTierGenericMobile = $this->DetectTierOtherPhones(); - - $this->initCompleted = $this->true; - } - - //************************** - //Returns the contents of the User Agent value, in lower case. - function Get_Uagent() - { - return $this->useragent; - } - - //************************** - //Returns the contents of the HTTP Accept value, in lower case. - function Get_HttpAccept() - { - return $this->httpaccept; - } - - - //***************************** - // Start device detection - //***************************** - - //************************** - // Detects if the current device is an iPhone. - function DetectIphone() - { - if ($this->initCompleted == $this->true || - $this->isIphone == $this->true) - return $this->isIphone; - - if (stripos($this->useragent, $this->deviceIphone) > -1) - { - //The iPad and iPod Touch say they're an iPhone. So let's disambiguate. - if ($this->DetectIpad() == $this->true || - $this->DetectIpod() == $this->true) - return $this->false; - //Yay! It's an iPhone! - else - return $this->true; - } - else - return $this->false; - } - - //************************** - // Detects if the current device is an iPod Touch. - function DetectIpod() - { - if (stripos($this->useragent, $this->deviceIpod) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current device is an iPad tablet. - function DetectIpad() - { - if (stripos($this->useragent, $this->deviceIpad) > -1 && - $this->DetectWebkit() == $this->true) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current device is an iPhone or iPod Touch. - function DetectIphoneOrIpod() - { - //We repeat the searches here because some iPods may report themselves as an iPhone, which would be okay. - if ($this->DetectIphone() == $this->true || - $this->DetectIpod() == $this->true) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects *any* iOS device: iPhone, iPod Touch, iPad. - function DetectIos() - { - if (($this->DetectIphoneOrIpod() == $this->true) || - ($this->DetectIpad() == $this->true)) - return $this->true; - else - return $this->false; - } - - - //************************** - // Detects *any* Android OS-based device: phone, tablet, and multi-media player. - // Also detects Google TV. - function DetectAndroid() - { - if ($this->initCompleted == $this->true || - $this->isAndroid == $this->true) - return $this->isAndroid; - - if ((stripos($this->useragent, $this->deviceAndroid) > -1) - || ($this->DetectGoogleTV() == $this->true)) - return $this->true; - - return $this->false; - } - - //************************** - // Detects if the current device is a (small-ish) Android OS-based device - // used for calling and/or multi-media (like a Samsung Galaxy Player). - // Google says these devices will have 'Android' AND 'mobile' in user agent. - // Ignores tablets (Honeycomb and later). - function DetectAndroidPhone() - { - if ($this->initCompleted == $this->true || - $this->isAndroidPhone == $this->true) - return $this->isAndroidPhone; - - //First, let's make sure we're on an Android device. - if ($this->DetectAndroid() == $this->false) - return $this->false; - - //If it's Android and has 'mobile' in it, Google says it's a phone. - if (stripos($this->useragent, $this->mobile) > -1) - return $this->true; - - //Special check for Android devices with Opera Mobile/Mini. They should report here. - if (($this->DetectOperaMobile() == $this->true)) - return $this->true; - - return $this->false; - } - - //************************** - // Detects if the current device is a (self-reported) Android tablet. - // Google says these devices will have 'Android' and NOT 'mobile' in their user agent. - function DetectAndroidTablet() - { - //First, let's make sure we're on an Android device. - if ($this->DetectAndroid() == $this->false) - return $this->false; - - //Special check for Android devices with Opera Mobile/Mini. They should NOT report here. - if ($this->DetectOperaMobile() == $this->true) - return $this->false; - - //Otherwise, if it's Android and does NOT have 'mobile' in it, Google says it's a tablet. - if (stripos($this->useragent, $this->mobile) > -1) - return $this->false; - else - return $this->true; - } - - //************************** - // Detects if the current device is an Android OS-based device and - // the browser is based on WebKit. - function DetectAndroidWebKit() - { - if (($this->DetectAndroid() == $this->true) && - ($this->DetectWebkit() == $this->true)) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current device is a GoogleTV. - function DetectGoogleTV() - { - if (stripos($this->useragent, $this->deviceGoogleTV) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current browser is based on WebKit. - function DetectWebkit() - { - if ($this->initCompleted == $this->true || - $this->isWebkit == $this->true) - return $this->isWebkit; - - if (stripos($this->useragent, $this->engineWebKit) > -1) - return $this->true; - else - return $this->false; - } - - - //************************** - // Detects if the current browser is a - // Windows Phone 7, 8, or 10 device. - function DetectWindowsPhone() - { - if (($this->DetectWindowsPhone7() == $this->true) - || ($this->DetectWindowsPhone8() == $this->true) - || ($this->DetectWindowsPhone10() == $this->true)) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects a Windows Phone 7 device (in mobile browsing mode). - function DetectWindowsPhone7() - { - if (stripos($this->useragent, $this->deviceWinPhone7) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects a Windows Phone 8 device (in mobile browsing mode). - function DetectWindowsPhone8() - { - if (stripos($this->useragent, $this->deviceWinPhone8) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects a Windows Phone 10 device (in mobile browsing mode). - function DetectWindowsPhone10() - { - if (stripos($this->useragent, $this->deviceWinPhone10) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current browser is a Windows Mobile device. - // Excludes Windows Phone 7 and later devices. - // Focuses on Windows Mobile 6.xx and earlier. - function DetectWindowsMobile() - { - if ($this->DetectWindowsPhone() == $this->true) - return $this->false; - - //Most devices use 'Windows CE', but some report 'iemobile' - // and some older ones report as 'PIE' for Pocket IE. - if (stripos($this->useragent, $this->deviceWinMob) > -1 || - stripos($this->useragent, $this->deviceIeMob) > -1 || - stripos($this->useragent, $this->enginePie) > -1) - return $this->true; - //Test for Windows Mobile PPC but not old Macintosh PowerPC. - if (stripos($this->useragent, $this->devicePpc) > -1 - && !(stripos($this->useragent, $this->deviceMacPpc) > 1)) - return $this->true; - //Test for certain Windwos Mobile-based HTC devices. - if (stripos($this->useragent, $this->manuHtc) > -1 && - stripos($this->useragent, $this->deviceWindows) > -1) - return $this->true; - if ($this->DetectWapWml() == $this->true && - stripos($this->useragent, $this->deviceWindows) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current browser is any BlackBerry device. - // Includes BB10 OS, but excludes the PlayBook. - function DetectBlackBerry() - { - if ((stripos($this->useragent, $this->deviceBB) > -1) || - (stripos($this->httpaccept, $this->vndRIM) > -1)) - return $this->true; - if ($this->DetectBlackBerry10Phone() == $this->true) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current browser is a BlackBerry 10 OS phone. - // Excludes tablets. - function DetectBlackBerry10Phone() - { - if ((stripos($this->useragent, $this->deviceBB10) > -1) && - (stripos($this->useragent, $this->mobile) > -1)) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current browser is on a BlackBerry tablet device. - // Examples: PlayBook - function DetectBlackBerryTablet() - { - if ((stripos($this->useragent, $this->deviceBBPlaybook) > -1)) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current browser is a BlackBerry phone device AND uses a - // WebKit-based browser. These are signatures for the new BlackBerry OS 6. - // Examples: Torch. Includes the Playbook. - function DetectBlackBerryWebKit() - { - if (($this->DetectBlackBerry() == $this->true) && - ($this->DetectWebkit() == $this->true)) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current browser is a BlackBerry Touch phone device with - // a large screen, such as the Storm, Torch, and Bold Touch. Excludes the Playbook. - function DetectBlackBerryTouch() - { - if ((stripos($this->useragent, $this->deviceBBStorm) > -1) || - (stripos($this->useragent, $this->deviceBBTorch) > -1) || - (stripos($this->useragent, $this->deviceBBBoldTouch) > -1) || - (stripos($this->useragent, $this->deviceBBCurveTouch) > -1)) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current browser is a BlackBerry OS 5 device AND - // has a more capable recent browser. Excludes the Playbook. - // Examples, Storm, Bold, Tour, Curve2 - // Excludes the new BlackBerry OS 6 and 7 browser!! - function DetectBlackBerryHigh() - { - //Disambiguate for BlackBerry OS 6 or 7 (WebKit) browser - if ($this->DetectBlackBerryWebKit() == $this->true) - return $this->false; - if ($this->DetectBlackBerry() == $this->true) - { - if (($this->DetectBlackBerryTouch() == $this->true) || - stripos($this->useragent, $this->deviceBBBold) > -1 || - stripos($this->useragent, $this->deviceBBTour) > -1 || - stripos($this->useragent, $this->deviceBBCurve) > -1) - { - return $this->true; - } - else - return $this->false; - } - else - return $this->false; - } - - //************************** - // Detects if the current browser is a BlackBerry device AND - // has an older, less capable browser. - // Examples: Pearl, 8800, Curve1. - function DetectBlackBerryLow() - { - if ($this->DetectBlackBerry() == $this->true) - { - //Assume that if it's not in the High tier, then it's Low. - if (($this->DetectBlackBerryHigh() == $this->true) || - ($this->DetectBlackBerryWebKit() == $this->true)) - return $this->false; - else - return $this->true; - } - else - return $this->false; - } - - - //************************** - // Detects if the current browser is the Nokia S60 Open Source Browser. - function DetectS60OssBrowser() - { - //First, test for WebKit, then make sure it's either Symbian or S60. - if ($this->DetectWebkit() == $this->true) - { - if (stripos($this->useragent, $this->deviceSymbian) > -1 || - stripos($this->useragent, $this->deviceS60) > -1) - { - return $this->true; - } - else - return $this->false; - } - else - return $this->false; - } - - //************************** - // Detects if the current device is any Symbian OS-based device, - // including older S60, Series 70, Series 80, Series 90, and UIQ, - // or other browsers running on these devices. - function DetectSymbianOS() - { - if (stripos($this->useragent, $this->deviceSymbian) > -1 || - stripos($this->useragent, $this->deviceS60) > -1 || - stripos($this->useragent, $this->deviceS70) > -1 || - stripos($this->useragent, $this->deviceS80) > -1 || - stripos($this->useragent, $this->deviceS90) > -1) - return $this->true; - else - return $this->false; - } - - - //************************** - // Detects if the current browser is on a PalmOS device. - function DetectPalmOS() - { - //Most devices nowadays report as 'Palm', but some older ones reported as Blazer or Xiino. - if (stripos($this->useragent, $this->devicePalm) > -1 || - stripos($this->useragent, $this->engineBlazer) > -1 || - stripos($this->useragent, $this->engineXiino) > -1) - { - //Make sure it's not WebOS first - if ($this->DetectPalmWebOS() == $this->true) - return $this->false; - else - return $this->true; - } - else - return $this->false; - } - - - //************************** - // Detects if the current browser is on a Palm device - // running the new WebOS. - function DetectPalmWebOS() - { - if (stripos($this->useragent, $this->deviceWebOS) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current browser is on an HP tablet running WebOS. - function DetectWebOSTablet() - { - if ((stripos($this->useragent, $this->deviceWebOShp) > -1) - && (stripos($this->useragent, $this->deviceTablet) > -1)) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current browser is on a WebOS smart TV. - function DetectWebOSTV() - { - if ((stripos($this->useragent, $this->deviceWebOStv) > -1) - && (stripos($this->useragent, $this->smartTV2) > -1)) - return $this->true; - else - return $this->false; - } - - - //************************** - // Detects if the current browser is Opera Mobile or Mini. - function DetectOperaMobile() - { - if ((stripos($this->useragent, $this->engineOpera) > -1) && - ((stripos($this->useragent, $this->mini) > -1) || - (stripos($this->useragent, $this->mobi) > -1))) - return $this->true; - - return $this->false; - } - - //************************** - // Detects if the current device is an Amazon Kindle (eInk devices only). - // Note: For the Kindle Fire, use the normal Android methods. - function DetectKindle() - { - if (stripos($this->useragent, $this->deviceKindle) > -1 && - $this->DetectAndroid() == $this->false) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current Amazon device has turned on the Silk accelerated browsing feature. - // Note: Typically used by the the Kindle Fire. - function DetectAmazonSilk() - { - if (stripos($this->useragent, $this->engineSilk) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if a Garmin Nuvifone device. - function DetectGarminNuvifone() - { - if (stripos($this->useragent, $this->deviceNuvifone) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects a device running the Bada OS from Samsung. - function DetectBada() - { - if (stripos($this->useragent, $this->deviceBada) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects a device running the Tizen smartphone OS. - function DetectTizen() - { - if ((stripos($this->useragent, $this->deviceTizen) > -1) - && (stripos($this->useragent, $this->mobile) > -1)) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current browser is on a Tizen smart TV. - function DetectTizenTV() - { - if ((stripos($this->useragent, $this->deviceTizen) > -1) - && (stripos($this->useragent, $this->smartTV1) > -1)) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects a device running the Meego OS. - function DetectMeego() - { - if (stripos($this->useragent, $this->deviceMeego) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects a phone running the Meego OS. - function DetectMeegoPhone() - { - if ((stripos($this->useragent, $this->deviceMeego) > -1) - && (stripos($this->useragent, $this->mobi) > -1)) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects a mobile device (probably) running the Firefox OS. - function DetectFirefoxOS() - { - if (($this->DetectFirefoxOSPhone() == $this->true) - || ($this->DetectFirefoxOSTablet() == $this->true)) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects a phone (probably) running the Firefox OS. - function DetectFirefoxOSPhone() - { - //First, let's make sure we're NOT on another major mobile OS. - if ($this->DetectIos() == $this->true - || $this->DetectAndroid() == $this->true - || $this->DetectSailfish() == $this->true) - return $this->false; - - if ((stripos($this->useragent, $this->engineFirefox) > -1) && - (stripos($this->useragent, $this->mobile) > -1)) - return $this->true; - - return $this->false; - } - - //************************** - // Detects a tablet (probably) running the Firefox OS. - function DetectFirefoxOSTablet() - { - //First, let's make sure we're NOT on another major mobile OS. - if ($this->DetectIos() == $this->true - || $this->DetectAndroid() == $this->true - || $this->DetectSailfish() == $this->true) - return $this->false; - - if ((stripos($this->useragent, $this->engineFirefox) > -1) && - (stripos($this->useragent, $this->deviceTablet) > -1)) - return $this->true; - - return $this->false; - } - - //************************** - // Detects a device running the Sailfish OS. - function DetectSailfish() - { - if (stripos($this->useragent, $this->deviceSailfish) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects a phone running the Sailfish OS. - function DetectSailfishPhone() - { - if (($this->DetectSailfish() == $this->true) && - (stripos($this->useragent, $this->mobile) > -1)) - return $this->true; - - return $this->false; - } - - //************************** - // Detects a mobile device running the Ubuntu Mobile OS. - function DetectUbuntu() - { - if (($this->DetectUbuntuPhone() == $this->true) - || ($this->DetectUbuntuTablet() == $this->true)) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects a phone running the Ubuntu Mobile OS. - function DetectUbuntuPhone() - { - if ((stripos($this->useragent, $this->deviceUbuntu) > -1) && - (stripos($this->useragent, $this->mobile) > -1)) - return $this->true; - - return $this->false; - } - - //************************** - // Detects a tablet running the Ubuntu Mobile OS. - function DetectUbuntuTablet() - { - if ((stripos($this->useragent, $this->deviceUbuntu) > -1) && - (stripos($this->useragent, $this->deviceTablet) > -1)) - return $this->true; - - return $this->false; - } - - //************************** - // Detects the Danger Hiptop device. - function DetectDangerHiptop() - { - if (stripos($this->useragent, $this->deviceDanger) > -1 || - stripos($this->useragent, $this->deviceHiptop) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current browser is a Sony Mylo device. - function DetectSonyMylo() - { - if ((stripos($this->useragent, $this->manuSony) > -1) && - ((stripos($this->useragent, $this->qtembedded) > -1) || - (stripos($this->useragent, $this->mylocom2) > -1))) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current device is on one of the Maemo-based Nokia Internet Tablets. - function DetectMaemoTablet() - { - if (stripos($this->useragent, $this->maemo) > -1) - return $this->true; - //For Nokia N810, must be Linux + Tablet, or else it could be something else. - if ((stripos($this->useragent, $this->linux) > -1) - && (stripos($this->useragent, $this->deviceTablet) > -1) - && ($this->DetectWebOSTablet() == $this->false) - && ($this->DetectAndroid() == $this->false)) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current device is an Archos media player/Internet tablet. - function DetectArchos() - { - if (stripos($this->useragent, $this->deviceArchos) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current device is an Internet-capable game console. - // Includes many handheld consoles. - function DetectGameConsole() - { - if ($this->DetectSonyPlaystation() == $this->true) - return $this->true; - else if ($this->DetectNintendo() == $this->true) - return $this->true; - else if ($this->DetectXbox() == $this->true) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current device is a Sony Playstation. - function DetectSonyPlaystation() - { - if (stripos($this->useragent, $this->devicePlaystation) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current device is a handheld gaming device with - // a touchscreen and modern iPhone-class browser. Includes the Playstation Vita. - function DetectGamingHandheld() - { - if ((stripos($this->useragent, $this->devicePlaystation) > -1) && - (stripos($this->useragent, $this->devicePlaystationVita) > -1)) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current device is a Nintendo game device. - function DetectNintendo() - { - if (stripos($this->useragent, $this->deviceNintendo) > -1 || - stripos($this->useragent, $this->deviceWii) > -1 || - stripos($this->useragent, $this->deviceNintendoDs) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current device is a Microsoft Xbox. - function DetectXbox() - { - if (stripos($this->useragent, $this->deviceXbox) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects whether the device is a Brew-powered device. - function DetectBrewDevice() - { - if (stripos($this->useragent, $this->deviceBrew) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects whether the device supports WAP or WML. - function DetectWapWml() - { - if (stripos($this->httpaccept, $this->vndwap) > -1 || - stripos($this->httpaccept, $this->wml) > -1) - return $this->true; - else - return $this->false; - } - - //************************** - // Detects if the current device supports MIDP, a mobile Java technology. - function DetectMidpCapable() - { - if (stripos($this->useragent, $this->deviceMidp) > -1 || - stripos($this->httpaccept, $this->deviceMidp) > -1) - return $this->true; - else - return $this->false; - } - - - - //***************************** - // Device Classes - //***************************** - - //************************** - // Check to see whether the device is *any* 'smartphone'. - // Note: It's better to use DetectTierIphone() for modern touchscreen devices. - function DetectSmartphone() - { - //Exclude duplicates from TierIphone - if (($this->DetectTierIphone() == $this->true) - || ($this->DetectS60OssBrowser() == $this->true) - || ($this->DetectSymbianOS() == $this->true) - || ($this->DetectWindowsMobile() == $this->true) - || ($this->DetectBlackBerry() == $this->true) - || ($this->DetectMeegoPhone() == $this->true) - || ($this->DetectPalmWebOS() == $this->true)) - return $this->true; - else - return $this->false; - } - - //************************** - // The quick way to detect for a mobile device. - // Will probably detect most recent/current mid-tier Feature Phones - // as well as smartphone-class devices. Excludes Apple iPads and other modern tablets. - function DetectMobileQuick() - { - if ($this->initCompleted == $this->true || - $this->isMobilePhone == $this->true) - return $this->isMobilePhone; - - //Let's exclude tablets - if ($this->isTierTablet == $this->true) - return $this->false; - - //Most mobile browsing is done on smartphones - if ($this->DetectSmartphone() == $this->true) - return $this->true; - - //Catch-all for many mobile devices - if (stripos($this->useragent, $this->mobile) > -1) - return $this->true; - - if ($this->DetectOperaMobile() == $this->true) - return $this->true; - - //We also look for Kindle devices - if ($this->DetectKindle() == $this->true || - $this->DetectAmazonSilk() == $this->true) - return $this->true; - - if (($this->DetectWapWml() == $this->true) - || ($this->DetectMidpCapable() == $this->true) - || ($this->DetectBrewDevice() == $this->true)) - return $this->true; - - if ((stripos($this->useragent, $this->engineNetfront) > -1) - || (stripos($this->useragent, $this->engineUpBrowser) > -1)) - return $this->true; - - return $this->false; - } - - //************************** - // The longer and more thorough way to detect for a mobile device. - // Will probably detect most feature phones, - // smartphone-class devices, Internet Tablets, - // Internet-enabled game consoles, etc. - // This ought to catch a lot of the more obscure and older devices, also -- - // but no promises on thoroughness! - function DetectMobileLong() - { - if ($this->DetectMobileQuick() == $this->true) - return $this->true; - if ($this->DetectGameConsole() == $this->true) - return $this->true; - - if (($this->DetectDangerHiptop() == $this->true) - || ($this->DetectMaemoTablet() == $this->true) - || ($this->DetectSonyMylo() == $this->true) - || ($this->DetectArchos() == $this->true)) - return $this->true; - - if ((stripos($this->useragent, $this->devicePda) > -1) && - !(stripos($this->useragent, $this->disUpdate) > -1)) - return $this->true; - - //Detect older phones from certain manufacturers and operators. - if ((stripos($this->useragent, $this->uplink) > -1) - || (stripos($this->useragent, $this->engineOpenWeb) > -1) - || (stripos($this->useragent, $this->manuSamsung1) > -1) - || (stripos($this->useragent, $this->manuSonyEricsson) > -1) - || (stripos($this->useragent, $this->manuericsson) > -1) - || (stripos($this->useragent, $this->svcDocomo) > -1) - || (stripos($this->useragent, $this->svcKddi) > -1) - || (stripos($this->useragent, $this->svcVodafone) > -1)) - return $this->true; - - return $this->false; - } - - - //***************************** - // For Mobile Web Site Design - //***************************** - - //************************** - // The quick way to detect for a tier of devices. - // This method detects for the new generation of - // HTML 5 capable, larger screen tablets. - // Includes iPad, Android (e.g., Xoom), BB Playbook, WebOS, etc. - function DetectTierTablet() - { - if ($this->initCompleted == $this->true || - $this->isTierTablet == $this->true) - return $this->isTierTablet; - - if (($this->DetectIpad() == $this->true) - || ($this->DetectAndroidTablet() == $this->true) - || ($this->DetectBlackBerryTablet() == $this->true) - || ($this->DetectFirefoxOSTablet() == $this->true) - || ($this->DetectUbuntuTablet() == $this->true) - || ($this->DetectWebOSTablet() == $this->true)) - return $this->true; - else - return $this->false; - } - - - //************************** - // The quick way to detect for a tier of devices. - // This method detects for devices which can - // display iPhone-optimized web content. - // Includes iPhone, iPod Touch, Android, Windows Phone, BB10, Playstation Vita, etc. - function DetectTierIphone() - { - if ($this->initCompleted == $this->true || - $this->isTierIphone == $this->true) - return $this->isTierIphone; - - if (($this->DetectIphoneOrIpod() == $this->true) - || ($this->DetectAndroidPhone() == $this->true) - || ($this->DetectWindowsPhone() == $this->true) - || ($this->DetectBlackBerry10Phone() == $this->true) - || ($this->DetectPalmWebOS() == $this->true) - || ($this->DetectBada() == $this->true) - || ($this->DetectTizen() == $this->true) - || ($this->DetectFirefoxOSPhone() == $this->true) - || ($this->DetectSailfishPhone() == $this->true) - || ($this->DetectUbuntuPhone() == $this->true) - || ($this->DetectGamingHandheld() == $this->true)) - return $this->true; - - //Note: BB10 phone is in the previous paragraph - if (($this->DetectBlackBerryWebKit() == $this->true) && - ($this->DetectBlackBerryTouch() == $this->true)) - return $this->true; - - else - return $this->false; - } - - //************************** - // The quick way to detect for a tier of devices. - // This method detects for devices which are likely to be capable - // of viewing CSS content optimized for the iPhone, - // but may not necessarily support JavaScript. - // Excludes all iPhone Tier devices. - function DetectTierRichCss() - { - if ($this->initCompleted == $this->true || - $this->isTierRichCss == $this->true) - return $this->isTierRichCss; - - if ($this->DetectMobileQuick() == $this->true) - { - //Exclude iPhone Tier and e-Ink Kindle devices - if (($this->DetectTierIphone() == $this->true) || - ($this->DetectKindle() == $this->true)) - return $this->false; - - //The following devices are explicitly ok. - if ($this->DetectWebkit() == $this->true) //Any WebKit - return $this->true; - if ($this->DetectS60OssBrowser() == $this->true) - return $this->true; - - //Note: 'High' BlackBerry devices ONLY - if ($this->DetectBlackBerryHigh() == $this->true) - return $this->true; - - //Older Windows 'Mobile' isn't good enough for iPhone Tier. - if ($this->DetectWindowsMobile() == $this->true) - return $this->true; - if (stripos($this->useragent, $this->engineTelecaQ) > -1) - return $this->true; - - //default - else - return $this->false; - } - else - return $this->false; - } - - //************************** - // The quick way to detect for a tier of devices. - // This method detects for all other types of phones, - // but excludes the iPhone and RichCSS Tier devices. - function DetectTierOtherPhones() - { - if ($this->initCompleted == $this->true || - $this->isTierGenericMobile == $this->true) - return $this->isTierGenericMobile; - - //Exclude devices in the other 2 categories - if (($this->DetectMobileLong() == $this->true) - && ($this->DetectTierIphone() == $this->false) - && ($this->DetectTierRichCss() == $this->false)) - return $this->true; - else - return $this->false; - } - - -} - - -//Was informed by a MobileESP user that it's a best practice -// to omit the closing ?> marks here. They can sometimes -// cause errors with HTML headers. \ No newline at end of file diff --git a/vendor/symfony/css-selector/CHANGELOG.md b/vendor/symfony/css-selector/CHANGELOG.md index be10abee924cefbb9c75643bf588a292ba051cb7..4061ff20c3d2ac1d5ad0cc1297dec2144cfb8060 100644 --- a/vendor/symfony/css-selector/CHANGELOG.md +++ b/vendor/symfony/css-selector/CHANGELOG.md @@ -1,6 +1,12 @@ CHANGELOG ========= +2.8.0 +----- + + * Added the `CssSelectorConverter` class as a non-static API for the component. + * Deprecated the `CssSelector` static API of the component. + 2.1.0 ----- diff --git a/vendor/symfony/css-selector/CssSelector.php b/vendor/symfony/css-selector/CssSelector.php index 579700a61c600f31050b3783043b56ddf9a56d2e..6900c6493d9b938d1411a1ddbdc2de43e58d0acb 100644 --- a/vendor/symfony/css-selector/CssSelector.php +++ b/vendor/symfony/css-selector/CssSelector.php @@ -11,12 +11,7 @@ namespace Symfony\Component\CssSelector; -use Symfony\Component\CssSelector\Parser\Shortcut\ClassParser; -use Symfony\Component\CssSelector\Parser\Shortcut\ElementParser; -use Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser; -use Symfony\Component\CssSelector\Parser\Shortcut\HashParser; -use Symfony\Component\CssSelector\XPath\Extension\HtmlExtension; -use Symfony\Component\CssSelector\XPath\Translator; +@trigger_error('The '.__NAMESPACE__.'\CssSelector class is deprecated since version 2.8 and will be removed in 3.0. Use directly the \Symfony\Component\CssSelector\CssSelectorConverter class instead.', E_USER_DEPRECATED); /** * CssSelector is the main entry point of the component and can convert CSS @@ -61,6 +56,8 @@ use Symfony\Component\CssSelector\XPath\Translator; * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * @author Fabien Potencier <fabien@symfony.com> + * + * @deprecated as of 2.8, will be removed in 3.0. Use the \Symfony\Component\CssSelector\CssSelectorConverter class instead. */ class CssSelector { @@ -78,20 +75,9 @@ class CssSelector */ public static function toXPath($cssExpr, $prefix = 'descendant-or-self::') { - $translator = new Translator(); - - if (self::$html) { - $translator->registerExtension(new HtmlExtension($translator)); - } - - $translator - ->registerParserShortcut(new EmptyStringParser()) - ->registerParserShortcut(new ElementParser()) - ->registerParserShortcut(new ClassParser()) - ->registerParserShortcut(new HashParser()) - ; + $converter = new CssSelectorConverter(self::$html); - return $translator->cssToXPath($cssExpr, $prefix); + return $converter->toXPath($cssExpr, $prefix); } /** diff --git a/vendor/symfony/css-selector/CssSelectorConverter.php b/vendor/symfony/css-selector/CssSelectorConverter.php new file mode 100644 index 0000000000000000000000000000000000000000..e31ac1917afbac725234ef9a627731e8b2b40683 --- /dev/null +++ b/vendor/symfony/css-selector/CssSelectorConverter.php @@ -0,0 +1,65 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\CssSelector; + +use Symfony\Component\CssSelector\Parser\Shortcut\ClassParser; +use Symfony\Component\CssSelector\Parser\Shortcut\ElementParser; +use Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser; +use Symfony\Component\CssSelector\Parser\Shortcut\HashParser; +use Symfony\Component\CssSelector\XPath\Extension\HtmlExtension; +use Symfony\Component\CssSelector\XPath\Translator; + +/** + * CssSelectorConverter is the main entry point of the component and can convert CSS + * selectors to XPath expressions. + * + * @author Christophe Coevoet <stof@notk.org> + */ +class CssSelectorConverter +{ + private $translator; + + /** + * @param bool $html Whether HTML support should be enabled. Disable it for XML documents. + */ + public function __construct($html = true) + { + $this->translator = new Translator(); + + if ($html) { + $this->translator->registerExtension(new HtmlExtension($this->translator)); + } + + $this->translator + ->registerParserShortcut(new EmptyStringParser()) + ->registerParserShortcut(new ElementParser()) + ->registerParserShortcut(new ClassParser()) + ->registerParserShortcut(new HashParser()) + ; + } + + /** + * Translates a CSS expression to its XPath equivalent. + * + * Optionally, a prefix can be added to the resulting XPath + * expression with the $prefix parameter. + * + * @param string $cssExpr The CSS expression. + * @param string $prefix An optional prefix for the XPath expression. + * + * @return string + */ + public function toXPath($cssExpr, $prefix = 'descendant-or-self::') + { + return $this->translator->cssToXPath($cssExpr, $prefix); + } +} diff --git a/vendor/symfony/css-selector/Node/AbstractNode.php b/vendor/symfony/css-selector/Node/AbstractNode.php index b1c8e9508d9b914cda6db369b2b5d04ea6fe7943..7477e9119df32b0ec0e7f81625e54473bab8a41f 100644 --- a/vendor/symfony/css-selector/Node/AbstractNode.php +++ b/vendor/symfony/css-selector/Node/AbstractNode.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\Node; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ abstract class AbstractNode implements NodeInterface { diff --git a/vendor/symfony/css-selector/Node/AttributeNode.php b/vendor/symfony/css-selector/Node/AttributeNode.php index b10a4dd5b341faa748f9637d302ea4d66f23cf7c..af872b79e9f2d25286a40a4f84ccab16d3c245d8 100644 --- a/vendor/symfony/css-selector/Node/AttributeNode.php +++ b/vendor/symfony/css-selector/Node/AttributeNode.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\Node; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class AttributeNode extends AbstractNode { diff --git a/vendor/symfony/css-selector/Node/ClassNode.php b/vendor/symfony/css-selector/Node/ClassNode.php index 544342f871f67f7fe952f0871ed7c2879b00fe7c..f965e7773e89a534037407088d865984c7bc2cab 100644 --- a/vendor/symfony/css-selector/Node/ClassNode.php +++ b/vendor/symfony/css-selector/Node/ClassNode.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\Node; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class ClassNode extends AbstractNode { diff --git a/vendor/symfony/css-selector/Node/CombinedSelectorNode.php b/vendor/symfony/css-selector/Node/CombinedSelectorNode.php index 6d00db431c5b560b2c22b31384ef4bd3731cc424..39f659977779c5ac817d9d6442fbfadb13c3b3e3 100644 --- a/vendor/symfony/css-selector/Node/CombinedSelectorNode.php +++ b/vendor/symfony/css-selector/Node/CombinedSelectorNode.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\Node; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class CombinedSelectorNode extends AbstractNode { diff --git a/vendor/symfony/css-selector/Node/ElementNode.php b/vendor/symfony/css-selector/Node/ElementNode.php index 71ef121741eb109ea0b2d6a906ade1fdfe90aee0..06e343e969c117b2360c0b46936967d7287d5531 100644 --- a/vendor/symfony/css-selector/Node/ElementNode.php +++ b/vendor/symfony/css-selector/Node/ElementNode.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\Node; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class ElementNode extends AbstractNode { diff --git a/vendor/symfony/css-selector/Node/FunctionNode.php b/vendor/symfony/css-selector/Node/FunctionNode.php index f94af8dafce56c906967170d17316427b85c7a5e..612f348c5e419ceb1ff024e012f830c40310fa0a 100644 --- a/vendor/symfony/css-selector/Node/FunctionNode.php +++ b/vendor/symfony/css-selector/Node/FunctionNode.php @@ -20,6 +20,8 @@ use Symfony\Component\CssSelector\Parser\Token; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class FunctionNode extends AbstractNode { diff --git a/vendor/symfony/css-selector/Node/HashNode.php b/vendor/symfony/css-selector/Node/HashNode.php index ddbe76477adc5b8f261ddc948099222f9eacdb02..20db46516280610384a6091e3f73caa1429eb58b 100644 --- a/vendor/symfony/css-selector/Node/HashNode.php +++ b/vendor/symfony/css-selector/Node/HashNode.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\Node; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class HashNode extends AbstractNode { diff --git a/vendor/symfony/css-selector/Node/NegationNode.php b/vendor/symfony/css-selector/Node/NegationNode.php index 0fafb0a120bc7156fe76995c80d2c54ef0b56b2c..4b5aa2260d005d6249b9b3ee598172510a336bd8 100644 --- a/vendor/symfony/css-selector/Node/NegationNode.php +++ b/vendor/symfony/css-selector/Node/NegationNode.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\Node; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class NegationNode extends AbstractNode { diff --git a/vendor/symfony/css-selector/Node/NodeInterface.php b/vendor/symfony/css-selector/Node/NodeInterface.php index dd300e23cded0a1c5c63e9f96a75e1ed860d052e..d919e20c7107af85f35e386bafe11fd033b06e92 100644 --- a/vendor/symfony/css-selector/Node/NodeInterface.php +++ b/vendor/symfony/css-selector/Node/NodeInterface.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\Node; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ interface NodeInterface { diff --git a/vendor/symfony/css-selector/Node/PseudoNode.php b/vendor/symfony/css-selector/Node/PseudoNode.php index 0e413adc5488da85ff7ce1432b388888e4003c8a..c23ddd5912a6685cbf0b12d96d9ee0a9382709b7 100644 --- a/vendor/symfony/css-selector/Node/PseudoNode.php +++ b/vendor/symfony/css-selector/Node/PseudoNode.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\Node; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class PseudoNode extends AbstractNode { diff --git a/vendor/symfony/css-selector/Node/SelectorNode.php b/vendor/symfony/css-selector/Node/SelectorNode.php index 4958da55afaf7a3124e5c7a9727dc5d3a0ae6ee2..729e0911b3c76d6e331af21272ec240b5f8d3917 100644 --- a/vendor/symfony/css-selector/Node/SelectorNode.php +++ b/vendor/symfony/css-selector/Node/SelectorNode.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\Node; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class SelectorNode extends AbstractNode { diff --git a/vendor/symfony/css-selector/Node/Specificity.php b/vendor/symfony/css-selector/Node/Specificity.php index 0ce0c3f3049ddf2253eb06eb35bfcc54e99d1eb8..a24b4fdf8403b98fc4d99fe27558896ac75b661c 100644 --- a/vendor/symfony/css-selector/Node/Specificity.php +++ b/vendor/symfony/css-selector/Node/Specificity.php @@ -20,6 +20,8 @@ namespace Symfony\Component\CssSelector\Node; * @see http://www.w3.org/TR/selectors/#specificity * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class Specificity { diff --git a/vendor/symfony/css-selector/Parser/Handler/CommentHandler.php b/vendor/symfony/css-selector/Parser/Handler/CommentHandler.php index f480776d2c446d4b5fdd3aedc345a73e6e025828..a29775cab370f46f7fa2594c64181b8f33d501a0 100644 --- a/vendor/symfony/css-selector/Parser/Handler/CommentHandler.php +++ b/vendor/symfony/css-selector/Parser/Handler/CommentHandler.php @@ -21,6 +21,8 @@ use Symfony\Component\CssSelector\Parser\TokenStream; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class CommentHandler implements HandlerInterface { diff --git a/vendor/symfony/css-selector/Parser/Handler/HandlerInterface.php b/vendor/symfony/css-selector/Parser/Handler/HandlerInterface.php index 049ddd3ec4ca7735c604629e7bc7eab8238efc0c..a1297c80c089b8572346b3259b64b980b45d3944 100644 --- a/vendor/symfony/css-selector/Parser/Handler/HandlerInterface.php +++ b/vendor/symfony/css-selector/Parser/Handler/HandlerInterface.php @@ -21,6 +21,8 @@ use Symfony\Component\CssSelector\Parser\TokenStream; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ interface HandlerInterface { diff --git a/vendor/symfony/css-selector/Parser/Handler/HashHandler.php b/vendor/symfony/css-selector/Parser/Handler/HashHandler.php index b144223fbd6fe3aa5c40708dafa5c4d348108af9..f74bda51262ac8e78f1b3ad673c2b438e10ff00d 100644 --- a/vendor/symfony/css-selector/Parser/Handler/HashHandler.php +++ b/vendor/symfony/css-selector/Parser/Handler/HashHandler.php @@ -24,6 +24,8 @@ use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class HashHandler implements HandlerInterface { diff --git a/vendor/symfony/css-selector/Parser/Handler/IdentifierHandler.php b/vendor/symfony/css-selector/Parser/Handler/IdentifierHandler.php index 86739eab99acab0870a52a55eb37f8630056f803..358c7c14ad28adedb7dddde1476e8a396885b6f1 100644 --- a/vendor/symfony/css-selector/Parser/Handler/IdentifierHandler.php +++ b/vendor/symfony/css-selector/Parser/Handler/IdentifierHandler.php @@ -24,6 +24,8 @@ use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class IdentifierHandler implements HandlerInterface { diff --git a/vendor/symfony/css-selector/Parser/Handler/NumberHandler.php b/vendor/symfony/css-selector/Parser/Handler/NumberHandler.php index 97a9387b18532cf45e1ae70777d25ee2e23106f5..4ea5c484b26fb5cbd3202579282d998fe246df7a 100644 --- a/vendor/symfony/css-selector/Parser/Handler/NumberHandler.php +++ b/vendor/symfony/css-selector/Parser/Handler/NumberHandler.php @@ -23,6 +23,8 @@ use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class NumberHandler implements HandlerInterface { diff --git a/vendor/symfony/css-selector/Parser/Handler/StringHandler.php b/vendor/symfony/css-selector/Parser/Handler/StringHandler.php index 9f7a5946b02b17a251663cea3d56bc1f2b214a55..420529601609d0d1da608175f31bb25242472d03 100644 --- a/vendor/symfony/css-selector/Parser/Handler/StringHandler.php +++ b/vendor/symfony/css-selector/Parser/Handler/StringHandler.php @@ -26,6 +26,8 @@ use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class StringHandler implements HandlerInterface { diff --git a/vendor/symfony/css-selector/Parser/Handler/WhitespaceHandler.php b/vendor/symfony/css-selector/Parser/Handler/WhitespaceHandler.php index 234bbd84cf668f5529dc6e64dc036ca66540b41c..4c2d3354fb83e9d6cb77129cb4799692b65cec32 100644 --- a/vendor/symfony/css-selector/Parser/Handler/WhitespaceHandler.php +++ b/vendor/symfony/css-selector/Parser/Handler/WhitespaceHandler.php @@ -22,6 +22,8 @@ use Symfony\Component\CssSelector\Parser\TokenStream; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class WhitespaceHandler implements HandlerInterface { diff --git a/vendor/symfony/css-selector/Parser/Parser.php b/vendor/symfony/css-selector/Parser/Parser.php index 9625e3e8a1100432c87ce6b876eef9e639ae27d1..f94aea36a60429671ba65b002b68473b6f668e46 100644 --- a/vendor/symfony/css-selector/Parser/Parser.php +++ b/vendor/symfony/css-selector/Parser/Parser.php @@ -22,6 +22,8 @@ use Symfony\Component\CssSelector\Parser\Tokenizer\Tokenizer; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class Parser implements ParserInterface { diff --git a/vendor/symfony/css-selector/Parser/ParserInterface.php b/vendor/symfony/css-selector/Parser/ParserInterface.php index 3b43a52fde524312a10cf8cfb25c88777f43818f..c5af20367de8c889060c9eb952c3931311c2bf42 100644 --- a/vendor/symfony/css-selector/Parser/ParserInterface.php +++ b/vendor/symfony/css-selector/Parser/ParserInterface.php @@ -20,6 +20,8 @@ use Symfony\Component\CssSelector\Node\SelectorNode; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ interface ParserInterface { diff --git a/vendor/symfony/css-selector/Parser/Reader.php b/vendor/symfony/css-selector/Parser/Reader.php index ba2a7f0da95886d9251a4660ce22ed917e60e4e9..41136367d8600889d24948dd5d1f4f55430e6044 100644 --- a/vendor/symfony/css-selector/Parser/Reader.php +++ b/vendor/symfony/css-selector/Parser/Reader.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\Parser; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class Reader { diff --git a/vendor/symfony/css-selector/Parser/Shortcut/ClassParser.php b/vendor/symfony/css-selector/Parser/Shortcut/ClassParser.php index 83f8d13d9ccf22075df0e985487eab2bd51cb165..c513de5ff12ee68da5e992656be44a341a1b5b9e 100644 --- a/vendor/symfony/css-selector/Parser/Shortcut/ClassParser.php +++ b/vendor/symfony/css-selector/Parser/Shortcut/ClassParser.php @@ -23,6 +23,8 @@ use Symfony\Component\CssSelector\Parser\ParserInterface; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class ClassParser implements ParserInterface { diff --git a/vendor/symfony/css-selector/Parser/Shortcut/ElementParser.php b/vendor/symfony/css-selector/Parser/Shortcut/ElementParser.php index 00e443553b4858eb008db8e53d86539f3fd435ea..c29f5e442e739960d88c0757bf1131c18cf8596c 100644 --- a/vendor/symfony/css-selector/Parser/Shortcut/ElementParser.php +++ b/vendor/symfony/css-selector/Parser/Shortcut/ElementParser.php @@ -22,6 +22,8 @@ use Symfony\Component\CssSelector\Parser\ParserInterface; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class ElementParser implements ParserInterface { diff --git a/vendor/symfony/css-selector/Parser/Shortcut/EmptyStringParser.php b/vendor/symfony/css-selector/Parser/Shortcut/EmptyStringParser.php index 98a08fde069ea82fa7dd647f497773df65d7279d..016cf0a848207d107c5fee3082fa8991eb8b19b5 100644 --- a/vendor/symfony/css-selector/Parser/Shortcut/EmptyStringParser.php +++ b/vendor/symfony/css-selector/Parser/Shortcut/EmptyStringParser.php @@ -26,6 +26,8 @@ use Symfony\Component\CssSelector\Parser\ParserInterface; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class EmptyStringParser implements ParserInterface { diff --git a/vendor/symfony/css-selector/Parser/Shortcut/HashParser.php b/vendor/symfony/css-selector/Parser/Shortcut/HashParser.php index 3dbad79d5b471c8da42716529914f3bdceea2501..3f3883bb8d2e91af8cbc3a5a79dfb387dc1d2259 100644 --- a/vendor/symfony/css-selector/Parser/Shortcut/HashParser.php +++ b/vendor/symfony/css-selector/Parser/Shortcut/HashParser.php @@ -23,6 +23,8 @@ use Symfony\Component\CssSelector\Parser\ParserInterface; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class HashParser implements ParserInterface { diff --git a/vendor/symfony/css-selector/Parser/Token.php b/vendor/symfony/css-selector/Parser/Token.php index 6f7586f612ed2568efd17cb66cfc0b8bcb0b1c93..68fac59b03a32bb4f70b0ce17515fdaaa42f3418 100644 --- a/vendor/symfony/css-selector/Parser/Token.php +++ b/vendor/symfony/css-selector/Parser/Token.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\Parser; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class Token { diff --git a/vendor/symfony/css-selector/Parser/TokenStream.php b/vendor/symfony/css-selector/Parser/TokenStream.php index c0525d7a833642e279016d779d12c2ba4dc9a32f..1ec727febfe0f7e6121c4781512151d458758151 100644 --- a/vendor/symfony/css-selector/Parser/TokenStream.php +++ b/vendor/symfony/css-selector/Parser/TokenStream.php @@ -21,6 +21,8 @@ use Symfony\Component\CssSelector\Exception\SyntaxErrorException; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class TokenStream { diff --git a/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php b/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php index 79fa7b77d06fa7325ae55255e389c01dc9ff9baf..aa9fc5077341a329fd54b33742343e8c5a41fa6d 100644 --- a/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php +++ b/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php @@ -23,6 +23,8 @@ use Symfony\Component\CssSelector\Parser\TokenStream; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class Tokenizer { diff --git a/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerEscaping.php b/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerEscaping.php index bf5096be9fde86ebeb723c91e68b69bc3bd5c71a..af4c31e5b09b82261d8a07d592c19822c75583f5 100644 --- a/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerEscaping.php +++ b/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerEscaping.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\Parser\Tokenizer; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class TokenizerEscaping { diff --git a/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php b/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php index 326f0208219a648ddfbf5508da5d187ecb3dcefe..5b071cd090f84ffba64e24b3729eec6416e560b4 100644 --- a/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php +++ b/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\Parser\Tokenizer; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class TokenizerPatterns { diff --git a/vendor/symfony/css-selector/README.md b/vendor/symfony/css-selector/README.md index ffe6c890f6b350a8468a4fd139c46af4b8280497..eef2885898bc4e123063e98edef5fd0350652dea 100644 --- a/vendor/symfony/css-selector/README.md +++ b/vendor/symfony/css-selector/README.md @@ -7,9 +7,10 @@ The component only goal is to convert CSS selectors to their XPath equivalents: ```php -use Symfony\Component\CssSelector\CssSelector; +use Symfony\Component\CssSelector\CssSelectorConverter; -print CssSelector::toXPath('div.item > h4 > a'); +$converter = new CssSelectorConverter(); +print $converter->toXPath('div.item > h4 > a'); ``` HTML and XML are different @@ -17,15 +18,12 @@ HTML and XML are different The `CssSelector` component comes with an `HTML` extension which is enabled by default. If you need to use this component with `XML` documents, you have to -disable this `HTML` extension. That's because, `HTML` tag & attribute names -are always lower-cased, but case-sensitive in `XML`: +disable this `HTML` extension. That's because, `HTML` tag & attribute names are +always lower-cased, but case-sensitive in `XML`: ```php // disable `HTML` extension: -CssSelector::disableHtmlExtension(); - -// re-enable `HTML` extension: -CssSelector::enableHtmlExtension(); +$converter = new CssSelectorConverter(false); ``` When the `HTML` extension is enabled, tag names are lower-cased, attribute @@ -45,3 +43,42 @@ You can run the unit tests with the following command: $ cd path/to/Symfony/Component/CssSelector/ $ composer install $ phpunit + +License +------- + +This component is a port of the Python cssselect library, +which is copyright Ian Bicking, https://github.com/SimonSapin/cssselect. + +Copyright (c) 2007-2012 Ian Bicking and contributors. See AUTHORS +for more details. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the +distribution. + +3. Neither the name of Ian Bicking nor the names of its contributors may +be used to endorse or promote products derived from this software +without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IAN BICKING OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/symfony/css-selector/Tests/CssSelectorConverterTest.php b/vendor/symfony/css-selector/Tests/CssSelectorConverterTest.php new file mode 100644 index 0000000000000000000000000000000000000000..624909b41d2c522db018a6032f9ae9ebdbe64350 --- /dev/null +++ b/vendor/symfony/css-selector/Tests/CssSelectorConverterTest.php @@ -0,0 +1,75 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\CssSelector\Tests; + +use Symfony\Component\CssSelector\CssSelectorConverter; + +class CssSelectorConverterTest extends \PHPUnit_Framework_TestCase +{ + public function testCssToXPath() + { + $converter = new CssSelectorConverter(); + + $this->assertEquals('descendant-or-self::*', $converter->toXPath('')); + $this->assertEquals('descendant-or-self::h1', $converter->toXPath('h1')); + $this->assertEquals("descendant-or-self::h1[@id = 'foo']", $converter->toXPath('h1#foo')); + $this->assertEquals("descendant-or-self::h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]", $converter->toXPath('h1.foo')); + $this->assertEquals('descendant-or-self::foo:h1', $converter->toXPath('foo|h1')); + $this->assertEquals('descendant-or-self::h1', $converter->toXPath('H1')); + } + + public function testCssToXPathXml() + { + $converter = new CssSelectorConverter(false); + + $this->assertEquals('descendant-or-self::H1', $converter->toXPath('H1')); + } + + /** + * @expectedException \Symfony\Component\CssSelector\Exception\ParseException + * @expectedExceptionMessage Expected identifier, but <eof at 3> found. + */ + public function testParseExceptions() + { + $converter = new CssSelectorConverter(); + $converter->toXPath('h1:'); + } + + /** @dataProvider getCssToXPathWithoutPrefixTestData */ + public function testCssToXPathWithoutPrefix($css, $xpath) + { + $converter = new CssSelectorConverter(); + + $this->assertEquals($xpath, $converter->toXPath($css, ''), '->parse() parses an input string and returns a node'); + } + + public function getCssToXPathWithoutPrefixTestData() + { + return array( + array('h1', 'h1'), + array('foo|h1', 'foo:h1'), + array('h1, h2, h3', 'h1 | h2 | h3'), + array('h1:nth-child(3n+1)', "*/*[name() = 'h1' and (position() - 1 >= 0 and (position() - 1) mod 3 = 0)]"), + array('h1 > p', 'h1/p'), + array('h1#foo', "h1[@id = 'foo']"), + array('h1.foo', "h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), + array('h1[class*="foo bar"]', "h1[@class and contains(@class, 'foo bar')]"), + array('h1[foo|class*="foo bar"]', "h1[@foo:class and contains(@foo:class, 'foo bar')]"), + array('h1[class]', 'h1[@class]'), + array('h1 .foo', "h1/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), + array('h1 #foo', "h1/descendant-or-self::*/*[@id = 'foo']"), + array('h1 [class*=foo]', "h1/descendant-or-self::*/*[@class and contains(@class, 'foo')]"), + array('div>.foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), + array('div > .foo', "div/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), + ); + } +} diff --git a/vendor/symfony/css-selector/Tests/CssSelectorTest.php b/vendor/symfony/css-selector/Tests/CssSelectorTest.php index 61ab80eec8d0b7fc3961cf6058c1b38e35b84fda..06eb0d2306b50f4c4c735383e6006d8575b81056 100644 --- a/vendor/symfony/css-selector/Tests/CssSelectorTest.php +++ b/vendor/symfony/css-selector/Tests/CssSelectorTest.php @@ -13,6 +13,9 @@ namespace Symfony\Component\CssSelector\Tests; use Symfony\Component\CssSelector\CssSelector; +/** + * @group legacy + */ class CssSelectorTest extends \PHPUnit_Framework_TestCase { public function testCssToXPath() diff --git a/vendor/symfony/css-selector/XPath/Extension/AbstractExtension.php b/vendor/symfony/css-selector/XPath/Extension/AbstractExtension.php index c70609c695d316f8f9748f6ad2312f3f1e5527cd..026ac06c79f21a657f80bc00ade72fe8ed1a2e2a 100644 --- a/vendor/symfony/css-selector/XPath/Extension/AbstractExtension.php +++ b/vendor/symfony/css-selector/XPath/Extension/AbstractExtension.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\XPath\Extension; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ abstract class AbstractExtension implements ExtensionInterface { diff --git a/vendor/symfony/css-selector/XPath/Extension/AttributeMatchingExtension.php b/vendor/symfony/css-selector/XPath/Extension/AttributeMatchingExtension.php index cbe48c57a9a378dcd1cf75e612521cbe5d97c599..6ace8b5925969ccc11d4323b7eff474760e73f6d 100644 --- a/vendor/symfony/css-selector/XPath/Extension/AttributeMatchingExtension.php +++ b/vendor/symfony/css-selector/XPath/Extension/AttributeMatchingExtension.php @@ -21,6 +21,8 @@ use Symfony\Component\CssSelector\XPath\XPathExpr; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class AttributeMatchingExtension extends AbstractExtension { diff --git a/vendor/symfony/css-selector/XPath/Extension/CombinationExtension.php b/vendor/symfony/css-selector/XPath/Extension/CombinationExtension.php index 9ce018f13a73b7d7e209c5d87f4ee4026be92ea8..0d2d658b65c64fbeaac55bbd28f7f57273df7826 100644 --- a/vendor/symfony/css-selector/XPath/Extension/CombinationExtension.php +++ b/vendor/symfony/css-selector/XPath/Extension/CombinationExtension.php @@ -20,6 +20,8 @@ use Symfony\Component\CssSelector\XPath\XPathExpr; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class CombinationExtension extends AbstractExtension { diff --git a/vendor/symfony/css-selector/XPath/Extension/ExtensionInterface.php b/vendor/symfony/css-selector/XPath/Extension/ExtensionInterface.php index 9b47f24f361ba3d40465aca097baa85c29a4102f..3607022891f95d3de665822bffd828af948a34c0 100644 --- a/vendor/symfony/css-selector/XPath/Extension/ExtensionInterface.php +++ b/vendor/symfony/css-selector/XPath/Extension/ExtensionInterface.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\XPath\Extension; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ interface ExtensionInterface { diff --git a/vendor/symfony/css-selector/XPath/Extension/FunctionExtension.php b/vendor/symfony/css-selector/XPath/Extension/FunctionExtension.php index 41ece8a42208cb418bf96aba86f193e243e0b25a..ea05523055f65b7e32bb2cbbe6131fc912558b1d 100644 --- a/vendor/symfony/css-selector/XPath/Extension/FunctionExtension.php +++ b/vendor/symfony/css-selector/XPath/Extension/FunctionExtension.php @@ -25,6 +25,8 @@ use Symfony\Component\CssSelector\XPath\XPathExpr; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class FunctionExtension extends AbstractExtension { diff --git a/vendor/symfony/css-selector/XPath/Extension/HtmlExtension.php b/vendor/symfony/css-selector/XPath/Extension/HtmlExtension.php index 0da74d47273fb9b5c1fe0af4971f3ca4fd4d4306..de6ce41621bd4a23f015d7f8fe9409161eeb0730 100644 --- a/vendor/symfony/css-selector/XPath/Extension/HtmlExtension.php +++ b/vendor/symfony/css-selector/XPath/Extension/HtmlExtension.php @@ -23,6 +23,8 @@ use Symfony\Component\CssSelector\XPath\XPathExpr; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class HtmlExtension extends AbstractExtension { diff --git a/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php b/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php index 2b8920f1ab502601d73ab4c6d79a062c718e719a..9d7f8fa3f08ddb05b07e593d009c4bd42688a1bd 100644 --- a/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php +++ b/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php @@ -22,6 +22,8 @@ use Symfony\Component\CssSelector\XPath\XPathExpr; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class NodeExtension extends AbstractExtension { diff --git a/vendor/symfony/css-selector/XPath/Extension/PseudoClassExtension.php b/vendor/symfony/css-selector/XPath/Extension/PseudoClassExtension.php index 008ec2b4b15bbe3fa473719a05e82f8ba018d5a3..1c8b217e39c09857b4ef0590cabf59ed0392cb5d 100644 --- a/vendor/symfony/css-selector/XPath/Extension/PseudoClassExtension.php +++ b/vendor/symfony/css-selector/XPath/Extension/PseudoClassExtension.php @@ -21,6 +21,8 @@ use Symfony\Component\CssSelector\XPath\XPathExpr; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class PseudoClassExtension extends AbstractExtension { diff --git a/vendor/symfony/css-selector/XPath/Translator.php b/vendor/symfony/css-selector/XPath/Translator.php index 5053793ea06c9a19e7c495a645ea35ca1a733a32..8c021b3beea0ce7a5484b3a00e488251023483f5 100644 --- a/vendor/symfony/css-selector/XPath/Translator.php +++ b/vendor/symfony/css-selector/XPath/Translator.php @@ -25,6 +25,8 @@ use Symfony\Component\CssSelector\Parser\ParserInterface; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class Translator implements TranslatorInterface { diff --git a/vendor/symfony/css-selector/XPath/TranslatorInterface.php b/vendor/symfony/css-selector/XPath/TranslatorInterface.php index bc19ae86346c4d4d24ff581f966ccb1642a40097..0b5de83d5712487a6fdb7b8b403fe1e4314cf3a4 100644 --- a/vendor/symfony/css-selector/XPath/TranslatorInterface.php +++ b/vendor/symfony/css-selector/XPath/TranslatorInterface.php @@ -20,6 +20,8 @@ use Symfony\Component\CssSelector\Node\SelectorNode; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ interface TranslatorInterface { diff --git a/vendor/symfony/css-selector/XPath/XPathExpr.php b/vendor/symfony/css-selector/XPath/XPathExpr.php index c7ef97cb9a12e9879bd72ca931995efe4d16a6ad..420ef3d85c0b0d5d39eb43ece9ed67b9d788761c 100644 --- a/vendor/symfony/css-selector/XPath/XPathExpr.php +++ b/vendor/symfony/css-selector/XPath/XPathExpr.php @@ -18,6 +18,8 @@ namespace Symfony\Component\CssSelector\XPath; * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> + * + * @internal */ class XPathExpr { diff --git a/vendor/symfony/css-selector/composer.json b/vendor/symfony/css-selector/composer.json index 99eb4da2da9d9835e18d29d32f10c92271da4b66..e5bbdcc0d7e0ac2fd9e2bbc53ddbd6531ea8b4e8 100644 --- a/vendor/symfony/css-selector/composer.json +++ b/vendor/symfony/css-selector/composer.json @@ -23,12 +23,15 @@ "php": ">=5.3.9" }, "autoload": { - "psr-4": { "Symfony\\Component\\CssSelector\\": "" } + "psr-4": { "Symfony\\Component\\CssSelector\\": "" }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } } } diff --git a/vendor/symfony/process/Exception/ProcessFailedException.php b/vendor/symfony/process/Exception/ProcessFailedException.php index 7523a5e9cd4ea2c16390e0904968777941f3df02..328acfde5e88358313c365de13738d70a66755f1 100644 --- a/vendor/symfony/process/Exception/ProcessFailedException.php +++ b/vendor/symfony/process/Exception/ProcessFailedException.php @@ -28,10 +28,11 @@ class ProcessFailedException extends RuntimeException throw new InvalidArgumentException('Expected a failed process, but the given process was successful.'); } - $error = sprintf('The command "%s" failed.'."\nExit Code: %s(%s)", + $error = sprintf('The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s", $process->getCommandLine(), $process->getExitCode(), - $process->getExitCodeText() + $process->getExitCodeText(), + $process->getWorkingDirectory() ); if (!$process->isOutputDisabled()) { diff --git a/vendor/symfony/process/PhpExecutableFinder.php b/vendor/symfony/process/PhpExecutableFinder.php index f8f57cc536a2532246852078ec1228552a233176..fb297825fe364326262976c7c6d4b6fbc69bcfbb 100644 --- a/vendor/symfony/process/PhpExecutableFinder.php +++ b/vendor/symfony/process/PhpExecutableFinder.php @@ -35,14 +35,17 @@ class PhpExecutableFinder */ public function find($includeArgs = true) { + $args = $this->findArguments(); + $args = $includeArgs && $args ? ' '.implode(' ', $args) : ''; + // HHVM support if (defined('HHVM_VERSION')) { - return (getenv('PHP_BINARY') ?: PHP_BINARY).($includeArgs ? ' '.implode(' ', $this->findArguments()) : ''); + return (getenv('PHP_BINARY') ?: PHP_BINARY).$args; } // PHP_BINARY return the current sapi executable - if (defined('PHP_BINARY') && PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server')) && is_file(PHP_BINARY)) { - return PHP_BINARY; + if (defined('PHP_BINARY') && PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg')) && is_file(PHP_BINARY)) { + return PHP_BINARY.$args; } if ($php = getenv('PHP_PATH')) { @@ -76,9 +79,10 @@ class PhpExecutableFinder { $arguments = array(); - // HHVM support if (defined('HHVM_VERSION')) { $arguments[] = '--php'; + } elseif ('phpdbg' === PHP_SAPI) { + $arguments[] = '-qrr'; } return $arguments; diff --git a/vendor/symfony/process/PhpProcess.php b/vendor/symfony/process/PhpProcess.php index 1adbd977adf8842accbb61d5cf776263ea29bde8..4a2a2625ffae03ffc69192d0917ce2592384d4b8 100644 --- a/vendor/symfony/process/PhpProcess.php +++ b/vendor/symfony/process/PhpProcess.php @@ -39,6 +39,13 @@ class PhpProcess extends Process if (false === $php = $executableFinder->find()) { $php = null; } + if ('phpdbg' === PHP_SAPI) { + $file = tempnam(sys_get_temp_dir(), 'dbg'); + file_put_contents($file, $script); + register_shutdown_function('unlink', $file); + $php .= ' '.ProcessUtils::escapeArgument($file); + $script = null; + } parent::__construct($php, $cwd, $env, $script, $timeout, $options); } diff --git a/vendor/symfony/process/Process.php b/vendor/symfony/process/Process.php index 699151f384921e7f4237752c075286545b85b844..c1e732170f9220dca10bd0ae4c83751a66e6db14 100644 --- a/vendor/symfony/process/Process.php +++ b/vendor/symfony/process/Process.php @@ -280,8 +280,20 @@ class Process } } + $ptsWorkaround = null; + + if (!$this->useFileHandles && $this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { + // Workaround for the bug, when PTS functionality is enabled. + // @see : https://bugs.php.net/69442 + $ptsWorkaround = fopen(__FILE__, 'r'); + } + $this->process = proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $this->env, $this->options); + if ($ptsWorkaround) { + fclose($ptsWorkaround); + } + if (!is_resource($this->process)) { throw new RuntimeException('Unable to launch a new process.'); } @@ -763,22 +775,14 @@ class Process * Stops the process. * * @param int|float $timeout The timeout in seconds - * @param int $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL + * @param int $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9) * * @return int The exit-code of the process - * - * @throws RuntimeException if the process got signaled */ public function stop($timeout = 10, $signal = null) { $timeoutMicro = microtime(true) + $timeout; if ($this->isRunning()) { - if ('\\' === DIRECTORY_SEPARATOR && !$this->isSigchildEnabled()) { - exec(sprintf('taskkill /F /T /PID %d 2>&1', $this->getPid()), $output, $exitCode); - if ($exitCode > 0) { - throw new RuntimeException('Unable to kill the process'); - } - } // given `SIGTERM` may not be defined and that `proc_terminate` uses the constant value and not the constant itself, we use the same here $this->doSignal(15, false); do { @@ -786,13 +790,9 @@ class Process } while ($this->isRunning() && microtime(true) < $timeoutMicro); if ($this->isRunning() && !$this->isSigchildEnabled()) { - if (null !== $signal || defined('SIGKILL')) { - // avoid exception here : - // process is supposed to be running, but it might have stop - // just after this line. - // in any case, let's silently discard the error, we can not do anything - $this->doSignal($signal ?: SIGKILL, false); - } + // Avoid exception here: process is supposed to be running, but it might have stopped just + // after this line. In any case, let's silently discard the error, we cannot do anything. + $this->doSignal($signal ?: 9, false); } } @@ -1461,7 +1461,18 @@ class Process return false; } - if (true !== @proc_terminate($this->process, $signal)) { + if ('\\' === DIRECTORY_SEPARATOR) { + exec(sprintf('taskkill /F /T /PID %d 2>&1', $this->getPid()), $output, $exitCode); + if ($exitCode) { + if ($throwException) { + throw new RuntimeException(sprintf('Unable to kill the process (%s).', implode(' ', $output))); + } + + return false; + } + } + + if (true !== @proc_terminate($this->process, $signal) && '\\' !== DIRECTORY_SEPARATOR) { if ($throwException) { throw new RuntimeException(sprintf('Error while sending signal `%s`.', $signal)); } diff --git a/vendor/symfony/process/Tests/AbstractProcessTest.php b/vendor/symfony/process/Tests/AbstractProcessTest.php index b2f60f9ffd98417b87b84e38797fd15d88e9d5e7..fca3729be8e2045dd5762ffe46c55d6254c07d5b 100644 --- a/vendor/symfony/process/Tests/AbstractProcessTest.php +++ b/vendor/symfony/process/Tests/AbstractProcessTest.php @@ -28,7 +28,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public static function setUpBeforeClass() { $phpBin = new PhpExecutableFinder(); - self::$phpBin = $phpBin->find(); + self::$phpBin = 'phpdbg' === PHP_SAPI ? 'php' : $phpBin->find(); } public function testThatProcessDoesNotThrowWarningDuringRun() @@ -81,7 +81,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase // exec is mandatory here since we send a signal to the process // see https://github.com/symfony/symfony/issues/5030 about prepending // command with exec - $p = $this->getProcess('exec php '.__DIR__.'/NonStopableProcess.php 3'); + $p = $this->getProcess('exec '.self::$phpBin.' '.__DIR__.'/NonStopableProcess.php 3'); $p->start(); usleep(100000); $start = microtime(true); @@ -470,7 +470,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('Windows does have /dev/tty support'); } - $process = $this->getProcess('echo "foo" >> /dev/null && php -r "usleep(100000);"'); + $process = $this->getProcess('echo "foo" >> /dev/null && '.self::$phpBin.' -r "usleep(100000);"'); $process->setTty(true); $process->start(); $this->assertTrue($process->isRunning()); @@ -730,7 +730,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $termSignal = defined('SIGKILL') ? SIGKILL : 9; - $process = $this->getProcess('exec php -r "while (true) {}"'); + $process = $this->getProcess('exec '.self::$phpBin.' -r "while (true) {}"'); $process->start(); posix_kill($process->getPid(), $termSignal); @@ -756,18 +756,6 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $this->assertNotEquals($process1->getOutput(), $process2->getOutput()); } - public function testPhpDeadlock() - { - $this->markTestSkipped('Can cause PHP to hang'); - - // Sleep doesn't work as it will allow the process to handle signals and close - // file handles from the other end. - $process = $this->getProcess(self::$phpBin.' -r "while (true) {}"'); - $process->start(); - - // PHP will deadlock when it tries to cleanup $process - } - public function testRunProcessWithTimeout() { $timeout = 0.5; diff --git a/vendor/symfony/process/Tests/PhpExecutableFinderTest.php b/vendor/symfony/process/Tests/PhpExecutableFinderTest.php index cd4abedc9df73641adf58559c7c85c45ad80ed73..87d0efe9ebf1f6ad8c469d1f989a305492b05207 100644 --- a/vendor/symfony/process/Tests/PhpExecutableFinderTest.php +++ b/vendor/symfony/process/Tests/PhpExecutableFinderTest.php @@ -43,7 +43,27 @@ class PhpExecutableFinderTest extends \PHPUnit_Framework_TestCase } /** - * tests find() with the env var PHP_PATH. + * tests find() with the constant PHP_BINARY. + * + * @requires PHP 5.4 + */ + public function testFind() + { + if (defined('HHVM_VERSION')) { + $this->markTestSkipped('Should not be executed in HHVM context.'); + } + + $f = new PhpExecutableFinder(); + + $current = PHP_BINARY; + $args = 'phpdbg' === PHP_SAPI ? ' -qrr' : ''; + + $this->assertEquals($current.$args, $f->find(), '::find() returns the executable PHP'); + $this->assertEquals($current, $f->find(false), '::find() returns the executable PHP'); + } + + /** + * tests find() with the env var / constant PHP_BINARY with HHVM. */ public function testFindWithHHVM() { @@ -68,6 +88,8 @@ class PhpExecutableFinderTest extends \PHPUnit_Framework_TestCase if (defined('HHVM_VERSION')) { $this->assertEquals($f->findArguments(), array('--php'), '::findArguments() returns HHVM arguments'); + } elseif ('phpdbg' === PHP_SAPI) { + $this->assertEquals($f->findArguments(), array('-qrr'), '::findArguments() returns phpdbg arguments'); } else { $this->assertEquals($f->findArguments(), array(), '::findArguments() returns no arguments'); } diff --git a/vendor/symfony/process/Tests/PhpProcessTest.php b/vendor/symfony/process/Tests/PhpProcessTest.php index 5dc546cc1ce6e47f63d1739d1558595573c9f7db..2cf79aa1a6d15306d215884258d3adc9ce51e729 100644 --- a/vendor/symfony/process/Tests/PhpProcessTest.php +++ b/vendor/symfony/process/Tests/PhpProcessTest.php @@ -30,6 +30,10 @@ PHP public function testCommandLine() { + if ('phpdbg' === PHP_SAPI) { + $this->markTestSkipped('phpdbg SAPI is not supported by this test.'); + } + $process = new PhpProcess(<<<PHP <?php echo 'foobar'; PHP diff --git a/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php b/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php index de37353f9175276b8673f50855d27628c1cb4ac8..0d763a470d19edc33ddce653d6acaea7eb8290ef 100644 --- a/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php +++ b/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php @@ -51,10 +51,11 @@ class ProcessFailedExceptionTest extends \PHPUnit_Framework_TestCase $exitText = 'General error'; $output = 'Command output'; $errorOutput = 'FATAL: Unexpected error'; + $workingDirectory = getcwd(); $process = $this->getMock( 'Symfony\Component\Process\Process', - array('isSuccessful', 'getOutput', 'getErrorOutput', 'getExitCode', 'getExitCodeText', 'isOutputDisabled'), + array('isSuccessful', 'getOutput', 'getErrorOutput', 'getExitCode', 'getExitCodeText', 'isOutputDisabled', 'getWorkingDirectory'), array($cmd) ); $process->expects($this->once()) @@ -81,10 +82,14 @@ class ProcessFailedExceptionTest extends \PHPUnit_Framework_TestCase ->method('isOutputDisabled') ->will($this->returnValue(false)); + $process->expects($this->once()) + ->method('getWorkingDirectory') + ->will($this->returnValue($workingDirectory)); + $exception = new ProcessFailedException($process); $this->assertEquals( - "The command \"$cmd\" failed.\nExit Code: $exitCode($exitText)\n\nOutput:\n================\n{$output}\n\nError Output:\n================\n{$errorOutput}", + "The command \"$cmd\" failed.\n\nExit Code: $exitCode($exitText)\n\nWorking directory: {$workingDirectory}\n\nOutput:\n================\n{$output}\n\nError Output:\n================\n{$errorOutput}", $exception->getMessage() ); } @@ -98,10 +103,11 @@ class ProcessFailedExceptionTest extends \PHPUnit_Framework_TestCase $cmd = 'php'; $exitCode = 1; $exitText = 'General error'; + $workingDirectory = getcwd(); $process = $this->getMock( 'Symfony\Component\Process\Process', - array('isSuccessful', 'isOutputDisabled', 'getExitCode', 'getExitCodeText', 'getOutput', 'getErrorOutput'), + array('isSuccessful', 'isOutputDisabled', 'getExitCode', 'getExitCodeText', 'getOutput', 'getErrorOutput', 'getWorkingDirectory'), array($cmd) ); $process->expects($this->once()) @@ -126,10 +132,14 @@ class ProcessFailedExceptionTest extends \PHPUnit_Framework_TestCase ->method('isOutputDisabled') ->will($this->returnValue(true)); + $process->expects($this->once()) + ->method('getWorkingDirectory') + ->will($this->returnValue($workingDirectory)); + $exception = new ProcessFailedException($process); $this->assertEquals( - "The command \"$cmd\" failed.\nExit Code: $exitCode($exitText)", + "The command \"$cmd\" failed.\n\nExit Code: $exitCode($exitText)\n\nWorking directory: {$workingDirectory}", $exception->getMessage() ); } diff --git a/vendor/symfony/process/Tests/SimpleProcessTest.php b/vendor/symfony/process/Tests/SimpleProcessTest.php index b3ee5c00f8894cc68f1059ccb1ac7cf6206918b8..78f20eb100a03cbcae46a6e69476e2066d21fb2b 100644 --- a/vendor/symfony/process/Tests/SimpleProcessTest.php +++ b/vendor/symfony/process/Tests/SimpleProcessTest.php @@ -152,46 +152,37 @@ class SimpleProcessTest extends AbstractProcessTest public function testStopTerminatesProcessCleanly() { - try { - $process = $this->getProcess(self::$phpBin.' -r "echo \'foo\'; sleep(1); echo \'bar\';"'); - $process->run(function () use ($process) { - $process->stop(); - }); - } catch (\RuntimeException $e) { - $this->fail('A call to stop() is not expected to cause wait() to throw a RuntimeException'); - } + $process = $this->getProcess(self::$phpBin.' -r "echo \'foo\'; sleep(1); echo \'bar\';"'); + $process->run(function () use ($process) { + $process->stop(); + }); + $this->assertTrue(true, 'A call to stop() is not expected to cause wait() to throw a RuntimeException'); } public function testKillSignalTerminatesProcessCleanly() { $this->expectExceptionIfPHPSigchild('Symfony\Component\Process\Exception\RuntimeException', 'This PHP has been compiled with --enable-sigchild. The process can not be signaled.'); - try { - $process = $this->getProcess(self::$phpBin.' -r "echo \'foo\'; sleep(1); echo \'bar\';"'); - $process->run(function () use ($process) { - if ($process->isRunning()) { - $process->signal(defined('SIGKILL') ? SIGKILL : 9); - } - }); - } catch (\RuntimeException $e) { - $this->fail('A call to signal() is not expected to cause wait() to throw a RuntimeException'); - } + $process = $this->getProcess(self::$phpBin.' -r "echo \'foo\'; sleep(1); echo \'bar\';"'); + $process->run(function () use ($process) { + if ($process->isRunning()) { + $process->signal(defined('SIGKILL') ? SIGKILL : 9); + } + }); + $this->assertTrue(true, 'A call to signal() is not expected to cause wait() to throw a RuntimeException'); } public function testTermSignalTerminatesProcessCleanly() { $this->expectExceptionIfPHPSigchild('Symfony\Component\Process\Exception\RuntimeException', 'This PHP has been compiled with --enable-sigchild. The process can not be signaled.'); - try { - $process = $this->getProcess(self::$phpBin.' -r "echo \'foo\'; sleep(1); echo \'bar\';"'); - $process->run(function () use ($process) { - if ($process->isRunning()) { - $process->signal(defined('SIGTERM') ? SIGTERM : 15); - } - }); - } catch (\RuntimeException $e) { - $this->fail('A call to signal() is not expected to cause wait() to throw a RuntimeException'); - } + $process = $this->getProcess(self::$phpBin.' -r "echo \'foo\'; sleep(1); echo \'bar\';"'); + $process->run(function () use ($process) { + if ($process->isRunning()) { + $process->signal(defined('SIGTERM') ? SIGTERM : 15); + } + }); + $this->assertTrue(true, 'A call to signal() is not expected to cause wait() to throw a RuntimeException'); } public function testStopWithTimeoutIsActuallyWorking() diff --git a/vendor/symfony/process/composer.json b/vendor/symfony/process/composer.json index 8d21bafccaccde16586d9b628447abd4bea56212..b3cb5186fc9408d5849399c1e2b958899eb82ba7 100644 --- a/vendor/symfony/process/composer.json +++ b/vendor/symfony/process/composer.json @@ -19,12 +19,15 @@ "php": ">=5.3.9" }, "autoload": { - "psr-4": { "Symfony\\Component\\Process\\": "" } + "psr-4": { "Symfony\\Component\\Process\\": "" }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } } } diff --git a/vendor/symfony/process/phpunit.xml.dist b/vendor/symfony/process/phpunit.xml.dist index b5d605c2efbbe78d98abc9802518245914f422c3..788500084abf8474b65b4c16cbd7b141f0cd6253 100644 --- a/vendor/symfony/process/phpunit.xml.dist +++ b/vendor/symfony/process/phpunit.xml.dist @@ -21,6 +21,7 @@ <directory>./</directory> <exclude> <directory>./Tests</directory> + <directory>./vendor</directory> </exclude> </whitelist> </filter>