From d83b793eac59ce781f91721ccaab0d9138889c6b Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Tue, 11 Aug 2015 13:36:21 -0400 Subject: [PATCH] Updated dependencies. --- composer.lock | 99 +-- vendor/composer/autoload_namespaces.php | 2 +- vendor/composer/include_paths.php | 6 +- vendor/composer/installed.json | 701 +++++++++--------- .../Exception/FileNotWritableException.php | 69 ++ .../FileWriterGeneratorStrategy.php | 50 +- .../FileNotWritableExceptionTest.php | 72 ++ .../FileWriterGeneratorStrategyTest.php | 87 ++- vendor/oyejorge/less.php/composer.json | 2 +- vendor/oyejorge/less.php/lib/Less/Cache.php | 6 +- .../oyejorge/less.php/lib/Less/Functions.php | 2 +- vendor/oyejorge/less.php/lib/Less/Parser.php | 2 +- .../less.php/lib/Less/SourceMap/Generator.php | 28 +- vendor/oyejorge/less.php/lib/Less/Version.php | 2 +- .../Archive_Tar/Archive/Tar.php | 410 +++++----- .../Structures/Graph/Node.php | 2 +- .../symfony/process/PhpExecutableFinder.php | 2 +- vendor/symfony/process/ProcessUtils.php | 2 +- .../process/Tests/AbstractProcessTest.php | 127 ++-- .../process/Tests/ExecutableFinderTest.php | 4 +- .../process/Tests/PhpExecutableFinderTest.php | 6 +- .../PipeStdinInStdoutStdErrStreamSelect.php | 4 +- .../process/Tests/SimpleProcessTest.php | 6 +- vendor/symfony/yaml/Inline.php | 2 +- vendor/symfony/yaml/Parser.php | 10 +- vendor/symfony/yaml/Tests/InlineTest.php | 20 +- vendor/symfony/yaml/Tests/ParserTest.php | 15 + vendor/symfony/yaml/Tests/YamlTest.php | 2 - vendor/zendframework/zendxml/.travis.yml | 8 +- vendor/zendframework/zendxml/LICENSE.md | 12 + vendor/zendframework/zendxml/bin/check-cs.sh | 24 - vendor/zendframework/zendxml/composer.json | 11 +- .../Exception/InvalidArgumentException.php | 4 +- .../ZendXml/Exception/RuntimeException.php | 4 +- .../zendxml/library/ZendXml/Security.php | 249 ++++++- .../tests/ZendXmlTest/MultibyteTest.php | 125 ++++ .../tests/ZendXmlTest/SecurityTest.php | 12 +- 37 files changed, 1401 insertions(+), 788 deletions(-) create mode 100644 vendor/ocramius/proxy-manager/src/ProxyManager/Exception/FileNotWritableException.php create mode 100644 vendor/ocramius/proxy-manager/tests/ProxyManagerTest/Exception/FileNotWritableExceptionTest.php create mode 100644 vendor/zendframework/zendxml/LICENSE.md delete mode 100644 vendor/zendframework/zendxml/bin/check-cs.sh create mode 100644 vendor/zendframework/zendxml/tests/ZendXmlTest/MultibyteTest.php diff --git a/composer.lock b/composer.lock index b40b3097792..50b3cbde644 100644 --- a/composer.lock +++ b/composer.lock @@ -197,16 +197,16 @@ }, { "name": "ocramius/proxy-manager", - "version": "1.0.0", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/Ocramius/ProxyManager.git", - "reference": "a80a39fac4fbd771aea7d3871929933a3a1bbf3e" + "reference": "57e9272ec0e8deccf09421596e0e2252df440e11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/a80a39fac4fbd771aea7d3871929933a3a1bbf3e", - "reference": "a80a39fac4fbd771aea7d3871929933a3a1bbf3e", + "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/57e9272ec0e8deccf09421596e0e2252df440e11", + "reference": "57e9272ec0e8deccf09421596e0e2252df440e11", "shasum": "" }, "require": { @@ -256,24 +256,24 @@ "proxy pattern", "service proxies" ], - "time": "2014-12-12 10:59:05" + "time": "2015-08-09 04:28:19" }, { "name": "oyejorge/less.php", - "version": "v1.7.0.4", + "version": "v1.7.0.5", "source": { "type": "git", "url": "https://github.com/oyejorge/less.php.git", - "reference": "fc971e6d3eb54dff3d3eba4734ff207d37cb4e0e" + "reference": "4385036b1dbfaf37f5380bd26a1e6006fc43149f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/oyejorge/less.php/zipball/fc971e6d3eb54dff3d3eba4734ff207d37cb4e0e", - "reference": "fc971e6d3eb54dff3d3eba4734ff207d37cb4e0e", + "url": "https://api.github.com/repos/oyejorge/less.php/zipball/4385036b1dbfaf37f5380bd26a1e6006fc43149f", + "reference": "4385036b1dbfaf37f5380bd26a1e6006fc43149f", "shasum": "" }, "require": { - "php": ">=5.2" + "php": ">=5.3" }, "bin": [ "bin/lessc" @@ -315,22 +315,22 @@ "php", "stylesheet" ], - "time": "2015-05-27 17:50:32" + "time": "2015-07-13 20:34:18" }, { "name": "pear-pear.php.net/Archive_Tar", - "version": "1.3.16", + "version": "1.4.0", "dist": { "type": "file", - "url": "http://pear.php.net/get/Archive_Tar-1.3.16.tgz", + "url": "http://pear.php.net/get/Archive_Tar-1.4.0.tgz", "reference": null, "shasum": null }, "require": { - "php": ">=4.3.0.0" + "php": ">=5.2.0.0" }, "replace": { - "pear-pear/archive_tar": "== 1.3.16.0" + "pear-pear/archive_tar": "== 1.4.0.0" }, "type": "pear-library", "autoload": { @@ -342,16 +342,16 @@ "/" ], "license": [ - "New BSD\n License" + "New BSD License" ], "description": "This class provides handling of tar files in PHP.\nIt supports creating, listing, extracting and adding to tar files.\nGzip support is available if PHP has the zlib extension built-in or\nloaded. Bz2 compression is also supported with the bz2 extension loaded." }, { "name": "pear-pear.php.net/Console_Getopt", - "version": "1.4.0", + "version": "1.4.1", "dist": { "type": "file", - "url": "http://pear.php.net/get/Console_Getopt-1.4.0.tgz", + "url": "http://pear.php.net/get/Console_Getopt-1.4.1.tgz", "reference": null, "shasum": null }, @@ -359,7 +359,7 @@ "php": ">=5.4.0.0" }, "replace": { - "pear-pear/console_getopt": "== 1.4.0.0" + "pear-pear/console_getopt": "== 1.4.1.0" }, "type": "pear-library", "autoload": { @@ -371,9 +371,9 @@ "/" ], "license": [ - "PHP License" + "BSD-2-Clause" ], - "description": "This is a PHP implementation of "getopt" supporting both\nshort and long options." + "description": "This is a PHP implementation of \"getopt\" supporting both\nshort and long options." }, { "name": "pear-pear.php.net/File_MARC", @@ -445,10 +445,10 @@ }, { "name": "pear-pear.php.net/Structures_Graph", - "version": "1.1.0", + "version": "1.1.1", "dist": { "type": "file", - "url": "http://pear.php.net/get/Structures_Graph-1.1.0.tgz", + "url": "http://pear.php.net/get/Structures_Graph-1.1.1.tgz", "reference": null, "shasum": null }, @@ -456,7 +456,7 @@ "php": ">=5.3.0.0" }, "replace": { - "pear-pear/structures_graph": "== 1.1.0.0" + "pear-pear/structures_graph": "== 1.1.1.0" }, "type": "pear-library", "autoload": { @@ -468,7 +468,7 @@ "/" ], "license": [ - "LGPL License" + "LGPL-3.0+" ], "description": "Structures_Graph is a package for creating and manipulating graph datastructures. It allows building of directed\nand undirected graphs, with data and metadata stored in nodes. The library provides functions for graph traversing\nas well as for characteristic extraction from the graph topology." }, @@ -596,16 +596,16 @@ }, { "name": "symfony/yaml", - "version": "v2.7.1", + "version": "v2.7.3", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160" + "reference": "71340e996171474a53f3d29111d046be4ad8a0ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/9808e75c609a14f6db02f70fccf4ca4aab53c160", - "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/71340e996171474a53f3d29111d046be4ad8a0ff", + "reference": "71340e996171474a53f3d29111d046be4ad8a0ff", "shasum": "" }, "require": { @@ -641,7 +641,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-06-10 15:30:22" + "time": "2015-07-28 14:07:07" }, { "name": "vufind-org/vufindcode", @@ -955,24 +955,24 @@ }, { "name": "zendframework/zendxml", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/zendframework/ZendXml.git", - "reference": "559b34f426d33a11c3db118e00ce14bb8dc64e5f" + "reference": "d8b34286c7c0f3a19fbad05ceec82ceb9dcb8257" }, "dist": { "type": "zip", - "url": "https://packages.zendframework.com/composer/zendframework-zendxml-559b34f426d33a11c3db118e00ce14bb8dc64e5f-zip-6cf7a2.zip", - "reference": "559b34f426d33a11c3db118e00ce14bb8dc64e5f", - "shasum": "39abc614b5c26bcbf8102e203c52dee73c4460a8" + "url": "https://packages.zendframework.com/composer/zendframework-zendxml-1.0.1-88b0f5.zip", + "reference": "d8b34286c7c0f3a19fbad05ceec82ceb9dcb8257", + "shasum": "f532a500c86c8d811f1a2e0ee43022685367e15a" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "fabpot/php-cs-fixer": "*@dev", - "phpunit/phpunit": "~3.7" + "phpunit/phpunit": "~3.7", + "squizlabs/php_codesniffer": "~1.5" }, "type": "library", "extra": { @@ -982,7 +982,12 @@ }, "autoload": { "psr-0": { - "ZendXml": "library/" + "ZendXml\\": "library/" + } + }, + "autoload-dev": { + "psr-4": { + "ZendTest\\Xml\\": "tests/ZendXmlTest/" } }, "license": [ @@ -995,11 +1000,7 @@ "xml", "zf2" ], - "support": { - "source": "https://github.com/zendframework/ZendXml/tree/master", - "issues": "https://github.com/zendframework/ZendXml/issues" - }, - "time": "2014-03-05 22:25:44" + "time": "2015-08-03 14:50:10" }, { "name": "zf-commons/zfc-rbac", @@ -1244,7 +1245,7 @@ }, { "name": "symfony/css-selector", - "version": "v2.7.1", + "version": "v2.7.3", "source": { "type": "git", "url": "https://github.com/symfony/CssSelector.git", @@ -1297,16 +1298,16 @@ }, { "name": "symfony/process", - "version": "v2.7.1", + "version": "v2.7.3", "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "552d8efdc80980cbcca50b28d626ac8e36e3cdd1" + "reference": "48aeb0e48600321c272955132d7606ab0a49adb3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/552d8efdc80980cbcca50b28d626ac8e36e3cdd1", - "reference": "552d8efdc80980cbcca50b28d626ac8e36e3cdd1", + "url": "https://api.github.com/repos/symfony/Process/zipball/48aeb0e48600321c272955132d7606ab0a49adb3", + "reference": "48aeb0e48600321c272955132d7606ab0a49adb3", "shasum": "" }, "require": { @@ -1342,7 +1343,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2015-06-08 09:37:21" + "time": "2015-07-01 11:25:50" } ], "aliases": [], diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index 3507c01513b..5c13f94b12e 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -8,7 +8,7 @@ $baseDir = dirname($vendorDir); return array( 'ZfcRbac\\' => array($vendorDir . '/zf-commons/zfc-rbac/src'), 'Zend\\' => array($vendorDir . '/zendframework/zendframework/library'), - 'ZendXml' => array($vendorDir . '/zendframework/zendxml/library'), + 'ZendXml\\' => array($vendorDir . '/zendframework/zendxml/library'), 'ZendService\\Amazon\\' => array($vendorDir . '/zendframework/zendservice-amazon/library'), 'ZendRest' => array($vendorDir . '/zendframework/zendrest/library'), 'VuFindHttp\\' => array($vendorDir . '/vufind-org/vufindhttp/src'), diff --git a/vendor/composer/include_paths.php b/vendor/composer/include_paths.php index 20869ac55f9..8a050fd9658 100644 --- a/vendor/composer/include_paths.php +++ b/vendor/composer/include_paths.php @@ -8,10 +8,10 @@ $baseDir = dirname($vendorDir); return array( $vendorDir . '/pear-pear.php.net/File_MARC', $vendorDir . '/pear-pear.php.net/XML_Util', - $vendorDir . '/pear-pear.php.net/Console_Getopt', - $vendorDir . '/pear-pear.php.net/Structures_Graph', - $vendorDir . '/pear-pear.php.net/Archive_Tar', $vendorDir . '/pear-pear.php.net/PEAR', $vendorDir . '/pear-pear.php.net/Validate', $vendorDir . '/pear-pear.php.net/Validate_ISPN', + $vendorDir . '/pear-pear.php.net/Archive_Tar', + $vendorDir . '/pear-pear.php.net/Console_Getopt', + $vendorDir . '/pear-pear.php.net/Structures_Graph', ); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index eae1c405c7e..82e390ac510 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -288,56 +288,6 @@ "zombie" ] }, - { - "name": "zendframework/zendxml", - "version": "1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/zendframework/ZendXml.git", - "reference": "559b34f426d33a11c3db118e00ce14bb8dc64e5f" - }, - "dist": { - "type": "zip", - "url": "https://packages.zendframework.com/composer/zendframework-zendxml-559b34f426d33a11c3db118e00ce14bb8dc64e5f-zip-6cf7a2.zip", - "reference": "559b34f426d33a11c3db118e00ce14bb8dc64e5f", - "shasum": "39abc614b5c26bcbf8102e203c52dee73c4460a8" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "fabpot/php-cs-fixer": "*@dev", - "phpunit/phpunit": "~3.7" - }, - "time": "2014-03-05 22:25:44", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "ZendXml": "library/" - } - }, - "license": [ - "BSD-3-Clause" - ], - "description": "Utility library for XML usage, best practices, and security in PHP", - "homepage": "http://packages.zendframework.com/", - "keywords": [ - "security", - "xml", - "zf2" - ], - "support": { - "source": "https://github.com/zendframework/ZendXml/tree/master", - "issues": "https://github.com/zendframework/ZendXml/issues" - } - }, { "name": "zendframework/zendframework", "version": "2.3.7", @@ -528,71 +478,6 @@ "zf2" ] }, - { - "name": "ocramius/proxy-manager", - "version": "1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/ProxyManager.git", - "reference": "a80a39fac4fbd771aea7d3871929933a3a1bbf3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/a80a39fac4fbd771aea7d3871929933a3a1bbf3e", - "reference": "a80a39fac4fbd771aea7d3871929933a3a1bbf3e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "zendframework/zend-code": ">2.2.5,<3.0" - }, - "require-dev": { - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "1.5.*" - }, - "suggest": { - "ocramius/generated-hydrator": "To have very fast object to array to object conversion for ghost objects", - "zendframework/zend-json": "To have the JsonRpc adapter (Remote Object feature)", - "zendframework/zend-soap": "To have the Soap adapter (Remote Object feature)", - "zendframework/zend-stdlib": "To use the hydrator proxy", - "zendframework/zend-xmlrpc": "To have the XmlRpc adapter (Remote Object feature)" - }, - "time": "2014-12-12 10:59:05", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "ProxyManager\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A library providing utilities to generate, instantiate and generally operate with Object Proxies", - "homepage": "https://github.com/Ocramius/ProxyManager", - "keywords": [ - "aop", - "lazy loading", - "proxy", - "proxy pattern", - "service proxies" - ] - }, { "name": "pear-pear.php.net/File_MARC", "version": "1.1.1", @@ -656,99 +541,6 @@ ], "description": "Selection of methods that are often needed when working with XML documents. Functionality includes creating of attribute lists from arrays, creation of tags, validation of XML names and more." }, - { - "name": "pear-pear.php.net/Console_Getopt", - "version": "1.4.0", - "version_normalized": "1.4.0.0", - "dist": { - "type": "file", - "url": "http://pear.php.net/get/Console_Getopt-1.4.0.tgz", - "reference": null, - "shasum": null - }, - "require": { - "php": ">=5.4.0.0" - }, - "replace": { - "pear-pear/console_getopt": "== 1.4.0.0" - }, - "type": "pear-library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "" - ] - }, - "include-path": [ - "/" - ], - "license": [ - "PHP License" - ], - "description": "This is a PHP implementation of "getopt" supporting both\nshort and long options." - }, - { - "name": "pear-pear.php.net/Structures_Graph", - "version": "1.1.0", - "version_normalized": "1.1.0.0", - "dist": { - "type": "file", - "url": "http://pear.php.net/get/Structures_Graph-1.1.0.tgz", - "reference": null, - "shasum": null - }, - "require": { - "php": ">=5.3.0.0" - }, - "replace": { - "pear-pear/structures_graph": "== 1.1.0.0" - }, - "type": "pear-library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "" - ] - }, - "include-path": [ - "/" - ], - "license": [ - "LGPL License" - ], - "description": "Structures_Graph is a package for creating and manipulating graph datastructures. It allows building of directed\nand undirected graphs, with data and metadata stored in nodes. The library provides functions for graph traversing\nas well as for characteristic extraction from the graph topology." - }, - { - "name": "pear-pear.php.net/Archive_Tar", - "version": "1.3.16", - "version_normalized": "1.3.16.0", - "dist": { - "type": "file", - "url": "http://pear.php.net/get/Archive_Tar-1.3.16.tgz", - "reference": null, - "shasum": null - }, - "require": { - "php": ">=4.3.0.0" - }, - "replace": { - "pear-pear/archive_tar": "== 1.3.16.0" - }, - "type": "pear-library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "" - ] - }, - "include-path": [ - "/" - ], - "license": [ - "New BSD\n License" - ], - "description": "This class provides handling of tar files in PHP.\nIt supports creating, listing, extracting and adding to tar files.\nGzip support is available if PHP has the zlib extension built-in or\nloaded. Bz2 compression is also supported with the bz2 extension loaded." - }, { "name": "pear-pear.php.net/PEAR", "version": "1.9.5", @@ -1035,98 +827,115 @@ ] }, { - "name": "oyejorge/less.php", - "version": "v1.7.0.4", - "version_normalized": "1.7.0.4", + "name": "zendframework/zendservice-amazon", + "version": "2.0.4", + "version_normalized": "2.0.4.0", "source": { "type": "git", - "url": "https://github.com/oyejorge/less.php.git", - "reference": "fc971e6d3eb54dff3d3eba4734ff207d37cb4e0e" + "url": "https://github.com/zendframework/ZendService_Amazon.git", + "reference": "a44eec522c622970a6c6666dc308ec6daad08ed4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/oyejorge/less.php/zipball/fc971e6d3eb54dff3d3eba4734ff207d37cb4e0e", - "reference": "fc971e6d3eb54dff3d3eba4734ff207d37cb4e0e", - "shasum": "" + "url": "https://packages.zendframework.com/composer/zendframework-zendservice-amazon-2.0.4-db4e7c.zip", + "reference": "a44eec522c622970a6c6666dc308ec6daad08ed4", + "shasum": "6725f42e30e9fa4fa2f8476d650fc07118900569" }, "require": { - "php": ">=5.2" + "php": ">=5.3.3", + "zendframework/zend-crypt": "~2.0", + "zendframework/zend-http": "~2.0", + "zendframework/zend-json": "~2.0", + "zendframework/zendrest": "~2.0", + "zendframework/zendxml": "~1.0-dev" }, - "time": "2015-05-27 17:50:32", - "bin": [ - "bin/lessc" - ], + "require-dev": { + "fabpot/php-cs-fixer": "~1.7.0", + "phpunit/phpunit": "~4.0", + "zendframework/zend-i18n": "~2.0" + }, + "suggest": { + "zendframework/zend-uri": "Zend\\Uri component" + }, + "time": "2015-06-04 19:47:46", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "installation-source": "dist", "autoload": { "psr-0": { - "Less": "lib/" - }, - "classmap": [ - "lessc.inc.php" - ] + "ZendService\\Amazon\\": "library/" + } }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Matt Agar", - "homepage": "https://github.com/agar" - }, - { - "name": "Martin JantoÅ¡oviÄ", - "homepage": "https://github.com/Mordred" - }, - { - "name": "Josh Schmidt", - "homepage": "https://github.com/oyejorge" + "autoload-dev": { + "psr-0": { + "ZendServiceTest\\Amazon\\": "tests/ZendServiceTest/Amazon/" } + }, + "license": [ + "BSD-3-Clause" ], - "description": "PHP port of the Javascript version of LESS http://lesscss.org", - "homepage": "http://lessphp.gpeasy.com", + "description": "OOP wrapper for the Amazon web service", + "homepage": "http://packages.zendframework.com/", "keywords": [ - "css", - "less", - "less.js", - "lesscss", - "php", - "stylesheet" - ] - }, - { - "name": "symfony/yaml", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "amazon", + "ec2", + "s3", + "simpledb", + "sqs", + "zf2" + ] + }, + { + "name": "zf-commons/zfc-rbac", + "version": "v2.5.2", + "version_normalized": "2.5.2.0", "source": { "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160" + "url": "https://github.com/ZF-Commons/zfc-rbac.git", + "reference": "8046ed9683739ac227ca4f8da7318c2ea330589f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/9808e75c609a14f6db02f70fccf4ca4aab53c160", - "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160", + "url": "https://api.github.com/repos/ZF-Commons/zfc-rbac/zipball/8046ed9683739ac227ca4f8da7318c2ea330589f", + "reference": "8046ed9683739ac227ca4f8da7318c2ea330589f", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.4", + "zendframework/zend-mvc": "~2.2", + "zendframework/zend-servicemanager": "~2.2", + "zfr/rbac": "~1.2" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "doctrine/common": "~2.4", + "doctrine/doctrine-module": "~0.8", + "doctrine/doctrine-orm-module": "~0.8", + "phpunit/phpunit": "~3.7", + "satooshi/php-coveralls": "~0.6", + "squizlabs/php_codesniffer": "1.4.*", + "zendframework/zend-developer-tools": "dev-master", + "zendframework/zendframework": "~2.2" + }, + "suggest": { + "doctrine/doctrine-module": "if you want to use Doctrine role provider", + "zendframework/zend-developer-tools": "if you want to show information about the roles" }, - "time": "2015-06-10 15:30:22", + "time": "2015-05-29 10:13:14", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.4-dev", + "dev-develop": "3.0-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" + "psr-0": { + "ZfcRbac\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1135,127 +944,122 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Kyle Spraggs", + "email": "theman@spiffyjr.me", + "homepage": "http://www.spiffyjr.me/" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Jean-Marie Leroux", + "email": "jmleroux.pro@gmail.com" + }, + { + "name": "Michaël Gallego", + "email": "mic.gallego@gmail.com", + "homepage": "http://www.michaelgallego.fr" } ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com" + "description": "Zend Framework 2 Module that provides a layer of features of Zend\\Permissions\\Rbac", + "homepage": "http://www.github.com/ZF-Commons/zfc-rbac", + "keywords": [ + "module", + "permissions", + "rbac", + "zf2" + ] }, { - "name": "zendframework/zendservice-amazon", - "version": "2.0.4", - "version_normalized": "2.0.4.0", + "name": "zendframework/zendxml", + "version": "1.0.1", + "version_normalized": "1.0.1.0", "source": { "type": "git", - "url": "https://github.com/zendframework/ZendService_Amazon.git", - "reference": "a44eec522c622970a6c6666dc308ec6daad08ed4" + "url": "https://github.com/zendframework/ZendXml.git", + "reference": "d8b34286c7c0f3a19fbad05ceec82ceb9dcb8257" }, "dist": { "type": "zip", - "url": "https://packages.zendframework.com/composer/zendframework-zendservice-amazon-2.0.4-db4e7c.zip", - "reference": "a44eec522c622970a6c6666dc308ec6daad08ed4", - "shasum": "6725f42e30e9fa4fa2f8476d650fc07118900569" + "url": "https://packages.zendframework.com/composer/zendframework-zendxml-1.0.1-88b0f5.zip", + "reference": "d8b34286c7c0f3a19fbad05ceec82ceb9dcb8257", + "shasum": "f532a500c86c8d811f1a2e0ee43022685367e15a" }, "require": { - "php": ">=5.3.3", - "zendframework/zend-crypt": "~2.0", - "zendframework/zend-http": "~2.0", - "zendframework/zend-json": "~2.0", - "zendframework/zendrest": "~2.0", - "zendframework/zendxml": "~1.0-dev" + "php": ">=5.3.3" }, "require-dev": { - "fabpot/php-cs-fixer": "~1.7.0", - "phpunit/phpunit": "~4.0", - "zendframework/zend-i18n": "~2.0" - }, - "suggest": { - "zendframework/zend-uri": "Zend\\Uri component" + "phpunit/phpunit": "~3.7", + "squizlabs/php_codesniffer": "~1.5" }, - "time": "2015-06-04 19:47:46", + "time": "2015-08-03 14:50:10", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "ZendService\\Amazon\\": "library/" + "ZendXml\\": "library/" } }, "autoload-dev": { - "psr-0": { - "ZendServiceTest\\Amazon\\": "tests/ZendServiceTest/Amazon/" + "psr-4": { + "ZendTest\\Xml\\": "tests/ZendXmlTest/" } }, "license": [ "BSD-3-Clause" ], - "description": "OOP wrapper for the Amazon web service", + "description": "Utility library for XML usage, best practices, and security in PHP", "homepage": "http://packages.zendframework.com/", "keywords": [ - "amazon", - "ec2", - "s3", - "simpledb", - "sqs", + "security", + "xml", "zf2" ] }, { - "name": "zf-commons/zfc-rbac", - "version": "v2.5.2", - "version_normalized": "2.5.2.0", + "name": "ocramius/proxy-manager", + "version": "1.0.2", + "version_normalized": "1.0.2.0", "source": { "type": "git", - "url": "https://github.com/ZF-Commons/zfc-rbac.git", - "reference": "8046ed9683739ac227ca4f8da7318c2ea330589f" + "url": "https://github.com/Ocramius/ProxyManager.git", + "reference": "57e9272ec0e8deccf09421596e0e2252df440e11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ZF-Commons/zfc-rbac/zipball/8046ed9683739ac227ca4f8da7318c2ea330589f", - "reference": "8046ed9683739ac227ca4f8da7318c2ea330589f", + "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/57e9272ec0e8deccf09421596e0e2252df440e11", + "reference": "57e9272ec0e8deccf09421596e0e2252df440e11", "shasum": "" }, "require": { - "php": ">=5.4", - "zendframework/zend-mvc": "~2.2", - "zendframework/zend-servicemanager": "~2.2", - "zfr/rbac": "~1.2" + "php": ">=5.3.3", + "zendframework/zend-code": ">2.2.5,<3.0" }, "require-dev": { - "doctrine/common": "~2.4", - "doctrine/doctrine-module": "~0.8", - "doctrine/doctrine-orm-module": "~0.8", - "phpunit/phpunit": "~3.7", - "satooshi/php-coveralls": "~0.6", - "squizlabs/php_codesniffer": "1.4.*", - "zendframework/zend-developer-tools": "dev-master", - "zendframework/zendframework": "~2.2" + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "1.5.*" }, "suggest": { - "doctrine/doctrine-module": "if you want to use Doctrine role provider", - "zendframework/zend-developer-tools": "if you want to show information about the roles" + "ocramius/generated-hydrator": "To have very fast object to array to object conversion for ghost objects", + "zendframework/zend-json": "To have the JsonRpc adapter (Remote Object feature)", + "zendframework/zend-soap": "To have the Soap adapter (Remote Object feature)", + "zendframework/zend-stdlib": "To use the hydrator proxy", + "zendframework/zend-xmlrpc": "To have the XmlRpc adapter (Remote Object feature)" }, - "time": "2015-05-29 10:13:14", + "time": "2015-08-09 04:28:19", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev", - "dev-develop": "3.0-dev" + "dev-master": "2.0.x-dev" } }, "installation-source": "dist", "autoload": { "psr-0": { - "ZfcRbac\\": "src/" + "ProxyManager\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1264,33 +1068,137 @@ ], "authors": [ { - "name": "Kyle Spraggs", - "email": "theman@spiffyjr.me", - "homepage": "http://www.spiffyjr.me/" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A library providing utilities to generate, instantiate and generally operate with Object Proxies", + "homepage": "https://github.com/Ocramius/ProxyManager", + "keywords": [ + "aop", + "lazy loading", + "proxy", + "proxy pattern", + "service proxies" + ] + }, + { + "name": "oyejorge/less.php", + "version": "v1.7.0.5", + "version_normalized": "1.7.0.5", + "source": { + "type": "git", + "url": "https://github.com/oyejorge/less.php.git", + "reference": "4385036b1dbfaf37f5380bd26a1e6006fc43149f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/oyejorge/less.php/zipball/4385036b1dbfaf37f5380bd26a1e6006fc43149f", + "reference": "4385036b1dbfaf37f5380bd26a1e6006fc43149f", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "time": "2015-07-13 20:34:18", + "bin": [ + "bin/lessc" + ], + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Less": "lib/" }, + "classmap": [ + "lessc.inc.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ { - "name": "Jean-Marie Leroux", - "email": "jmleroux.pro@gmail.com" + "name": "Matt Agar", + "homepage": "https://github.com/agar" }, { - "name": "Michaël Gallego", - "email": "mic.gallego@gmail.com", - "homepage": "http://www.michaelgallego.fr" + "name": "Martin JantoÅ¡oviÄ", + "homepage": "https://github.com/Mordred" + }, + { + "name": "Josh Schmidt", + "homepage": "https://github.com/oyejorge" } ], - "description": "Zend Framework 2 Module that provides a layer of features of Zend\\Permissions\\Rbac", - "homepage": "http://www.github.com/ZF-Commons/zfc-rbac", + "description": "PHP port of the Javascript version of LESS http://lesscss.org", + "homepage": "http://lessphp.gpeasy.com", "keywords": [ - "module", - "permissions", - "rbac", - "zf2" + "css", + "less", + "less.js", + "lesscss", + "php", + "stylesheet" ] }, + { + "name": "symfony/yaml", + "version": "v2.7.3", + "version_normalized": "2.7.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "71340e996171474a53f3d29111d046be4ad8a0ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/71340e996171474a53f3d29111d046be4ad8a0ff", + "reference": "71340e996171474a53f3d29111d046be4ad8a0ff", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "time": "2015-07-28 14:07:07", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "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 Yaml Component", + "homepage": "https://symfony.com" + }, { "name": "symfony/css-selector", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.3", + "version_normalized": "2.7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/CssSelector.git", @@ -1344,17 +1252,17 @@ }, { "name": "symfony/process", - "version": "v2.7.1", - "version_normalized": "2.7.1.0", + "version": "v2.7.3", + "version_normalized": "2.7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "552d8efdc80980cbcca50b28d626ac8e36e3cdd1" + "reference": "48aeb0e48600321c272955132d7606ab0a49adb3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/552d8efdc80980cbcca50b28d626ac8e36e3cdd1", - "reference": "552d8efdc80980cbcca50b28d626ac8e36e3cdd1", + "url": "https://api.github.com/repos/symfony/Process/zipball/48aeb0e48600321c272955132d7606ab0a49adb3", + "reference": "48aeb0e48600321c272955132d7606ab0a49adb3", "shasum": "" }, "require": { @@ -1363,7 +1271,7 @@ "require-dev": { "symfony/phpunit-bridge": "~2.7" }, - "time": "2015-06-08 09:37:21", + "time": "2015-07-01 11:25:50", "type": "library", "extra": { "branch-alias": { @@ -1392,5 +1300,98 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com" + }, + { + "name": "pear-pear.php.net/Archive_Tar", + "version": "1.4.0", + "version_normalized": "1.4.0.0", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Archive_Tar-1.4.0.tgz", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=5.2.0.0" + }, + "replace": { + "pear-pear/archive_tar": "== 1.4.0.0" + }, + "type": "pear-library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "license": [ + "New BSD License" + ], + "description": "This class provides handling of tar files in PHP.\nIt supports creating, listing, extracting and adding to tar files.\nGzip support is available if PHP has the zlib extension built-in or\nloaded. Bz2 compression is also supported with the bz2 extension loaded." + }, + { + "name": "pear-pear.php.net/Console_Getopt", + "version": "1.4.1", + "version_normalized": "1.4.1.0", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Console_Getopt-1.4.1.tgz", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=5.4.0.0" + }, + "replace": { + "pear-pear/console_getopt": "== 1.4.1.0" + }, + "type": "pear-library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "license": [ + "BSD-2-Clause" + ], + "description": "This is a PHP implementation of \"getopt\" supporting both\nshort and long options." + }, + { + "name": "pear-pear.php.net/Structures_Graph", + "version": "1.1.1", + "version_normalized": "1.1.1.0", + "dist": { + "type": "file", + "url": "http://pear.php.net/get/Structures_Graph-1.1.1.tgz", + "reference": null, + "shasum": null + }, + "require": { + "php": ">=5.3.0.0" + }, + "replace": { + "pear-pear/structures_graph": "== 1.1.1.0" + }, + "type": "pear-library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "" + ] + }, + "include-path": [ + "/" + ], + "license": [ + "LGPL-3.0+" + ], + "description": "Structures_Graph is a package for creating and manipulating graph datastructures. It allows building of directed\nand undirected graphs, with data and metadata stored in nodes. The library provides functions for graph traversing\nas well as for characteristic extraction from the graph topology." } ] diff --git a/vendor/ocramius/proxy-manager/src/ProxyManager/Exception/FileNotWritableException.php b/vendor/ocramius/proxy-manager/src/ProxyManager/Exception/FileNotWritableException.php new file mode 100644 index 00000000000..7d9a99f838c --- /dev/null +++ b/vendor/ocramius/proxy-manager/src/ProxyManager/Exception/FileNotWritableException.php @@ -0,0 +1,69 @@ +<?php +/* + * 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 THE COPYRIGHT + * OWNER 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. + * + * This software consists of voluntary contributions made by many individuals + * and is licensed under the MIT license. + */ + +namespace ProxyManager\Exception; + +use InvalidArgumentException; +use ReflectionClass; +use ReflectionMethod; +use UnexpectedValueException; + +/** + * Exception for non writable files + * + * @author Marco Pivetta <ocramius@gmail.com> + * @license MIT + */ +class FileNotWritableException extends UnexpectedValueException implements ExceptionInterface +{ + /** + * @param string $fromPath + * @param string $toPath + * + * @return self + */ + public static function fromInvalidMoveOperation($fromPath, $toPath) + { + return new self(sprintf( + 'Could not move file "%s" to location "%s": ' + . 'either the source file is not readable, or the destination is not writable', + $fromPath, + $toPath + )); + } + + /** + * @param string $path + * + * @return self + */ + public static function fromNonWritableLocation($path) + { + $messages = array(); + + if (($destination = realpath($path)) && ! is_file($destination)) { + $messages[] = 'exists and is not a file'; + } + + if (! is_writable($destination)) { + $messages[] = 'is not writable'; + } + + return new self(sprintf('Could not write to path "%s": %s', $path, implode(', ', $messages))); + } +} diff --git a/vendor/ocramius/proxy-manager/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php b/vendor/ocramius/proxy-manager/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php index 29ec7caa88b..4bda4186981 100644 --- a/vendor/ocramius/proxy-manager/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php +++ b/vendor/ocramius/proxy-manager/src/ProxyManager/GeneratorStrategy/FileWriterGeneratorStrategy.php @@ -18,6 +18,7 @@ namespace ProxyManager\GeneratorStrategy; +use ProxyManager\Exception\FileNotWritableException; use ProxyManager\FileLocator\FileLocatorInterface; use Zend\Code\Generator\ClassGenerator; @@ -36,12 +37,19 @@ class FileWriterGeneratorStrategy implements GeneratorStrategyInterface */ protected $fileLocator; + /** + * @var callable + */ + private $emptyErrorHandler; + /** * @param \ProxyManager\FileLocator\FileLocatorInterface $fileLocator */ public function __construct(FileLocatorInterface $fileLocator) { - $this->fileLocator = $fileLocator; + $this->fileLocator = $fileLocator; + $this->emptyErrorHandler = function () { + }; } /** @@ -55,13 +63,43 @@ class FileWriterGeneratorStrategy implements GeneratorStrategyInterface . '\\' . trim($classGenerator->getName(), '\\'); $generatedCode = $classGenerator->generate(); $fileName = $this->fileLocator->getProxyFileName($className); - $tmpFileName = $fileName . '.' . uniqid('', true); - // renaming files is necessary to avoid race conditions when the same file is written multiple times - // in a short time period - file_put_contents($tmpFileName, "<?php\n\n" . $generatedCode); - rename($tmpFileName, $fileName); + set_error_handler($this->emptyErrorHandler); + + try { + $this->writeFile("<?php\n\n" . $generatedCode, $fileName); + } catch (FileNotWritableException $fileNotWritable) { + restore_error_handler(); + + throw $fileNotWritable; + } + + restore_error_handler(); return $generatedCode; } + + /** + * Writes the source file in such a way that race conditions are avoided when the same file is written + * multiple times in a short time period + * + * @param string $source + * @param string $location + * + * @throws FileNotWritableException + */ + private function writeFile($source, $location) + { + $tmpFileName = $location . '.' . uniqid('', true); + + if (! file_put_contents($tmpFileName, $source)) { + throw FileNotWritableException::fromNonWritableLocation($tmpFileName); + } + + if (! rename($tmpFileName, $location)) { + unlink($tmpFileName); + + throw FileNotWritableException::fromInvalidMoveOperation($tmpFileName, $location); + } + } } diff --git a/vendor/ocramius/proxy-manager/tests/ProxyManagerTest/Exception/FileNotWritableExceptionTest.php b/vendor/ocramius/proxy-manager/tests/ProxyManagerTest/Exception/FileNotWritableExceptionTest.php new file mode 100644 index 00000000000..915b8f1bebb --- /dev/null +++ b/vendor/ocramius/proxy-manager/tests/ProxyManagerTest/Exception/FileNotWritableExceptionTest.php @@ -0,0 +1,72 @@ +<?php +/* + * 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 THE COPYRIGHT + * OWNER 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. + * + * This software consists of voluntary contributions made by many individuals + * and is licensed under the MIT license. + */ + +namespace ProxyManagerTest\Exception; + +use PHPUnit_Framework_TestCase; +use ProxyManager\Exception\FileNotWritableException; + +/** + * Tests for {@see \ProxyManager\Exception\FileNotWritableException} + * + * @author Marco Pivetta <ocramius@gmail.com> + * @license MIT + * + * @covers \ProxyManager\Exception\FileNotWritableException + * @group Coverage + */ +class FileNotWritableExceptionTest extends PHPUnit_Framework_TestCase +{ + public function testFromInvalidMoveOperation() + { + $exception = FileNotWritableException::fromInvalidMoveOperation('/tmp/a', '/tmp/b'); + + $this->assertInstanceOf('ProxyManager\\Exception\\FileNotWritableException', $exception); + $this->assertSame( + 'Could not move file "/tmp/a" to location "/tmp/b": either the source file is not readable,' + . ' or the destination is not writable', + $exception->getMessage() + ); + } + + public function testFromNotWritableLocationWithNonFilePath() + { + $exception = FileNotWritableException::fromNonWritableLocation(__DIR__); + + $this->assertInstanceOf('ProxyManager\\Exception\\FileNotWritableException', $exception); + $this->assertSame( + 'Could not write to path "' . __DIR__ . '": exists and is not a file', + $exception->getMessage() + ); + } + + public function testFromNotWritableLocationWithNonWritablePath() + { + $path = sys_get_temp_dir() . '/' . uniqid('FileNotWritableExceptionTestNonWritable', true); + + mkdir($path, 0555); + + $exception = FileNotWritableException::fromNonWritableLocation($path . '/foo'); + + $this->assertInstanceOf('ProxyManager\\Exception\\FileNotWritableException', $exception); + $this->assertSame( + 'Could not write to path "' . $path . '/foo": is not writable', + $exception->getMessage() + ); + } +} diff --git a/vendor/ocramius/proxy-manager/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php b/vendor/ocramius/proxy-manager/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php index 0e467c8e155..03eef8a50ec 100644 --- a/vendor/ocramius/proxy-manager/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php +++ b/vendor/ocramius/proxy-manager/tests/ProxyManagerTest/GeneratorStrategy/FileWriterGeneratorStrategyTest.php @@ -19,9 +19,10 @@ namespace ProxyManagerTest\GeneratorStrategy; use PHPUnit_Framework_TestCase; -use ProxyManager\GeneratorStrategy\FileWriterGeneratorStrategy; +use ProxyManager\Exception\FileNotWritableException; use ProxyManager\Generator\ClassGenerator; use ProxyManager\Generator\Util\UniqueIdentifierGenerator; +use ProxyManager\GeneratorStrategy\FileWriterGeneratorStrategy; /** * Tests for {@see \ProxyManager\GeneratorStrategy\FileWriterGeneratorStrategy} @@ -30,6 +31,8 @@ use ProxyManager\Generator\Util\UniqueIdentifierGenerator; * @license MIT * * @group Coverage + * + * Note: this test generates temporary files that are not deleted */ class FileWriterGeneratorStrategyTest extends PHPUnit_Framework_TestCase { @@ -39,9 +42,10 @@ class FileWriterGeneratorStrategyTest extends PHPUnit_Framework_TestCase */ public function testGenerate() { + /* @var $locator \ProxyManager\FileLocator\FileLocatorInterface|\PHPUnit_Framework_MockObject_MockObject */ $locator = $this->getMock('ProxyManager\\FileLocator\\FileLocatorInterface'); $generator = new FileWriterGeneratorStrategy($locator); - $tmpFile = sys_get_temp_dir() . '/FileWriterGeneratorStrategyTest' . uniqid() . '.php'; + $tmpFile = sys_get_temp_dir() . '/' . uniqid('FileWriterGeneratorStrategyTest', true) . '.php'; $namespace = 'Foo'; $className = UniqueIdentifierGenerator::getIdentifier('Bar'); $fqcn = $namespace . '\\' . $className; @@ -62,4 +66,83 @@ class FileWriterGeneratorStrategyTest extends PHPUnit_Framework_TestCase $this->assertTrue(class_exists($fqcn, false)); } + + public function testGenerateWillFailIfTmpFileCannotBeWrittenToDisk() + { + $tmpDirPath = sys_get_temp_dir() . '/' . uniqid('nonWritable', true); + + mkdir($tmpDirPath, 0555, true); + + /* @var $locator \ProxyManager\FileLocator\FileLocatorInterface|\PHPUnit_Framework_MockObject_MockObject */ + $locator = $this->getMock('ProxyManager\\FileLocator\\FileLocatorInterface'); + $generator = new FileWriterGeneratorStrategy($locator); + $tmpFile = $tmpDirPath . '/' . uniqid('FileWriterGeneratorStrategyFailedFileWriteTest', true) . '.php'; + $namespace = 'Foo'; + $className = UniqueIdentifierGenerator::getIdentifier('Bar'); + $fqcn = $namespace . '\\' . $className; + + $locator + ->expects($this->any()) + ->method('getProxyFileName') + ->with($fqcn) + ->will($this->returnValue($tmpFile)); + + $this->setExpectedException('ProxyManager\\Exception\\FileNotWritableException'); + $generator->generate(new ClassGenerator($fqcn)); + } + + public function testGenerateWillFailIfTmpFileCannotBeMovedToFinalDestination() + { + /* @var $locator \ProxyManager\FileLocator\FileLocatorInterface|\PHPUnit_Framework_MockObject_MockObject */ + $locator = $this->getMock('ProxyManager\\FileLocator\\FileLocatorInterface'); + $generator = new FileWriterGeneratorStrategy($locator); + $tmpFile = sys_get_temp_dir() . '/' . uniqid('FileWriterGeneratorStrategyFailedFileMoveTest', true) . '.php'; + $namespace = 'Foo'; + $className = UniqueIdentifierGenerator::getIdentifier('Bar'); + $fqcn = $namespace . '\\' . $className; + + $locator + ->expects($this->any()) + ->method('getProxyFileName') + ->with($fqcn) + ->will($this->returnValue($tmpFile)); + + mkdir($tmpFile); + + $this->setExpectedException('ProxyManager\\Exception\\FileNotWritableException'); + $generator->generate(new ClassGenerator($fqcn)); + } + + public function testWhenFailingAllTemporaryFilesAreRemoved() + { + $tmpDirPath = sys_get_temp_dir() . '/' . uniqid('noTempFilesLeftBehind', true); + + mkdir($tmpDirPath); + + /* @var $locator \ProxyManager\FileLocator\FileLocatorInterface|\PHPUnit_Framework_MockObject_MockObject */ + $locator = $this->getMock('ProxyManager\\FileLocator\\FileLocatorInterface'); + $generator = new FileWriterGeneratorStrategy($locator); + $tmpFile = $tmpDirPath . '/' . uniqid('FileWriterGeneratorStrategyFailedFileMoveTest', true) . '.php'; + $namespace = 'Foo'; + $className = UniqueIdentifierGenerator::getIdentifier('Bar'); + $fqcn = $namespace . '\\' . $className; + + $locator + ->expects($this->any()) + ->method('getProxyFileName') + ->with($fqcn) + ->will($this->returnValue($tmpFile)); + + mkdir($tmpFile); + + try { + $generator->generate(new ClassGenerator($fqcn)); + + $this->fail('An exception was supposed to be thrown'); + } catch (FileNotWritableException $exception) { + rmdir($tmpFile); + + $this->assertEquals(array('.', '..'), scandir($tmpDirPath)); + } + } } diff --git a/vendor/oyejorge/less.php/composer.json b/vendor/oyejorge/less.php/composer.json index 646cb199c9e..7724e3f2d99 100644 --- a/vendor/oyejorge/less.php/composer.json +++ b/vendor/oyejorge/less.php/composer.json @@ -19,7 +19,7 @@ } ], "require": { - "PHP" : ">=5.2" + "PHP" : ">=5.3" }, "autoload": { "psr-0": { "Less": "lib/" }, diff --git a/vendor/oyejorge/less.php/lib/Less/Cache.php b/vendor/oyejorge/less.php/lib/Less/Cache.php index e4023ef57c2..0ff2e164cd4 100755 --- a/vendor/oyejorge/less.php/lib/Less/Cache.php +++ b/vendor/oyejorge/less.php/lib/Less/Cache.php @@ -252,7 +252,7 @@ class Less_Cache{ continue; } - $full_path = Less_Cache::$cache_dir.'/'.$file; + $full_path = Less_Cache::$cache_dir . $file; // make sure the file still exists // css files may have already been deleted @@ -280,7 +280,7 @@ class Less_Cache{ if( $type === 'list' ){ self::ListFiles($full_path, $list, $css_file_name); if( $css_file_name ){ - $css_file = Less_Cache::$cache_dir.'/'.$css_file_name; + $css_file = Less_Cache::$cache_dir . $css_file_name; if( file_exists($css_file) ){ unlink($css_file); } @@ -313,4 +313,4 @@ class Less_Cache{ } -} \ No newline at end of file +} diff --git a/vendor/oyejorge/less.php/lib/Less/Functions.php b/vendor/oyejorge/less.php/lib/Less/Functions.php index 8b1fa2f513e..ead64ced950 100755 --- a/vendor/oyejorge/less.php/lib/Less/Functions.php +++ b/vendor/oyejorge/less.php/lib/Less/Functions.php @@ -704,7 +704,7 @@ class Less_Functions{ if( $order[$j]->unit->toString() === "" && $unitClone ){ $temp = new Less_Tree_Dimension( $order[$j]->value, $unitClone); - $referenceUnified = $temp->unifiy(); + $referenceUnified = $temp->unify(); }else{ $referenceUnified = $order[$j]->unify(); } diff --git a/vendor/oyejorge/less.php/lib/Less/Parser.php b/vendor/oyejorge/less.php/lib/Less/Parser.php index 52ec8d67a5e..2217c860806 100755 --- a/vendor/oyejorge/less.php/lib/Less/Parser.php +++ b/vendor/oyejorge/less.php/lib/Less/Parser.php @@ -53,7 +53,7 @@ class Less_Parser{ */ private $env; - private $rules = array(); + protected $rules = array(); private static $imports = array(); diff --git a/vendor/oyejorge/less.php/lib/Less/SourceMap/Generator.php b/vendor/oyejorge/less.php/lib/Less/SourceMap/Generator.php index ac5f2c92776..cc9e65f369d 100755 --- a/vendor/oyejorge/less.php/lib/Less/SourceMap/Generator.php +++ b/vendor/oyejorge/less.php/lib/Less/SourceMap/Generator.php @@ -91,13 +91,9 @@ class Less_SourceMap_Generator extends Less_Configurable { $this->encoder = new Less_SourceMap_Base64VLQ(); $this->SetOptions($options); - - - // fix windows paths - if( !empty($this->options['sourceMapRootpath']) ){ - $this->options['sourceMapRootpath'] = str_replace('\\', '/', $this->options['sourceMapRootpath']); - $this->options['sourceMapRootpath'] = rtrim($this->options['sourceMapRootpath'],'/').'/'; - } + + $this->options['sourceMapRootpath'] = $this->fixWindowsPath($this->options['sourceMapRootpath'], true); + $this->options['sourceMapBasepath'] = $this->fixWindowsPath($this->options['sourceMapBasepath'], true); } /** @@ -167,7 +163,8 @@ class Less_SourceMap_Generator extends Less_Configurable { */ protected function normalizeFilename($filename){ - $filename = str_replace('\\', '/', $filename); + $filename = $this->fixWindowsPath($filename); + $rootpath = $this->getOption('sourceMapRootpath'); $basePath = $this->getOption('sourceMapBasepath'); @@ -350,4 +347,19 @@ class Less_SourceMap_Generator extends Less_Configurable { return $this->source_keys[$filename]; } + /** + * fix windows paths + * @param string $path + * @return string + */ + public function fixWindowsPath($path, $addEndSlash = false){ + $slash = ($addEndSlash) ? '/' : ''; + if( !empty($path) ){ + $path = str_replace('\\', '/', $path); + $path = rtrim($path,'/') . $slash; + } + + return $path; + } + } \ No newline at end of file diff --git a/vendor/oyejorge/less.php/lib/Less/Version.php b/vendor/oyejorge/less.php/lib/Less/Version.php index 99a45857496..fdbe5794f4c 100755 --- a/vendor/oyejorge/less.php/lib/Less/Version.php +++ b/vendor/oyejorge/less.php/lib/Less/Version.php @@ -8,7 +8,7 @@ */ class Less_Version{ - const version = '1.7.0.4'; // The current build number of less.php + const version = '1.7.0.5'; // The current build number of less.php const less_version = '1.7'; // The less.js version that this build should be compatible with const cache_version = '170'; // The parser cache version diff --git a/vendor/pear-pear.php.net/Archive_Tar/Archive/Tar.php b/vendor/pear-pear.php.net/Archive_Tar/Archive/Tar.php index 7ff17164d6c..07550e691ad 100644 --- a/vendor/pear-pear.php.net/Archive_Tar/Archive/Tar.php +++ b/vendor/pear-pear.php.net/Archive_Tar/Archive/Tar.php @@ -78,44 +78,43 @@ class Archive_Tar extends PEAR /** * @var string Name of the Tar */ - var $_tarname = ''; + public $_tarname = ''; /** * @var boolean if true, the Tar file will be gzipped */ - var $_compress = false; + public $_compress = false; /** * @var string Type of compression : 'none', 'gz', 'bz2' or 'lzma2' */ - var $_compress_type = 'none'; + public $_compress_type = 'none'; /** * @var string Explode separator */ - var $_separator = ' '; + public $_separator = ' '; /** * @var file descriptor */ - var $_file = 0; + public $_file = 0; /** * @var string Local Tar name of a remote Tar (http:// or ftp://) */ - var $_temp_tarname = ''; + public $_temp_tarname = ''; /** * @var string regular expression for ignoring files or directories */ - var $_ignore_regexp = ''; + public $_ignore_regexp = ''; /** * @var object PEAR_Error object */ - var $error_object = null; + public $error_object = null; - // {{{ constructor /** * Archive_Tar Class constructor. This flavour of the constructor only * declare a new Archive_Tar object, identifying it by the name of the @@ -129,13 +128,12 @@ class Archive_Tar extends PEAR * is required. For compatibility reason the * boolean value 'true' means 'gz'. * - * @access public + * @return bool */ - function Archive_Tar($p_tarname, $p_compress = null) + public function __construct($p_tarname, $p_compress = null) { - if (version_compare(PHP_VERSION, '5.0.0', '<')) { - $this->PEAR(); - } + parent::__construct(); + $this->_compress = false; $this->_compress_type = 'none'; if (($p_compress === null) || ($p_compress == '')) { @@ -224,30 +222,15 @@ class Archive_Tar extends PEAR } } - // }}} - - // {{{ destructor - function _Archive_Tar() + public function __destruct() { $this->_close(); // ----- Look for a local copy to delete if ($this->_temp_tarname != '') { @unlink($this->_temp_tarname); } - $this->_PEAR(); - } - - // }}} - - // {{{ PHP5-compatible destructor - function __destruct() - { - $this->_Archive_Tar(); } - // }}} - - // {{{ create() /** * This method creates the archive file and add the files / directories * that are listed in $p_filelist. @@ -268,16 +251,12 @@ class Archive_Tar extends PEAR * * @return true on success, false on error. * @see createModify() - * @access public */ - function create($p_filelist) + public function create($p_filelist) { return $this->createModify($p_filelist, '', ''); } - // }}} - - // {{{ add() /** * This method add the files / directories that are listed in $p_filelist in * the archive. If the archive does not exist it is created. @@ -294,23 +273,25 @@ class Archive_Tar extends PEAR * @see createModify() * @access public */ - function add($p_filelist) + public function add($p_filelist) { return $this->addModify($p_filelist, '', ''); } - // }}} - - // {{{ extract() - function extract($p_path = '', $p_preserve = false) + /** + * @param string $p_path + * @param bool $p_preserve + * @return bool + */ + public function extract($p_path = '', $p_preserve = false) { return $this->extractModify($p_path, '', $p_preserve); } - // }}} - - // {{{ listContent() - function listContent() + /** + * @return array|int + */ + public function listContent() { $v_list_detail = array(); @@ -325,9 +306,6 @@ class Archive_Tar extends PEAR return $v_list_detail; } - // }}} - - // {{{ createModify() /** * This method creates the archive file and add the files / directories * that are listed in $p_filelist. @@ -361,10 +339,9 @@ class Archive_Tar extends PEAR * element in the list, when relevant. * * @return boolean true on success, false on error. - * @access public * @see addModify() */ - function createModify($p_filelist, $p_add_dir, $p_remove_dir = '') + public function createModify($p_filelist, $p_add_dir, $p_remove_dir = '') { $v_result = true; @@ -396,9 +373,6 @@ class Archive_Tar extends PEAR return $v_result; } - // }}} - - // {{{ addModify() /** * This method add the files / directories listed in $p_filelist at the * end of the existing archive. If the archive does not yet exists it @@ -438,9 +412,8 @@ class Archive_Tar extends PEAR * relevant. * * @return true on success, false on error. - * @access public */ - function addModify($p_filelist, $p_add_dir, $p_remove_dir = '') + public function addModify($p_filelist, $p_add_dir, $p_remove_dir = '') { $v_result = true; @@ -466,9 +439,6 @@ class Archive_Tar extends PEAR return $v_result; } - // }}} - - // {{{ addString() /** * This method add a single string as a file at the * end of the existing archive. If the archive does not yet exists it @@ -479,7 +449,7 @@ class Archive_Tar extends PEAR * with the string. * @param string $p_string The content of the file added in * the archive. - * @param int $p_datetime A custom date/time (unix timestamp) + * @param bool|int $p_datetime A custom date/time (unix timestamp) * for the file (optional). * @param array $p_params An array of optional params: * stamp => the datetime (replaces @@ -495,9 +465,8 @@ class Archive_Tar extends PEAR * (default = 0 = root) * * @return true on success, false on error. - * @access public */ - function addString($p_filename, $p_string, $p_datetime = false, $p_params = array()) + public function addString($p_filename, $p_string, $p_datetime = false, $p_params = array()) { $p_stamp = @$p_params["stamp"] ? $p_params["stamp"] : ($p_datetime ? $p_datetime : time()); $p_mode = @$p_params["mode"] ? $p_params["mode"] : 0600; @@ -527,9 +496,6 @@ class Archive_Tar extends PEAR return $v_result; } - // }}} - - // {{{ extractModify() /** * This method extract all the content of the archive in the directory * indicated by $p_path. When relevant the memorized path of the @@ -562,10 +528,9 @@ class Archive_Tar extends PEAR * @param boolean $p_preserve Preserve user/group ownership of files * * @return boolean true on success, false on error. - * @access public * @see extractList() */ - function extractModify($p_path, $p_remove_path, $p_preserve = false) + public function extractModify($p_path, $p_remove_path, $p_preserve = false) { $v_result = true; $v_list_detail = array(); @@ -585,9 +550,6 @@ class Archive_Tar extends PEAR return $v_result; } - // }}} - - // {{{ extractInString() /** * This method extract from the archive one file identified by $p_filename. * The return value is a string with the file content, or NULL on error. @@ -595,9 +557,8 @@ class Archive_Tar extends PEAR * @param string $p_filename The path of the file to extract in a string. * * @return a string with the file content or NULL. - * @access public */ - function extractInString($p_filename) + public function extractInString($p_filename) { if ($this->_openRead()) { $v_result = $this->_extractInString($p_filename); @@ -609,9 +570,6 @@ class Archive_Tar extends PEAR return $v_result; } - // }}} - - // {{{ extractList() /** * This method extract from the archive only the files indicated in the * $p_filelist. These files are extracted in the current directory or @@ -630,10 +588,9 @@ class Archive_Tar extends PEAR * @param boolean $p_preserve Preserve user/group ownership of files * * @return true on success, false on error. - * @access public * @see extractModify() */ - function extractList($p_filelist, $p_path = '', $p_remove_path = '', $p_preserve = false) + public function extractList($p_filelist, $p_path = '', $p_remove_path = '', $p_preserve = false) { $v_result = true; $v_list_detail = array(); @@ -662,20 +619,14 @@ class Archive_Tar extends PEAR return $v_result; } - // }}} - - // {{{ setAttribute() /** * This method set specific attributes of the archive. It uses a variable * list of parameters, in the format attribute code + attribute values : * $arch->setAttribute(ARCHIVE_TAR_ATT_SEPARATOR, ','); * - * @param mixed $argv variable list of attributes and values - * * @return true on success, false on error. - * @access public */ - function setAttribute() + public function setAttribute() { $v_result = true; @@ -721,26 +672,18 @@ class Archive_Tar extends PEAR return $v_result; } - // }}} - - // {{{ setIgnoreRegexp() /** * This method sets the regular expression for ignoring files and directories * at import, for example: * $arch->setIgnoreRegexp("#CVS|\.svn#"); * * @param string $regexp regular expression defining which files or directories to ignore - * - * @access public */ - function setIgnoreRegexp($regexp) + public function setIgnoreRegexp($regexp) { $this->_ignore_regexp = $regexp; } - // }}} - - // {{{ setIgnoreList() /** * This method sets the regular expression for ignoring all files and directories * matching the filenames in the array list at import, for example: @@ -750,33 +693,34 @@ class Archive_Tar extends PEAR * * @access public */ - function setIgnoreList($list) + public function setIgnoreList($list) { $regexp = str_replace(array('#', '.', '^', '$'), array('\#', '\.', '\^', '\$'), $list); $regexp = '#/' . join('$|/', $list) . '#'; $this->setIgnoreRegexp($regexp); } - // }}} - - // {{{ _error() - function _error($p_message) + /** + * @param string $p_message + */ + public function _error($p_message) { - $this->error_object = & $this->raiseError($p_message); + $this->error_object = $this->raiseError($p_message); } - // }}} - - // {{{ _warning() - function _warning($p_message) + /** + * @param string $p_message + */ + public function _warning($p_message) { - $this->error_object = & $this->raiseError($p_message); + $this->error_object = $this->raiseError($p_message); } - // }}} - - // {{{ _isArchive() - function _isArchive($p_filename = null) + /** + * @param string $p_filename + * @return bool + */ + public function _isArchive($p_filename = null) { if ($p_filename == null) { $p_filename = $this->_tarname; @@ -785,10 +729,10 @@ class Archive_Tar extends PEAR return @is_file($p_filename) && !@is_link($p_filename); } - // }}} - - // {{{ _openWrite() - function _openWrite() + /** + * @return bool + */ + public function _openWrite() { if ($this->_compress_type == 'gz' && function_exists('gzopen')) { $this->_file = @gzopen($this->_tarname, "wb9"); @@ -823,10 +767,10 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _openRead() - function _openRead() + /** + * @return bool + */ + public function _openRead() { if (strtolower(substr($this->_tarname, 0, 7)) == 'http://') { @@ -858,9 +802,9 @@ class Archive_Tar extends PEAR // ----- File to open if the local copy $v_filename = $this->_temp_tarname; + } else { + // ----- File to open if the normal Tar file - } else // ----- File to open if the normal Tar file - { $v_filename = $this->_tarname; } @@ -894,10 +838,10 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _openReadWrite() - function _openReadWrite() + /** + * @return bool + */ + public function _openReadWrite() { if ($this->_compress_type == 'gz') { $this->_file = @gzopen($this->_tarname, "r+b"); @@ -940,10 +884,10 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _close() - function _close() + /** + * @return bool + */ + public function _close() { //if (isset($this->_file)) { if (is_resource($this->_file)) { @@ -981,10 +925,10 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _cleanFile() - function _cleanFile() + /** + * @return bool + */ + public function _cleanFile() { $this->_close(); @@ -1002,10 +946,12 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _writeBlock() - function _writeBlock($p_binary_data, $p_len = null) + /** + * @param mixed $p_binary_data + * @param integer $p_len + * @return bool + */ + public function _writeBlock($p_binary_data, $p_len = null) { if (is_resource($this->_file)) { if ($p_len === null) { @@ -1050,16 +996,15 @@ class Archive_Tar extends PEAR } } } - } } return true; } - // }}} - - // {{{ _readBlock() - function _readBlock() + /** + * @return null|string + */ + public function _readBlock() { $v_block = null; if (is_resource($this->_file)) { @@ -1087,10 +1032,11 @@ class Archive_Tar extends PEAR return $v_block; } - // }}} - - // {{{ _jumpBlock() - function _jumpBlock($p_len = null) + /** + * @param null $p_len + * @return bool + */ + public function _jumpBlock($p_len = null) { if (is_resource($this->_file)) { if ($p_len === null) { @@ -1123,15 +1069,14 @@ class Archive_Tar extends PEAR } } } - } return true; } - // }}} - - // {{{ _writeFooter() - function _writeFooter() + /** + * @return bool + */ + public function _writeFooter() { if (is_resource($this->_file)) { // ----- Write the last 0 filled block for end of archive @@ -1141,10 +1086,13 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _addList() - function _addList($p_list, $p_add_dir, $p_remove_dir) + /** + * @param array $p_list + * @param string $p_add_dir + * @param string $p_remove_dir + * @return bool + */ + public function _addList($p_list, $p_add_dir, $p_remove_dir) { $v_result = true; $v_header = array(); @@ -1222,10 +1170,15 @@ class Archive_Tar extends PEAR return $v_result; } - // }}} - - // {{{ _addFile() - function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir, $v_stored_filename = null) + /** + * @param string $p_filename + * @param mixed $p_header + * @param string $p_add_dir + * @param string $p_remove_dir + * @param null $v_stored_filename + * @return bool + */ + public function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir, $v_stored_filename = null) { if (!$this->_file) { $this->_error('Invalid file descriptor'); @@ -1239,7 +1192,7 @@ class Archive_Tar extends PEAR if (is_null($v_stored_filename)) { // ----- Calculate the stored filename - $p_filename = $this->_translateWinPath($p_filename, false);; + $p_filename = $this->_translateWinPath($p_filename, false); $v_stored_filename = $p_filename; if (strcmp($p_filename, $p_remove_dir) == 0) { @@ -1287,7 +1240,6 @@ class Archive_Tar extends PEAR } fclose($v_file); - } else { // ----- Only header for dir if (!$this->_writeHeader($p_filename, $v_stored_filename)) { @@ -1298,10 +1250,14 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _addString() - function _addString($p_filename, $p_string, $p_datetime = false, $p_params = array()) + /** + * @param string $p_filename + * @param string $p_string + * @param bool $p_datetime + * @param array $p_params + * @return bool + */ + public function _addString($p_filename, $p_string, $p_datetime = false, $p_params = array()) { $p_stamp = @$p_params["stamp"] ? $p_params["stamp"] : ($p_datetime ? $p_datetime : time()); $p_mode = @$p_params["mode"] ? $p_params["mode"] : 0600; @@ -1319,7 +1275,7 @@ class Archive_Tar extends PEAR } // ----- Calculate the stored filename - $p_filename = $this->_translateWinPath($p_filename, false);; + $p_filename = $this->_translateWinPath($p_filename, false); // ----- If datetime is not specified, set current time if ($p_datetime === false) { @@ -1348,10 +1304,12 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _writeHeader() - function _writeHeader($p_filename, $p_stored_filename) + /** + * @param string $p_filename + * @param string $p_stored_filename + * @return bool + */ + public function _writeHeader($p_filename, $p_stored_filename) { if ($p_stored_filename == '') { $p_stored_filename = $p_filename; @@ -1459,10 +1417,17 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _writeHeaderBlock() - function _writeHeaderBlock( + /** + * @param string $p_filename + * @param int $p_size + * @param int $p_mtime + * @param int $p_perms + * @param string $p_type + * @param int $p_uid + * @param int $p_gid + * @return bool + */ + public function _writeHeaderBlock( $p_filename, $p_size, $p_mtime = 0, @@ -1566,10 +1531,11 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _writeLongHeader() - function _writeLongHeader($p_filename) + /** + * @param string $p_filename + * @return bool + */ + public function _writeLongHeader($p_filename) { $v_size = sprintf("%11s ", DecOct(strlen($p_filename))); @@ -1650,10 +1616,12 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _readHeader() - function _readHeader($v_binary_data, &$v_header) + /** + * @param mixed $v_binary_data + * @param mixed $v_header + * @return bool + */ + public function _readHeader($v_binary_data, &$v_header) { if (strlen($v_binary_data) == 0) { $v_header['filename'] = ''; @@ -1736,7 +1704,7 @@ class Archive_Tar extends PEAR } $v_header['link'] = trim($v_data['link']); /* ----- All these fields are removed form the header because - they do not carry interesting info + they do not carry interesting info $v_header[magic] = trim($v_data[magic]); $v_header[version] = trim($v_data[version]); $v_header[uname] = trim($v_data[uname]); @@ -1748,18 +1716,14 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _maliciousFilename() /** * Detect and report a malicious file name * * @param string $file * * @return bool - * @access private */ - function _maliciousFilename($file) + private function _maliciousFilename($file) { if (strpos($file, '/../') !== false) { return true; @@ -1770,10 +1734,11 @@ class Archive_Tar extends PEAR return false; } - // }}} - - // {{{ _readLongHeader() - function _readLongHeader(&$v_header) + /** + * @param $v_header + * @return bool + */ + public function _readLongHeader(&$v_header) { $v_filename = ''; $v_filesize = $v_header['size']; @@ -1807,9 +1772,6 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _extractInString() /** * This method extract from the archive one file identified by $p_filename. * The return value is a string with the file content, or null on error. @@ -1817,13 +1779,12 @@ class Archive_Tar extends PEAR * @param string $p_filename The path of the file to extract in a string. * * @return a string with the file content or null. - * @access private */ - function _extractInString($p_filename) + private function _extractInString($p_filename) { $v_result_str = ""; - While (strlen($v_binary_data = $this->_readBlock()) != 0) { + while (strlen($v_binary_data = $this->_readBlock()) != 0) { if (!$this->_readHeader($v_binary_data, $v_header)) { return null; } @@ -1869,10 +1830,16 @@ class Archive_Tar extends PEAR return null; } - // }}} - - // {{{ _extractList() - function _extractList( + /** + * @param string $p_path + * @param string $p_list_detail + * @param string $p_mode + * @param string $p_file_list + * @param string $p_remove_path + * @param bool $p_preserve + * @return bool + */ + public function _extractList( $p_path, &$p_list_detail, $p_mode, @@ -2148,10 +2115,10 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _openAppend() - function _openAppend() + /** + * @return bool + */ + public function _openAppend() { if (filesize($this->_tarname) == 0) { return $this->_openWrite(); @@ -2261,7 +2228,6 @@ class Archive_Tar extends PEAR . $this->_tarname . '.tmp\'' ); } - } else { // ----- For not compressed tar, just add files before the last // one or two 512 bytes block @@ -2286,10 +2252,13 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _append() - function _append($p_filelist, $p_add_dir = '', $p_remove_dir = '') + /** + * @param $p_filelist + * @param string $p_add_dir + * @param string $p_remove_dir + * @return bool + */ + public function _append($p_filelist, $p_add_dir = '', $p_remove_dir = '') { if (!$this->_openAppend()) { return false; @@ -2304,10 +2273,6 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _dirCheck() - /** * Check if a directory exists and create it (including parent * dirs) if not. @@ -2316,7 +2281,7 @@ class Archive_Tar extends PEAR * * @return bool true if the directory exists or was created */ - function _dirCheck($p_dir) + public function _dirCheck($p_dir) { clearstatcache(); if ((@is_dir($p_dir)) || ($p_dir == '')) { @@ -2340,10 +2305,6 @@ class Archive_Tar extends PEAR return true; } - // }}} - - // {{{ _pathReduction() - /** * Compress path by changing for example "/dir/foo/../bar" to "/dir/bar", * rand emove double slashes. @@ -2351,11 +2312,8 @@ class Archive_Tar extends PEAR * @param string $p_dir path to reduce * * @return string reduced path - * - * @access private - * */ - function _pathReduction($p_dir) + private function _pathReduction($p_dir) { $v_result = ''; @@ -2397,10 +2355,12 @@ class Archive_Tar extends PEAR return $v_result; } - // }}} - - // {{{ _translateWinPath() - function _translateWinPath($p_path, $p_remove_disk_letter = true) + /** + * @param $p_path + * @param bool $p_remove_disk_letter + * @return string + */ + public function _translateWinPath($p_path, $p_remove_disk_letter = true) { if (defined('OS_WINDOWS') && OS_WINDOWS) { // ----- Look for potential disk letter @@ -2416,8 +2376,4 @@ class Archive_Tar extends PEAR } return $p_path; } - // }}} - } - -?> diff --git a/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Node.php b/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Node.php index 21c76301ced..a4b917bb3e6 100644 --- a/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Node.php +++ b/vendor/pear-pear.php.net/Structures_Graph/Structures/Graph/Node.php @@ -75,7 +75,7 @@ class Structures_Graph_Node { * * @access public */ - function Structures_Graph_Node() { + function __construct() { } /* }}} */ diff --git a/vendor/symfony/process/PhpExecutableFinder.php b/vendor/symfony/process/PhpExecutableFinder.php index 91d6d78a670..f8f57cc536a 100644 --- a/vendor/symfony/process/PhpExecutableFinder.php +++ b/vendor/symfony/process/PhpExecutableFinder.php @@ -37,7 +37,7 @@ class PhpExecutableFinder { // HHVM support if (defined('HHVM_VERSION')) { - return (false !== ($hhvm = getenv('PHP_BINARY')) ? $hhvm : PHP_BINARY).($includeArgs ? ' '.implode(' ', $this->findArguments()) : ''); + return (getenv('PHP_BINARY') ?: PHP_BINARY).($includeArgs ? ' '.implode(' ', $this->findArguments()) : ''); } // PHP_BINARY return the current sapi executable diff --git a/vendor/symfony/process/ProcessUtils.php b/vendor/symfony/process/ProcessUtils.php index ef36a3f4ed5..4f30b630dcf 100644 --- a/vendor/symfony/process/ProcessUtils.php +++ b/vendor/symfony/process/ProcessUtils.php @@ -49,7 +49,7 @@ class ProcessUtils $escapedArgument = ''; $quote = false; - foreach (preg_split('/(")/i', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) { + foreach (preg_split('/(")/', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) { if ('"' === $part) { $escapedArgument .= '\\"'; } elseif (self::isSurroundedBy($part, '%')) { diff --git a/vendor/symfony/process/Tests/AbstractProcessTest.php b/vendor/symfony/process/Tests/AbstractProcessTest.php index 2a4d583cb2b..2add8cc9385 100644 --- a/vendor/symfony/process/Tests/AbstractProcessTest.php +++ b/vendor/symfony/process/Tests/AbstractProcessTest.php @@ -11,21 +11,30 @@ namespace Symfony\Component\Process\Tests; -use Symfony\Component\Process\Exception\ProcessTimedOutException; use Symfony\Component\Process\Exception\LogicException; +use Symfony\Component\Process\Exception\ProcessTimedOutException; +use Symfony\Component\Process\Exception\RuntimeException; +use Symfony\Component\Process\PhpExecutableFinder; use Symfony\Component\Process\Pipes\PipesInterface; use Symfony\Component\Process\Process; -use Symfony\Component\Process\Exception\RuntimeException; /** * @author Robert Schönthal <seroscho@googlemail.com> */ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase { + protected static $phpBin; + + public static function setUpBeforeClass() + { + $phpBin = new PhpExecutableFinder(); + self::$phpBin = $phpBin->find(); + } + public function testThatProcessDoesNotThrowWarningDuringRun() { @trigger_error('Test Error', E_USER_NOTICE); - $process = $this->getProcess("php -r 'sleep(3)'"); + $process = $this->getProcess(self::$phpBin." -r 'sleep(3)'"); $process->run(); $actualError = error_get_last(); $this->assertEquals('Test Error', $actualError['message']); @@ -95,7 +104,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $expectedOutputSize = PipesInterface::CHUNK_SIZE * 2 + 2; $code = sprintf('echo str_repeat(\'*\', %d);', $expectedOutputSize); - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg($code))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg($code))); $p->start(); // Let's wait enough time for process to finish... @@ -134,7 +143,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase */ public function testProcessResponses($expected, $getter, $code) { - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg($code))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg($code))); $p->run(); $this->assertSame($expected, $p->$getter()); @@ -150,7 +159,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $expected = str_repeat(str_repeat('*', 1024), $size).'!'; $expectedLength = (1024 * $size) + 1; - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg($code))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg($code))); $p->setInput($expected); $p->run(); @@ -170,7 +179,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase fwrite($stream, $expected); rewind($stream); - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg($code))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg($code))); $p->setInput($stream); $p->run(); @@ -182,7 +191,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testSetInputWhileRunningThrowsAnException() { - $process = $this->getProcess('php -r "usleep(500000);"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $process->start(); try { $process->setInput('foobar'); @@ -201,7 +210,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase */ public function testInvalidInput($value) { - $process = $this->getProcess('php -v'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->setInput($value); } @@ -218,7 +227,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase */ public function testValidInput($expected, $value) { - $process = $this->getProcess('php -v'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->setInput($value); $this->assertSame($expected, $process->getInput()); } @@ -238,9 +247,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase */ public function testLegacyValidInput($expected, $value) { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - - $process = $this->getProcess('php -v'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->setInput($value); $this->assertSame($expected, $process->getInput()); } @@ -278,7 +285,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testCallbackIsExecutedForOutput() { - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('echo \'foo\';'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('echo \'foo\';'))); $called = false; $p->run(function ($type, $buffer) use (&$called) { @@ -290,7 +297,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testGetErrorOutput() { - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }'))); $p->run(); $this->assertEquals(3, preg_match_all('/ERROR/', $p->getErrorOutput(), $matches)); @@ -303,7 +310,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $lock = tempnam(sys_get_temp_dir(), get_class($this).'Lock'); file_put_contents($lock, 'W'); - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); $p->start(); while ($p->isRunning()) { @@ -319,7 +326,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testFlushErrorOutput() { - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }'))); $p->run(); $p->clearErrorOutput(); @@ -333,7 +340,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $lock = tempnam(sys_get_temp_dir(), get_class($this).'Lock'); file_put_contents($lock, 'W'); - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); $p->start(); @@ -359,7 +366,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testGetOutput() { - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { echo \' foo \'; $n++; }'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 0; while ($n < 3) { echo \' foo \'; $n++; }'))); $p->run(); $this->assertEquals(3, preg_match_all('/foo/', $p->getOutput(), $matches)); @@ -372,7 +379,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $lock = tempnam(sys_get_temp_dir(), get_class($this).'Lock'); file_put_contents($lock, 'W'); - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { echo \' foo \'; $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { echo \' foo \'; $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); $p->start(); while ($p->isRunning()) { @@ -388,7 +395,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testFlushOutput() { - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n=0;while ($n<3) {echo \' foo \';$n++;}'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n=0;while ($n<3) {echo \' foo \';$n++;}'))); $p->run(); $p->clearOutput(); @@ -402,7 +409,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $lock = tempnam(sys_get_temp_dir(), get_class($this).'Lock'); file_put_contents($lock, 'W'); - $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { echo \' foo \'; $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); + $p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 0; while ($n < 3) { if (\'W\' === file_get_contents('.var_export($lock, true).')) { echo \' foo \'; $n++; file_put_contents('.var_export($lock, true).', \'R\'); } usleep(100); }'))); $p->start(); @@ -548,7 +555,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testStartIsNonBlocking() { - $process = $this->getProcess('php -r "usleep(500000);"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $start = microtime(true); $process->start(); $end = microtime(true); @@ -558,14 +565,14 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testUpdateStatus() { - $process = $this->getProcess('php -h'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $this->assertTrue(strlen($process->getOutput()) > 0); } public function testGetExitCodeIsNullOnStart() { - $process = $this->getProcess('php -r "usleep(200000);"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(200000);"'); $this->assertNull($process->getExitCode()); $process->start(); $this->assertNull($process->getExitCode()); @@ -575,7 +582,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testGetExitCodeIsNullOnWhenStartingAgain() { - $process = $this->getProcess('php -r "usleep(200000);"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(200000);"'); $process->run(); $this->assertEquals(0, $process->getExitCode()); $process->start(); @@ -586,14 +593,14 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testGetExitCode() { - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $this->assertSame(0, $process->getExitCode()); } public function testStatus() { - $process = $this->getProcess('php -r "usleep(500000);"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $this->assertFalse($process->isRunning()); $this->assertFalse($process->isStarted()); $this->assertFalse($process->isTerminated()); @@ -612,7 +619,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testStop() { - $process = $this->getProcess('php -r "sleep(4);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(4);"'); $process->start(); $this->assertTrue($process->isRunning()); $process->stop(); @@ -621,14 +628,14 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testIsSuccessful() { - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $this->assertTrue($process->isSuccessful()); } public function testIsSuccessfulOnlyAfterTerminated() { - $process = $this->getProcess('php -r "sleep(1);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(1);"'); $process->start(); while ($process->isRunning()) { $this->assertFalse($process->isSuccessful()); @@ -640,7 +647,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testIsNotSuccessful() { - $process = $this->getProcess('php -r "usleep(500000);throw new \Exception(\'BOUM\');"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(500000);throw new \Exception(\'BOUM\');"'); $process->start(); $this->assertTrue($process->isRunning()); $process->wait(); @@ -653,7 +660,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('Windows does not support POSIX signals'); } - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $this->assertFalse($process->hasBeenSignaled()); } @@ -664,7 +671,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('Windows does not support POSIX signals'); } - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $this->assertFalse($process->hasBeenSignaled()); } @@ -675,7 +682,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('Windows does not support POSIX signals'); } - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $this->assertEquals(0, $process->getTermSignal()); } @@ -686,7 +693,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('Windows does not support POSIX signals'); } - $process = $this->getProcess('php -r "sleep(4);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(4);"'); $process->start(); $process->stop(); $this->assertTrue($process->hasBeenSignaled()); @@ -701,7 +708,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase // SIGTERM is only defined if pcntl extension is present $termSignal = defined('SIGTERM') ? SIGTERM : 15; - $process = $this->getProcess('php -r "sleep(4);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(4);"'); $process->start(); $process->stop(); @@ -730,7 +737,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testRestart() { - $process1 = $this->getProcess('php -r "echo getmypid();"'); + $process1 = $this->getProcess(self::$phpBin.' -r "echo getmypid();"'); $process1->run(); $process2 = $process1->restart(); @@ -752,7 +759,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase // Sleep doesn't work as it will allow the process to handle signals and close // file handles from the other end. - $process = $this->getProcess('php -r "while (true) {}"'); + $process = $this->getProcess(self::$phpBin.' -r "while (true) {}"'); $process->start(); // PHP will deadlock when it tries to cleanup $process @@ -761,7 +768,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testRunProcessWithTimeout() { $timeout = 0.5; - $process = $this->getProcess('php -r "usleep(600000);"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(600000);"'); $process->setTimeout($timeout); $start = microtime(true); try { @@ -783,13 +790,13 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testCheckTimeoutOnNonStartedProcess() { - $process = $this->getProcess('php -r "sleep(3);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(3);"'); $process->checkTimeout(); } public function testCheckTimeoutOnTerminatedProcess() { - $process = $this->getProcess('php -v'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $process->checkTimeout(); } @@ -798,7 +805,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase { $timeout = 0.5; $precision = 100000; - $process = $this->getProcess('php -r "sleep(3);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(3);"'); $process->setTimeout($timeout); $start = microtime(true); @@ -820,7 +827,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testIdleTimeout() { - $process = $this->getProcess('php -r "sleep(3);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(3);"'); $process->setTimeout(10); $process->setIdleTimeout(0.5); @@ -837,7 +844,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testIdleTimeoutNotExceededWhenOutputIsSent() { - $process = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 30; while ($n--) {echo "foo\n"; usleep(100000); }'))); + $process = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 30; while ($n--) {echo "foo\n"; usleep(100000); }'))); $process->setTimeout(2); $process->setIdleTimeout(1); @@ -853,7 +860,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testStartAfterATimeout() { - $process = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 1000; while ($n--) {echo \'\'; usleep(1000); }'))); + $process = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg('$n = 1000; while ($n--) {echo \'\'; usleep(1000); }'))); $process->setTimeout(0.1); try { @@ -868,7 +875,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testGetPid() { - $process = $this->getProcess('php -r "usleep(500000);"'); + $process = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $process->start(); $this->assertGreaterThan(0, $process->getPid()); $process->wait(); @@ -876,13 +883,13 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testGetPidIsNullBeforeStart() { - $process = $this->getProcess('php -r "sleep(1);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(1);"'); $this->assertNull($process->getPid()); } public function testGetPidIsNullAfterRun() { - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->run(); $this->assertNull($process->getPid()); } @@ -927,7 +934,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testSignalProcessNotRunning() { $this->verifyPosixIsEnabled(); - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $process->signal(SIGHUP); } @@ -936,7 +943,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase */ public function testMethodsThatNeedARunningProcess($method) { - $process = $this->getProcess('php -m'); + $process = $this->getProcess(self::$phpBin.' -v'); $this->setExpectedException('Symfony\Component\Process\Exception\LogicException', sprintf('Process must be started before calling %s.', $method)); $process->{$method}(); } @@ -957,7 +964,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase */ public function testMethodsThatNeedATerminatedProcess($method) { - $process = $this->getProcess('php -r "sleep(1);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(1);"'); $process->start(); try { $process->{$method}(); @@ -999,7 +1006,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('POSIX signals do not work on Windows'); } - $process = $this->getProcess('php -r "sleep(3);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(3);"'); $process->start(); $process->signal(-4); } @@ -1013,14 +1020,14 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('POSIX signals do not work on Windows'); } - $process = $this->getProcess('php -r "sleep(3);"'); + $process = $this->getProcess(self::$phpBin.' -r "sleep(3);"'); $process->start(); $process->signal('Céphalopodes'); } public function testDisableOutputDisablesTheOutput() { - $p = $this->getProcess('php -r "usleep(500000);"'); + $p = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $this->assertFalse($p->isOutputDisabled()); $p->disableOutput(); $this->assertTrue($p->isOutputDisabled()); @@ -1030,7 +1037,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testDisableOutputWhileRunningThrowsException() { - $p = $this->getProcess('php -r "usleep(500000);"'); + $p = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $p->start(); $this->setExpectedException('Symfony\Component\Process\Exception\RuntimeException', 'Disabling output while the process is running is not possible.'); $p->disableOutput(); @@ -1038,7 +1045,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testEnableOutputWhileRunningThrowsException() { - $p = $this->getProcess('php -r "usleep(500000);"'); + $p = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $p->disableOutput(); $p->start(); $this->setExpectedException('Symfony\Component\Process\Exception\RuntimeException', 'Enabling output while the process is running is not possible.'); @@ -1047,7 +1054,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase public function testEnableOrDisableOutputAfterRunDoesNotThrowException() { - $p = $this->getProcess('php -r "usleep(500000);"'); + $p = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $p->disableOutput(); $p->start(); $p->wait(); @@ -1083,7 +1090,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase */ public function testStartWithACallbackAndDisabledOutput($startMethod, $exception, $exceptionMessage) { - $p = $this->getProcess('php -r "usleep(500000);"'); + $p = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $p->disableOutput(); $this->setExpectedException($exception, $exceptionMessage); $p->{$startMethod}(function () {}); @@ -1103,7 +1110,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase */ public function testGetOutputWhileDisabled($fetchMethod) { - $p = $this->getProcess('php -r "usleep(500000);"'); + $p = $this->getProcess(self::$phpBin.' -r "usleep(500000);"'); $p->disableOutput(); $p->start(); $this->setExpectedException('Symfony\Component\Process\Exception\LogicException', 'Output has been disabled.'); diff --git a/vendor/symfony/process/Tests/ExecutableFinderTest.php b/vendor/symfony/process/Tests/ExecutableFinderTest.php index 20b12b1c3ce..61a471b4f6d 100644 --- a/vendor/symfony/process/Tests/ExecutableFinderTest.php +++ b/vendor/symfony/process/Tests/ExecutableFinderTest.php @@ -102,7 +102,7 @@ class ExecutableFinderTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('Cannot test when open_basedir is set'); } - $this->iniSet('open_basedir', dirname(PHP_BINARY).PATH_SEPARATOR.'/'); + $this->iniSet('open_basedir', dirname(PHP_BINARY).(!defined('HHVM_VERSION') ? PATH_SEPARATOR.'/' : '')); $finder = new ExecutableFinder(); $result = $finder->find($this->getPhpBinaryName()); @@ -125,7 +125,7 @@ class ExecutableFinderTest extends \PHPUnit_Framework_TestCase } $this->setPath(''); - $this->iniSet('open_basedir', PHP_BINARY.PATH_SEPARATOR.'/'); + $this->iniSet('open_basedir', PHP_BINARY.(!defined('HHVM_VERSION') ? PATH_SEPARATOR.'/' : '')); $finder = new ExecutableFinder(); $result = $finder->find($this->getPhpBinaryName(), false); diff --git a/vendor/symfony/process/Tests/PhpExecutableFinderTest.php b/vendor/symfony/process/Tests/PhpExecutableFinderTest.php index 8f8623930ff..cd4abedc9df 100644 --- a/vendor/symfony/process/Tests/PhpExecutableFinderTest.php +++ b/vendor/symfony/process/Tests/PhpExecutableFinderTest.php @@ -53,10 +53,10 @@ class PhpExecutableFinderTest extends \PHPUnit_Framework_TestCase $f = new PhpExecutableFinder(); - $current = $f->find(); + $current = getenv('PHP_BINARY') ?: PHP_BINARY; - $this->assertEquals($f->find(), $current.' --php', '::find() returns the executable PHP'); - $this->assertEquals($f->find(false), $current, '::find() returns the executable PHP'); + $this->assertEquals($current.' --php', $f->find(), '::find() returns the executable PHP'); + $this->assertEquals($current, $f->find(false), '::find() returns the executable PHP'); } /** diff --git a/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php b/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php index 89d1f6a1aca..26673ea45a1 100644 --- a/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php +++ b/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php @@ -32,7 +32,7 @@ while ($read || $write) { } $out = (binary) substr($out, $written); } - if (null === $read && strlen($out) < 1) { + if (null === $read && '' === $out) { $write = array_diff($write, array(STDOUT)); } @@ -43,7 +43,7 @@ while ($read || $write) { } $err = (binary) substr($err, $written); } - if (null === $read && strlen($err) < 1) { + if (null === $read && '' === $err) { $write = array_diff($write, array(STDERR)); } diff --git a/vendor/symfony/process/Tests/SimpleProcessTest.php b/vendor/symfony/process/Tests/SimpleProcessTest.php index 4bf9ad87c6f..98eeb0ecbc9 100644 --- a/vendor/symfony/process/Tests/SimpleProcessTest.php +++ b/vendor/symfony/process/Tests/SimpleProcessTest.php @@ -150,7 +150,7 @@ class SimpleProcessTest extends AbstractProcessTest public function testStopTerminatesProcessCleanly() { try { - $process = $this->getProcess('php -r "echo \'foo\'; sleep(1); echo \'bar\';"'); + $process = $this->getProcess(self::$phpBin.' -r "echo \'foo\'; sleep(1); echo \'bar\';"'); $process->run(function () use ($process) { $process->stop(); }); @@ -164,7 +164,7 @@ class SimpleProcessTest extends AbstractProcessTest $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('php -r "echo \'foo\'; sleep(1); echo \'bar\';"'); + $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); @@ -180,7 +180,7 @@ class SimpleProcessTest extends AbstractProcessTest $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('php -r "echo \'foo\'; sleep(1); echo \'bar\';"'); + $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); diff --git a/vendor/symfony/yaml/Inline.php b/vendor/symfony/yaml/Inline.php index 52ea724cf40..6e3877bff04 100644 --- a/vendor/symfony/yaml/Inline.php +++ b/vendor/symfony/yaml/Inline.php @@ -48,7 +48,7 @@ class Inline $value = trim($value); - if (0 == strlen($value)) { + if ('' === $value) { return ''; } diff --git a/vendor/symfony/yaml/Parser.php b/vendor/symfony/yaml/Parser.php index d72c7639c83..2de62e58bd0 100644 --- a/vendor/symfony/yaml/Parser.php +++ b/vendor/symfony/yaml/Parser.php @@ -234,7 +234,7 @@ class Parser } // 1-liner optionally followed by newline(s) - if ($this->lines[0] === trim($value)) { + if (is_string($value) && $this->lines[0] === trim($value)) { try { $value = Inline::parse($this->lines[0], $exceptionOnInvalidType, $objectSupport, $objectForMap, $this->refs); } catch (ParseException $e) { @@ -356,7 +356,7 @@ class Parser return; } - if ($inSequence && $oldLineIndentation === $newIndent && '-' === $data[0][0]) { + if ($inSequence && $oldLineIndentation === $newIndent && isset($data[0][0]) && '-' === $data[0][0]) { // the previous line contained a dash but no item content, this line is a sequence item with the same indentation // and therefore no nested list or mapping $this->moveToPreviousLine(); @@ -546,9 +546,9 @@ class Parser // deal with trailing newlines as indicated if ('' === $indicator) { - $text = preg_replace('/\n+$/s', "\n", $text); + $text = preg_replace('/\n+$/', "\n", $text); } elseif ('-' === $indicator) { - $text = preg_replace('/\n+$/s', '', $text); + $text = preg_replace('/\n+$/', '', $text); } return $text; @@ -647,7 +647,7 @@ class Parser $value = $trimmedValue; // remove end of the document marker (...) - $value = preg_replace('#\.\.\.\s*$#s', '', $value); + $value = preg_replace('#\.\.\.\s*$#', '', $value); } return $value; diff --git a/vendor/symfony/yaml/Tests/InlineTest.php b/vendor/symfony/yaml/Tests/InlineTest.php index 320eb507213..0776e4fa8df 100644 --- a/vendor/symfony/yaml/Tests/InlineTest.php +++ b/vendor/symfony/yaml/Tests/InlineTest.php @@ -50,15 +50,19 @@ class InlineTest extends \PHPUnit_Framework_TestCase $this->markTestSkipped('Your platform does not support locales.'); } - $required_locales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252'); - if (false === setlocale(LC_ALL, $required_locales)) { - $this->markTestSkipped('Could not set any of required locales: '.implode(', ', $required_locales)); + try { + $requiredLocales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252'); + if (false === setlocale(LC_NUMERIC, $requiredLocales)) { + $this->markTestSkipped('Could not set any of required locales: '.implode(', ', $requiredLocales)); + } + + $this->assertEquals('1.2', Inline::dump(1.2)); + $this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0))); + setlocale(LC_NUMERIC, $locale); + } catch (\Exception $e) { + setlocale(LC_NUMERIC, $locale); + throw $e; } - - $this->assertEquals('1.2', Inline::dump(1.2)); - $this->assertContains('fr', strtolower(setlocale(LC_NUMERIC, 0))); - - setlocale(LC_ALL, $locale); } public function testHashStringsResemblingExponentialNumericsShouldNotBeChangedToINF() diff --git a/vendor/symfony/yaml/Tests/ParserTest.php b/vendor/symfony/yaml/Tests/ParserTest.php index 6e39e7dc660..f434d5585d8 100644 --- a/vendor/symfony/yaml/Tests/ParserTest.php +++ b/vendor/symfony/yaml/Tests/ParserTest.php @@ -551,6 +551,21 @@ EOF ); } + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + * @expectedExceptionMessage missing colon + */ + public function testScalarInSequence() + { + Yaml::parse(<<<EOF +foo: + - bar +"missing colon" + foo: bar +EOF + ); + } + /** * > It is an error for two equal keys to appear in the same mapping node. * > In such a case the YAML processor may continue, ignoring the second diff --git a/vendor/symfony/yaml/Tests/YamlTest.php b/vendor/symfony/yaml/Tests/YamlTest.php index a7261562d53..8db65e39905 100644 --- a/vendor/symfony/yaml/Tests/YamlTest.php +++ b/vendor/symfony/yaml/Tests/YamlTest.php @@ -28,8 +28,6 @@ class YamlTest extends \PHPUnit_Framework_TestCase */ public function testLegacyParseFromFile() { - $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); - $filename = __DIR__.'/Fixtures/index.yml'; $contents = file_get_contents($filename); $parsedByFilename = Yaml::parse($filename); diff --git a/vendor/zendframework/zendxml/.travis.yml b/vendor/zendframework/zendxml/.travis.yml index 0b2847df4f5..967d999ba07 100644 --- a/vendor/zendframework/zendxml/.travis.yml +++ b/vendor/zendframework/zendxml/.travis.yml @@ -3,6 +3,12 @@ php: - 5.3 - 5.4 - 5.5 + - 5.6 + - hhvm + +matrix: + allow_failures: + - php: hhvm before_script: - composer self-update @@ -10,7 +16,7 @@ before_script: script: - ./vendor/bin/phpunit -c ./tests - - ./bin/check-cs.sh + - ./vendor/bin/phpcs --standard=PSR2 --ignore=tests/Bootstrap.php library tests notifications: irc: "irc.freenode.org#zftalk.dev" diff --git a/vendor/zendframework/zendxml/LICENSE.md b/vendor/zendframework/zendxml/LICENSE.md new file mode 100644 index 00000000000..141d3a2dd44 --- /dev/null +++ b/vendor/zendframework/zendxml/LICENSE.md @@ -0,0 +1,12 @@ +Copyright (c) 2014-2015, Zend Technologies USA, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +- 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. + +- Neither the name of Zend Technologies USA, Inc. 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 THE COPYRIGHT OWNER 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/zendframework/zendxml/bin/check-cs.sh b/vendor/zendframework/zendxml/bin/check-cs.sh deleted file mode 100644 index 018adb5577a..00000000000 --- a/vendor/zendframework/zendxml/bin/check-cs.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -FIXER_CONFIG="`dirname $0`/../.php_cs" -FIXER_PATH="`dirname $0`/../vendor/fabpot/php-cs-fixer/php-cs-fixer" -CS="" - -( - cd "`dirname $0`/../" ; - CS=$(php vendor/fabpot/php-cs-fixer/php-cs-fixer fix -v --dry-run .) -) - -if [[ "$CS" ]]; -then - echo -en '\E[31m'"$CS\033[1m\033[0m"; - printf "\n"; - echo -en '\E[31;47m'"\033[1mCoding standards check failed!\033[0m" - printf "\n"; - exit 2; -fi - -echo -en '\E[32m'"\033[1mCoding standards check passed!\033[0m" -printf "\n"; - -echo $CS diff --git a/vendor/zendframework/zendxml/composer.json b/vendor/zendframework/zendxml/composer.json index 3b4ca91debb..139f1e23b70 100644 --- a/vendor/zendframework/zendxml/composer.json +++ b/vendor/zendframework/zendxml/composer.json @@ -11,7 +11,12 @@ "homepage": "http://packages.zendframework.com/", "autoload": { "psr-0": { - "ZendXml": "library/" + "ZendXml\\": "library/" + } + }, + "autoload-dev": { + "psr-4": { + "ZendTest\\Xml\\": "tests/ZendXmlTest/" } }, "repositories": [ @@ -29,7 +34,7 @@ } }, "require-dev": { - "fabpot/php-cs-fixer": "*@dev", - "phpunit/phpunit": "~3.7" + "phpunit/phpunit": "~3.7", + "squizlabs/php_codesniffer": "~1.5" } } diff --git a/vendor/zendframework/zendxml/library/ZendXml/Exception/InvalidArgumentException.php b/vendor/zendframework/zendxml/library/ZendXml/Exception/InvalidArgumentException.php index 819fb9f6e63..0fef6b298dd 100644 --- a/vendor/zendframework/zendxml/library/ZendXml/Exception/InvalidArgumentException.php +++ b/vendor/zendframework/zendxml/library/ZendXml/Exception/InvalidArgumentException.php @@ -12,8 +12,6 @@ namespace ZendXml\Exception; /** * Invalid argument exception */ -class InvalidArgumentException - extends \InvalidArgumentException - implements ExceptionInterface +class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface { } diff --git a/vendor/zendframework/zendxml/library/ZendXml/Exception/RuntimeException.php b/vendor/zendframework/zendxml/library/ZendXml/Exception/RuntimeException.php index 1d5f50625e9..b730da4fff1 100644 --- a/vendor/zendframework/zendxml/library/ZendXml/Exception/RuntimeException.php +++ b/vendor/zendframework/zendxml/library/ZendXml/Exception/RuntimeException.php @@ -12,8 +12,6 @@ namespace ZendXml\Exception; /** * Runtime exception */ -class RuntimeException - extends \RuntimeException - implements ExceptionInterface +class RuntimeException extends \RuntimeException implements ExceptionInterface { } diff --git a/vendor/zendframework/zendxml/library/ZendXml/Security.php b/vendor/zendframework/zendxml/library/ZendXml/Security.php index a0dc8a101af..892e2ab1457 100644 --- a/vendor/zendframework/zendxml/library/ZendXml/Security.php +++ b/vendor/zendframework/zendxml/library/ZendXml/Security.php @@ -3,7 +3,7 @@ * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/zf2 for the canonical source repository - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendXml; @@ -19,12 +19,14 @@ class Security * Heuristic scan to detect entity in XML * * @param string $xml - * @throws Exception\RuntimeException + * @throws Exception\RuntimeException If entity expansion or external entity declaration was discovered. */ protected static function heuristicScan($xml) { - if (strpos($xml, '<!ENTITY') !== false) { - throw new Exception\RuntimeException(self::ENTITY_DETECT); + foreach (self::getEntityComparison($xml) as $compare) { + if (strpos($xml, $compare) !== false) { + throw new Exception\RuntimeException(self::ENTITY_DETECT); + } } } @@ -123,13 +125,250 @@ class Security /** * Return true if PHP is running with PHP-FPM * + * This method is mainly used to determine whether or not heuristic checks + * (vs libxml checks) should be made, due to threading issues in libxml; + * under php-fpm, threading becomes a concern. + * + * However, PHP versions 5.5.22+ and 5.6.6+ contain a patch to the + * libxml support in PHP that makes the libxml checks viable; in such + * versions, this method will return false to enforce those checks, which + * are more strict and accurate than the heuristic checks. + * * @return boolean */ public static function isPhpFpm() { - if (substr(php_sapi_name(), 0, 3) === 'fpm') { + $isVulnerableVersion = ( + version_compare(PHP_VERSION, '5.5.22', 'lt') + || ( + version_compare(PHP_VERSION, '5.6', 'gte') + && version_compare(PHP_VERSION, '5.6.6', 'lt') + ) + ); + + if (substr(php_sapi_name(), 0, 3) === 'fpm' && $isVulnerableVersion) { return true; } return false; } + + /** + * Determine and return the string(s) to use for the <!ENTITY comparison. + * + * @param string $xml + * @return string[] + */ + protected static function getEntityComparison($xml) + { + $encodingMap = self::getAsciiEncodingMap(); + return array_map(function ($encoding) use ($encodingMap) { + $generator = isset($encodingMap[$encoding]) ? $encodingMap[$encoding] : $encodingMap['UTF-8']; + return $generator('<!ENTITY'); + }, self::detectXmlEncoding($xml, self::detectStringEncoding($xml))); + } + + /** + * Determine the string encoding. + * + * Determines string encoding from either a detected BOM or a + * heuristic. + * + * @param string $xml + * @return string File encoding + */ + protected static function detectStringEncoding($xml) + { + return self::detectBom($xml) ?: self::detectXmlStringEncoding($xml); + } + + /** + * Attempt to match a known BOM. + * + * Iterates through the return of getBomMap(), comparing the initial bytes + * of the provided string to the BOM of each; if a match is determined, + * it returns the encoding. + * + * @param string $string + * @return false|string Returns encoding on success. + */ + protected static function detectBom($string) + { + foreach (self::getBomMap() as $criteria) { + if (0 === strncmp($string, $criteria['bom'], $criteria['length'])) { + return $criteria['encoding']; + } + } + return false; + } + + /** + * Attempt to detect the string encoding of an XML string. + * + * @param string $xml + * @return string Encoding + */ + protected static function detectXmlStringEncoding($xml) + { + foreach (self::getAsciiEncodingMap() as $encoding => $generator) { + $prefix = $generator('<' . '?xml'); + if (0 === strncmp($xml, $prefix, strlen($prefix))) { + return $encoding; + } + } + + // Fallback + return 'UTF-8'; + } + + /** + * Attempt to detect the specified XML encoding. + * + * Using the file's encoding, determines if an "encoding" attribute is + * present and well-formed in the XML declaration; if so, it returns a + * list with both the ASCII representation of that declaration and the + * original file encoding. + * + * If not, a list containing only the provided file encoding is returned. + * + * @param string $xml + * @param string $fileEncoding + * @return string[] Potential XML encodings + */ + protected static function detectXmlEncoding($xml, $fileEncoding) + { + $encodingMap = self::getAsciiEncodingMap(); + $generator = $encodingMap[$fileEncoding]; + $encAttr = $generator('encoding="'); + $quote = $generator('"'); + $close = $generator('>'); + + $closePos = strpos($xml, $close); + if (false === $closePos) { + return array($fileEncoding); + } + + $encPos = strpos($xml, $encAttr); + if (false === $encPos + || $encPos > $closePos + ) { + return array($fileEncoding); + } + + $encPos += strlen($encAttr); + $quotePos = strpos($xml, $quote, $encPos); + if (false === $quotePos) { + return array($fileEncoding); + } + + $encoding = self::substr($xml, $encPos, $quotePos); + return array( + // Following line works because we're only supporting 8-bit safe encodings at this time. + str_replace('\0', '', $encoding), // detected encoding + $fileEncoding, // file encoding + ); + } + + /** + * Return a list of BOM maps. + * + * Returns a list of common encoding -> BOM maps, along with the character + * length to compare against. + * + * @link https://en.wikipedia.org/wiki/Byte_order_mark + * @return array + */ + protected static function getBomMap() + { + return array( + array( + 'encoding' => 'UTF-32BE', + 'bom' => pack('CCCC', 0x00, 0x00, 0xfe, 0xff), + 'length' => 4, + ), + array( + 'encoding' => 'UTF-32LE', + 'bom' => pack('CCCC', 0xff, 0xfe, 0x00, 0x00), + 'length' => 4, + ), + array( + 'encoding' => 'GB-18030', + 'bom' => pack('CCCC', 0x84, 0x31, 0x95, 0x33), + 'length' => 4, + ), + array( + 'encoding' => 'UTF-16BE', + 'bom' => pack('CC', 0xfe, 0xff), + 'length' => 2, + ), + array( + 'encoding' => 'UTF-16LE', + 'bom' => pack('CC', 0xff, 0xfe), + 'length' => 2, + ), + array( + 'encoding' => 'UTF-8', + 'bom' => pack('CCC', 0xef, 0xbb, 0xbf), + 'length' => 3, + ), + ); + } + + /** + * Return a map of encoding => generator pairs. + * + * Returns a map of encoding => generator pairs, where the generator is a + * callable that accepts a string and returns the appropriate byte order + * sequence of that string for the encoding. + * + * @return array + */ + protected static function getAsciiEncodingMap() + { + return array( + 'UTF-32BE' => function ($ascii) { + return preg_replace('/(.)/', "\0\0\0\\1", $ascii); + }, + 'UTF-32LE' => function ($ascii) { + return preg_replace('/(.)/', "\\1\0\0\0", $ascii); + }, + 'UTF-32odd1' => function ($ascii) { + return preg_replace('/(.)/', "\0\\1\0\0", $ascii); + }, + 'UTF-32odd2' => function ($ascii) { + return preg_replace('/(.)/', "\0\0\\1\0", $ascii); + }, + 'UTF-16BE' => function ($ascii) { + return preg_replace('/(.)/', "\0\\1", $ascii); + }, + 'UTF-16LE' => function ($ascii) { + return preg_replace('/(.)/', "\\1\0", $ascii); + }, + 'UTF-8' => function ($ascii) { + return $ascii; + }, + 'GB-18030' => function ($ascii) { + return $ascii; + }, + ); + } + + /** + * Binary-safe substr. + * + * substr() is not binary-safe; this method loops by character to ensure + * multi-byte characters are aggregated correctly. + * + * @param string $string + * @param int $start + * @param int $end + * @return string + */ + protected static function substr($string, $start, $end) + { + $substr = ''; + for ($i = $start; $i < $end; $i += 1) { + $substr .= $string[$i]; + } + return $substr; + } } diff --git a/vendor/zendframework/zendxml/tests/ZendXmlTest/MultibyteTest.php b/vendor/zendframework/zendxml/tests/ZendXmlTest/MultibyteTest.php new file mode 100644 index 00000000000..165e8fa512d --- /dev/null +++ b/vendor/zendframework/zendxml/tests/ZendXmlTest/MultibyteTest.php @@ -0,0 +1,125 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +namespace ZendTest\Xml; + +use ZendXml\Security as XmlSecurity; +use ZendXml\Exception; +use DOMDocument; +use ReflectionMethod; +use SimpleXMLElement; + +/** + * @group ZF2015-06 + */ +class MultibyteTest extends \PHPUnit_Framework_TestCase +{ + public function multibyteEncodings() + { + return array( + 'UTF-16LE' => array('UTF-16LE', pack('CC', 0xff, 0xfe), 3), + 'UTF-16BE' => array('UTF-16BE', pack('CC', 0xfe, 0xff), 3), + 'UTF-32LE' => array('UTF-32LE', pack('CCCC', 0xff, 0xfe, 0x00, 0x00), 4), + 'UTF-32BE' => array('UTF-32BE', pack('CCCC', 0x00, 0x00, 0xfe, 0xff), 4), + ); + } + + public function getXmlWithXXE() + { + return <<<XML +<?xml version="1.0" encoding="{ENCODING}"?> +<!DOCTYPE methodCall [ + <!ENTITY pocdata SYSTEM "file:///etc/passwd"> +]> +<methodCall> + <methodName>retrieved: &pocdata;</methodName> +</methodCall> +XML; + } + + /** + * Invoke ZendXml\Security::heuristicScan with the provided XML. + * + * @param string $xml + * @return void + * @throws Exception\RuntimeException + */ + public function invokeHeuristicScan($xml) + { + $r = new ReflectionMethod('ZendXml\Security', 'heuristicScan'); + $r->setAccessible(true); + return $r->invoke(null, $xml); + } + + /** + * @dataProvider multibyteEncodings + * @group heuristicDetection + */ + public function testDetectsMultibyteXXEVectorsUnderFPMWithEncodedStringMissingBOM($encoding, $bom, $bomLength) + { + $xml = $this->getXmlWithXXE(); + $xml = str_replace('{ENCODING}', $encoding, $xml); + $xml = iconv('UTF-8', $encoding, $xml); + $this->assertNotSame(0, strncmp($xml, $bom, $bomLength)); + $this->setExpectedException('ZendXml\Exception\RuntimeException', 'ENTITY'); + $this->invokeHeuristicScan($xml); + } + + /** + * @dataProvider multibyteEncodings + */ + public function testDetectsMultibyteXXEVectorsUnderFPMWithEncodedStringUsingBOM($encoding, $bom) + { + $xml = $this->getXmlWithXXE(); + $xml = str_replace('{ENCODING}', $encoding, $xml); + $orig = iconv('UTF-8', $encoding, $xml); + $xml = $bom . $orig; + $this->setExpectedException('ZendXml\Exception\RuntimeException', 'ENTITY'); + $this->invokeHeuristicScan($xml); + } + + public function getXmlWithoutXXE() + { + return <<<XML +<?xml version="1.0" encoding="{ENCODING}"?> +<methodCall> + <methodName>retrieved: &pocdata;</methodName> +</methodCall> +XML; + } + + /** + * @dataProvider multibyteEncodings + */ + public function testDoesNotFlagValidMultibyteXmlAsInvalidUnderFPM($encoding) + { + $xml = $this->getXmlWithoutXXE(); + $xml = str_replace('{ENCODING}', $encoding, $xml); + $xml = iconv('UTF-8', $encoding, $xml); + try { + $result = $this->invokeHeuristicScan($xml); + $this->assertNull($result); + } catch (\Exception $e) { + $this->fail('Security scan raised exception when it should not have'); + } + } + + /** + * @dataProvider multibyteEncodings + * @group mixedEncoding + */ + public function testDetectsXXEWhenXMLDocumentEncodingDiffersFromFileEncoding($encoding, $bom) + { + $xml = $this->getXmlWithXXE(); + $xml = str_replace('{ENCODING}', 'UTF-8', $xml); + $xml = iconv('UTF-8', $encoding, $xml); + $xml = $bom . $xml; + $this->setExpectedException('ZendXml\Exception\RuntimeException', 'ENTITY'); + $this->invokeHeuristicScan($xml); + } +} diff --git a/vendor/zendframework/zendxml/tests/ZendXmlTest/SecurityTest.php b/vendor/zendframework/zendxml/tests/ZendXmlTest/SecurityTest.php index 4132505e5e1..fa3b30bf145 100644 --- a/vendor/zendframework/zendxml/tests/ZendXmlTest/SecurityTest.php +++ b/vendor/zendframework/zendxml/tests/ZendXmlTest/SecurityTest.php @@ -58,7 +58,7 @@ XML; public function testScanSimpleXmlResult() { - $result = XmlSecurity::scan($this->_getXml()); + $result = XmlSecurity::scan($this->getXml()); $this->assertTrue($result instanceof SimpleXMLElement); $this->assertEquals($result->result, 'test'); } @@ -66,7 +66,7 @@ XML; public function testScanDom() { $dom = new DOMDocument('1.0'); - $result = XmlSecurity::scan($this->_getXml(), $dom); + $result = XmlSecurity::scan($this->getXml(), $dom); $this->assertTrue($result instanceof DOMDocument); $node = $result->getElementsByTagName('result')->item(0); $this->assertEquals($node->nodeValue, 'test'); @@ -96,7 +96,7 @@ XML; public function testScanFile() { $file = tempnam(sys_get_temp_dir(), 'ZendXml_Security'); - file_put_contents($file, $this->_getXml()); + file_put_contents($file, $this->getXml()); $result = XmlSecurity::scanFile($file); $this->assertTrue($result instanceof SimpleXMLElement); @@ -123,7 +123,7 @@ XML; $this->assertTrue($result->validate()); } - protected function _getXml() + protected function getXml() { return <<<XML <?xml version="1.0"?> @@ -131,7 +131,5 @@ XML; <result>test</result> </results> XML; - - } - + } } -- GitLab