diff --git a/composer.json b/composer.json index 1310c6f1a..b3d7ceb26 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "symfony/process": "^3.0.0", "pimple/pimple": "3.0.2", "nikic/php-parser": "1.4.1", - "icewind/Streams": "0.4.1", + "icewind/Streams": "0.5.2", "swiftmailer/swiftmailer": "@stable", "guzzlehttp/guzzle": "~5.3", "league/flysystem": "1.0.20", diff --git a/composer.lock b/composer.lock index 8af006ed9..36a7da755 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "641586bfbbc76b68f47359d62e729d22", - "content-hash": "2408eab0e3c7aa1a1412f3dc86500329", + "content-hash": "7b6c2725b3b843ec779a761085bc6be9", "packages": [ { "name": "bantu/ini-get-wrapper", @@ -35,7 +34,7 @@ "MIT" ], "description": "Convenience wrapper around ini_get()", - "time": "2014-09-15 13:12:35" + "time": "2014-09-15T13:12:35+00:00" }, { "name": "deepdiver1975/tarstreamer", @@ -77,7 +76,7 @@ "stream", "tar" ], - "time": "2016-02-15 10:52:44" + "time": "2016-02-15T10:52:44+00:00" }, { "name": "doctrine/annotations", @@ -145,7 +144,7 @@ "docblock", "parser" ], - "time": "2015-08-31 12:32:49" + "time": "2015-08-31T12:32:49+00:00" }, { "name": "doctrine/cache", @@ -215,7 +214,7 @@ "cache", "caching" ], - "time": "2015-12-31 16:37:02" + "time": "2015-12-31T16:37:02+00:00" }, { "name": "doctrine/collections", @@ -281,7 +280,7 @@ "collections", "iterator" ], - "time": "2015-04-14 22:21:58" + "time": "2015-04-14T22:21:58+00:00" }, { "name": "doctrine/common", @@ -354,7 +353,7 @@ "persistence", "spl" ], - "time": "2015-12-25 13:18:31" + "time": "2015-12-25T13:18:31+00:00" }, { "name": "doctrine/dbal", @@ -425,7 +424,7 @@ "persistence", "queryobject" ], - "time": "2016-09-09 19:13:33" + "time": "2016-09-09T19:13:33+00:00" }, { "name": "doctrine/inflector", @@ -492,7 +491,7 @@ "singularize", "string" ], - "time": "2015-11-06 14:35:42" + "time": "2015-11-06T14:35:42+00:00" }, { "name": "doctrine/lexer", @@ -546,7 +545,7 @@ "lexer", "parser" ], - "time": "2014-09-09 13:34:57" + "time": "2014-09-09T13:34:57+00:00" }, { "name": "guzzle/common", @@ -591,7 +590,7 @@ "exception" ], "abandoned": "guzzle/guzzle", - "time": "2014-01-28 22:29:15" + "time": "2014-01-28T22:29:15+00:00" }, { "name": "guzzle/http", @@ -649,7 +648,7 @@ "http client" ], "abandoned": "guzzle/guzzle", - "time": "2014-01-23 18:23:29" + "time": "2014-01-23T18:23:29+00:00" }, { "name": "guzzle/parser", @@ -694,7 +693,7 @@ "url" ], "abandoned": "guzzle/guzzle", - "time": "2013-10-24 00:04:09" + "time": "2013-10-24T00:04:09+00:00" }, { "name": "guzzle/stream", @@ -748,7 +747,7 @@ "stream" ], "abandoned": "guzzle/guzzle", - "time": "2014-01-28 22:14:17" + "time": "2014-01-28T22:14:17+00:00" }, { "name": "guzzlehttp/guzzle", @@ -800,7 +799,7 @@ "rest", "web service" ], - "time": "2016-07-15 19:28:39" + "time": "2016-07-15T19:28:39+00:00" }, { "name": "guzzlehttp/ringphp", @@ -851,7 +850,7 @@ } ], "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", - "time": "2015-05-20 03:37:09" + "time": "2015-05-20T03:37:09+00:00" }, { "name": "guzzlehttp/streams", @@ -901,20 +900,20 @@ "Guzzle", "stream" ], - "time": "2014-10-12 19:18:40" + "time": "2014-10-12T19:18:40+00:00" }, { "name": "icewind/streams", - "version": "0.4.1", + "version": "0.5.2", "source": { "type": "git", "url": "https://github.com/icewind1991/Streams.git", - "reference": "d3620e8dc410c86c2ba55579803679c4e0b289ac" + "reference": "6bfd2fdbd99319f5e010d0a684409189a562cb1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/icewind1991/Streams/zipball/d3620e8dc410c86c2ba55579803679c4e0b289ac", - "reference": "d3620e8dc410c86c2ba55579803679c4e0b289ac", + "url": "https://api.github.com/repos/icewind1991/Streams/zipball/6bfd2fdbd99319f5e010d0a684409189a562cb1e", + "reference": "6bfd2fdbd99319f5e010d0a684409189a562cb1e", "shasum": "" }, "require": { @@ -942,7 +941,7 @@ } ], "description": "A set of generic stream wrappers", - "time": "2016-06-02 14:37:52" + "time": "2016-12-02T14:21:23+00:00" }, { "name": "interfasys/lognormalizer", @@ -995,7 +994,7 @@ "log", "normalizer" ], - "time": "2015-08-01 16:27:37" + "time": "2015-08-01T16:27:37+00:00" }, { "name": "jeremeamia/SuperClosure", @@ -1053,7 +1052,7 @@ "serialize", "tokenizer" ], - "time": "2015-03-11 20:06:43" + "time": "2015-03-11T20:06:43+00:00" }, { "name": "league/flysystem", @@ -1136,7 +1135,7 @@ "sftp", "storage" ], - "time": "2016-03-14 21:54:11" + "time": "2016-03-14T21:54:11+00:00" }, { "name": "lukasreschke/id3parser", @@ -1171,7 +1170,7 @@ "php", "tags" ], - "time": "2016-04-04 09:34:50" + "time": "2016-04-04T09:34:50+00:00" }, { "name": "mcnetic/zipstreamer", @@ -1223,7 +1222,7 @@ "stream", "zip" ], - "time": "2016-02-17 22:47:09" + "time": "2016-02-17T22:47:09+00:00" }, { "name": "natxet/CssMin", @@ -1265,7 +1264,7 @@ "css", "minify" ], - "time": "2014-09-10 14:34:00" + "time": "2014-09-10T14:34:00+00:00" }, { "name": "nikic/php-parser", @@ -1310,7 +1309,7 @@ "parser", "php" ], - "time": "2015-09-19 14:15:08" + "time": "2015-09-19T14:15:08+00:00" }, { "name": "paragonie/random_compat", @@ -1358,7 +1357,7 @@ "pseudorandom", "random" ], - "time": "2016-03-18 20:34:03" + "time": "2016-03-18T20:34:03+00:00" }, { "name": "patchwork/jsqueeze", @@ -1405,7 +1404,7 @@ "javascript", "minification" ], - "time": "2016-04-19 09:28:22" + "time": "2016-04-19T09:28:22+00:00" }, { "name": "patchwork/utf8", @@ -1464,7 +1463,7 @@ "utf-8", "utf8" ], - "time": "2015-12-15 15:33:41" + "time": "2015-12-15T15:33:41+00:00" }, { "name": "pear/archive_tar", @@ -1530,7 +1529,7 @@ "archive", "tar" ], - "time": "2015-08-05 12:31:03" + "time": "2015-08-05T12:31:03+00:00" }, { "name": "pear/console_getopt", @@ -1577,7 +1576,7 @@ } ], "description": "More info available on: http://pear.php.net/package/Console_Getopt", - "time": "2015-07-20 20:28:12" + "time": "2015-07-20T20:28:12+00:00" }, { "name": "pear/pear-core-minimal", @@ -1621,7 +1620,7 @@ } ], "description": "Minimal set of PEAR core files to be used as composer dependency", - "time": "2015-10-17 11:41:19" + "time": "2015-10-17T11:41:19+00:00" }, { "name": "pear/pear_exception", @@ -1676,7 +1675,7 @@ "keywords": [ "exception" ], - "time": "2015-02-10 20:07:52" + "time": "2015-02-10T20:07:52+00:00" }, { "name": "phpseclib/phpseclib", @@ -1768,7 +1767,7 @@ "x.509", "x509" ], - "time": "2016-08-18 18:49:14" + "time": "2016-08-18T18:49:14+00:00" }, { "name": "pimple/pimple", @@ -1814,7 +1813,7 @@ "container", "dependency injection" ], - "time": "2015-09-11 15:10:35" + "time": "2015-09-11T15:10:35+00:00" }, { "name": "psr/log", @@ -1861,7 +1860,7 @@ "psr", "psr-3" ], - "time": "2016-10-10 12:19:37" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "punic/punic", @@ -1926,7 +1925,7 @@ "translations", "unicode" ], - "time": "2015-06-16 13:04:27" + "time": "2015-06-16T13:04:27+00:00" }, { "name": "rackspace/php-opencloud", @@ -1983,7 +1982,7 @@ "rackspace", "swift" ], - "time": "2014-02-06 20:53:21" + "time": "2014-02-06T20:53:21+00:00" }, { "name": "react/promise", @@ -2027,7 +2026,7 @@ } ], "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "time": "2015-07-03 13:48:55" + "time": "2015-07-03T13:48:55+00:00" }, { "name": "sabre/dav", @@ -2110,7 +2109,7 @@ "framework", "iCalendar" ], - "time": "2016-06-28 02:44:05" + "time": "2016-06-28T02:44:05+00:00" }, { "name": "sabre/event", @@ -2167,7 +2166,7 @@ "promise", "signal" ], - "time": "2015-11-05 20:14:39" + "time": "2015-11-05T20:14:39+00:00" }, { "name": "sabre/http", @@ -2222,7 +2221,7 @@ "keywords": [ "http" ], - "time": "2016-01-06 23:00:08" + "time": "2016-01-06T23:00:08+00:00" }, { "name": "sabre/uri", @@ -2273,7 +2272,7 @@ "uri", "url" ], - "time": "2016-10-27 04:56:33" + "time": "2016-10-27T04:56:33+00:00" }, { "name": "sabre/vobject", @@ -2370,7 +2369,7 @@ "xCal", "xCard" ], - "time": "2016-07-15 19:52:17" + "time": "2016-07-15T19:52:17+00:00" }, { "name": "sabre/xml", @@ -2433,7 +2432,7 @@ "dom", "xml" ], - "time": "2016-10-09 22:57:52" + "time": "2016-10-09T22:57:52+00:00" }, { "name": "stecman/symfony-console-completion", @@ -2478,7 +2477,7 @@ } ], "description": "Automatic BASH completion for Symfony Console Component based applications.", - "time": "2016-02-24 05:08:54" + "time": "2016-02-24T05:08:54+00:00" }, { "name": "swiftmailer/swiftmailer", @@ -2530,7 +2529,7 @@ "mail", "mailer" ], - "time": "2014-12-05 14:17:14" + "time": "2014-12-05T14:17:14+00:00" }, { "name": "symfony/console", @@ -2590,7 +2589,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-07-26 08:04:17" + "time": "2016-07-26T08:04:17+00:00" }, { "name": "symfony/event-dispatcher", @@ -2650,7 +2649,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-07-19 10:45:57" + "time": "2016-07-19T10:45:57+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -2709,7 +2708,7 @@ "portable", "shim" ], - "time": "2016-05-18 14:26:46" + "time": "2016-05-18T14:26:46+00:00" }, { "name": "symfony/polyfill-php70", @@ -2768,7 +2767,7 @@ "portable", "shim" ], - "time": "2016-01-28 22:42:02" + "time": "2016-01-28T22:42:02+00:00" }, { "name": "symfony/process", @@ -2817,7 +2816,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-09-29 14:13:09" + "time": "2016-09-29T14:13:09+00:00" }, { "name": "symfony/routing", @@ -2892,7 +2891,7 @@ "uri", "url" ], - "time": "2016-08-16 14:58:24" + "time": "2016-08-16T14:58:24+00:00" } ], "packages-dev": [], diff --git a/composer/ClassLoader.php b/composer/ClassLoader.php index ac67d302a..4626994fd 100644 --- a/composer/ClassLoader.php +++ b/composer/ClassLoader.php @@ -55,6 +55,7 @@ class ClassLoader private $classMap = array(); private $classMapAuthoritative = false; private $missingClasses = array(); + private $apcuPrefix; public function getPrefixes() { @@ -271,6 +272,26 @@ public function isClassMapAuthoritative() return $this->classMapAuthoritative; } + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + /** * Registers this instance as an autoloader. * @@ -313,11 +334,6 @@ public function loadClass($class) */ public function findFile($class) { - // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731 - if ('\\' == $class[0]) { - $class = substr($class, 1); - } - // class map lookup if (isset($this->classMap[$class])) { return $this->classMap[$class]; @@ -325,6 +341,12 @@ public function findFile($class) if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { return false; } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } $file = $this->findFileWithExtension($class, '.php'); @@ -333,6 +355,10 @@ public function findFile($class) $file = $this->findFileWithExtension($class, '.hh'); } + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + if (false === $file) { // Remember that this class does not exist. $this->missingClasses[$class] = true; diff --git a/composer/autoload_classmap.php b/composer/autoload_classmap.php index 3d721f2d2..5f838dd7f 100644 --- a/composer/autoload_classmap.php +++ b/composer/autoload_classmap.php @@ -612,8 +612,23 @@ 'Icewind\\Streams\\IteratorDirectory' => $vendorDir . '/icewind/streams/src/IteratorDirectory.php', 'Icewind\\Streams\\NullWrapper' => $vendorDir . '/icewind/streams/src/NullWrapper.php', 'Icewind\\Streams\\Path' => $vendorDir . '/icewind/streams/src/Path.php', + 'Icewind\\Streams\\PathWrapper' => $vendorDir . '/icewind/streams/src/PathWrapper.php', 'Icewind\\Streams\\RetryWrapper' => $vendorDir . '/icewind/streams/src/RetryWrapper.php', 'Icewind\\Streams\\SeekableWrapper' => $vendorDir . '/icewind/streams/src/SeekableWrapper.php', + 'Icewind\\Streams\\Tests\\CallbackWrapper' => $vendorDir . '/icewind/streams/tests/CallbackWrapper.php', + 'Icewind\\Streams\\Tests\\DirectoryFilter' => $vendorDir . '/icewind/streams/tests/DirectoryFilter.php', + 'Icewind\\Streams\\Tests\\DirectoryWrapper' => $vendorDir . '/icewind/streams/tests/DirectoryWrapper.php', + 'Icewind\\Streams\\Tests\\DirectoryWrapperDummy' => $vendorDir . '/icewind/streams/tests/DirectoryWrapper.php', + 'Icewind\\Streams\\Tests\\DirectoryWrapperNull' => $vendorDir . '/icewind/streams/tests/DirectoryWrapper.php', + 'Icewind\\Streams\\Tests\\FailWrapper' => $vendorDir . '/icewind/streams/tests/RetryWrapper.php', + 'Icewind\\Streams\\Tests\\IteratorDirectory' => $vendorDir . '/icewind/streams/tests/IteratorDirectory.php', + 'Icewind\\Streams\\Tests\\NullWrapper' => $vendorDir . '/icewind/streams/tests/NullWrapper.php', + 'Icewind\\Streams\\Tests\\PartialWrapper' => $vendorDir . '/icewind/streams/tests/RetryWrapper.php', + 'Icewind\\Streams\\Tests\\PathWrapper' => $vendorDir . '/icewind/streams/tests/PathWrapper.php', + 'Icewind\\Streams\\Tests\\RetryWrapper' => $vendorDir . '/icewind/streams/tests/RetryWrapper.php', + 'Icewind\\Streams\\Tests\\SeekableWrapper' => $vendorDir . '/icewind/streams/tests/SeekableWrapper.php', + 'Icewind\\Streams\\Tests\\UrlCallBack' => $vendorDir . '/icewind/streams/tests/UrlCallBack.php', + 'Icewind\\Streams\\Tests\\Wrapper' => $vendorDir . '/icewind/streams/tests/Wrapper.php', 'Icewind\\Streams\\Url' => $vendorDir . '/icewind/streams/src/Url.php', 'Icewind\\Streams\\UrlCallback' => $vendorDir . '/icewind/streams/src/UrlCallBack.php', 'Icewind\\Streams\\Wrapper' => $vendorDir . '/icewind/streams/src/Wrapper.php', diff --git a/composer/autoload_real.php b/composer/autoload_real.php index 56d69c0f3..448f7f479 100644 --- a/composer/autoload_real.php +++ b/composer/autoload_real.php @@ -25,9 +25,9 @@ public static function getLoader() $includePaths = require __DIR__ . '/include_paths.php'; array_push($includePaths, get_include_path()); - set_include_path(join(PATH_SEPARATOR, $includePaths)); + set_include_path(implode(PATH_SEPARATOR, $includePaths)); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION'); + $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); if ($useStaticLoader) { require_once __DIR__ . '/autoload_static.php'; diff --git a/composer/autoload_static.php b/composer/autoload_static.php index f7fc9a8e8..52ca7c300 100644 --- a/composer/autoload_static.php +++ b/composer/autoload_static.php @@ -927,8 +927,23 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652 'Icewind\\Streams\\IteratorDirectory' => __DIR__ . '/..' . '/icewind/streams/src/IteratorDirectory.php', 'Icewind\\Streams\\NullWrapper' => __DIR__ . '/..' . '/icewind/streams/src/NullWrapper.php', 'Icewind\\Streams\\Path' => __DIR__ . '/..' . '/icewind/streams/src/Path.php', + 'Icewind\\Streams\\PathWrapper' => __DIR__ . '/..' . '/icewind/streams/src/PathWrapper.php', 'Icewind\\Streams\\RetryWrapper' => __DIR__ . '/..' . '/icewind/streams/src/RetryWrapper.php', 'Icewind\\Streams\\SeekableWrapper' => __DIR__ . '/..' . '/icewind/streams/src/SeekableWrapper.php', + 'Icewind\\Streams\\Tests\\CallbackWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/CallbackWrapper.php', + 'Icewind\\Streams\\Tests\\DirectoryFilter' => __DIR__ . '/..' . '/icewind/streams/tests/DirectoryFilter.php', + 'Icewind\\Streams\\Tests\\DirectoryWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/DirectoryWrapper.php', + 'Icewind\\Streams\\Tests\\DirectoryWrapperDummy' => __DIR__ . '/..' . '/icewind/streams/tests/DirectoryWrapper.php', + 'Icewind\\Streams\\Tests\\DirectoryWrapperNull' => __DIR__ . '/..' . '/icewind/streams/tests/DirectoryWrapper.php', + 'Icewind\\Streams\\Tests\\FailWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/RetryWrapper.php', + 'Icewind\\Streams\\Tests\\IteratorDirectory' => __DIR__ . '/..' . '/icewind/streams/tests/IteratorDirectory.php', + 'Icewind\\Streams\\Tests\\NullWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/NullWrapper.php', + 'Icewind\\Streams\\Tests\\PartialWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/RetryWrapper.php', + 'Icewind\\Streams\\Tests\\PathWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/PathWrapper.php', + 'Icewind\\Streams\\Tests\\RetryWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/RetryWrapper.php', + 'Icewind\\Streams\\Tests\\SeekableWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/SeekableWrapper.php', + 'Icewind\\Streams\\Tests\\UrlCallBack' => __DIR__ . '/..' . '/icewind/streams/tests/UrlCallBack.php', + 'Icewind\\Streams\\Tests\\Wrapper' => __DIR__ . '/..' . '/icewind/streams/tests/Wrapper.php', 'Icewind\\Streams\\Url' => __DIR__ . '/..' . '/icewind/streams/src/Url.php', 'Icewind\\Streams\\UrlCallback' => __DIR__ . '/..' . '/icewind/streams/src/UrlCallBack.php', 'Icewind\\Streams\\Wrapper' => __DIR__ . '/..' . '/icewind/streams/src/Wrapper.php', diff --git a/composer/installed.json b/composer/installed.json index 68a3d56f3..32aaf823a 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -19,7 +19,7 @@ "php": ">=5.3.2", "symfony/event-dispatcher": ">=2.1" }, - "time": "2014-01-28 22:29:15", + "time": "2014-01-28T22:29:15+00:00", "type": "library", "extra": { "branch-alias": { @@ -69,7 +69,7 @@ "suggest": { "guzzle/http": "To convert Guzzle request objects to PHP streams" }, - "time": "2014-01-28 22:14:17", + "time": "2014-01-28T22:14:17+00:00", "type": "library", "extra": { "branch-alias": { @@ -121,7 +121,7 @@ "require": { "php": ">=5.3.2" }, - "time": "2013-10-24 00:04:09", + "time": "2013-10-24T00:04:09+00:00", "type": "library", "extra": { "branch-alias": { @@ -174,7 +174,7 @@ "suggest": { "ext-curl": "*" }, - "time": "2014-01-23 18:23:29", + "time": "2014-01-23T18:23:29+00:00", "type": "library", "extra": { "branch-alias": { @@ -233,7 +233,7 @@ "psr/log": "1.0.*", "satooshi/php-coveralls": "0.6.*@dev" }, - "time": "2014-02-06 20:53:21", + "time": "2014-02-06T20:53:21+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -286,7 +286,7 @@ "require-dev": { "phpunit/phpunit": "3.7.*" }, - "time": "2014-09-15 13:12:35", + "time": "2014-09-15T13:12:35+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -318,7 +318,7 @@ "require": { "php": ">=5.0" }, - "time": "2014-09-10 14:34:00", + "time": "2014-09-10T14:34:00+00:00", "type": "library", "installation-source": "source", "autoload": { @@ -365,7 +365,7 @@ "require-dev": { "mockery/mockery": "~0.9.1" }, - "time": "2014-12-05 14:17:14", + "time": "2014-12-05T14:17:14+00:00", "type": "library", "extra": { "branch-alias": { @@ -419,7 +419,7 @@ "require-dev": { "phpunit/phpunit": "~4.0" }, - "time": "2014-10-12 19:18:40", + "time": "2014-10-12T19:18:40+00:00", "type": "library", "extra": { "branch-alias": { @@ -477,7 +477,7 @@ "suggest": { "ext-curl": "Guzzle will use specific adapters if cURL is present" }, - "time": "2015-05-20 03:37:09", + "time": "2015-05-20T03:37:09+00:00", "type": "library", "extra": { "branch-alias": { @@ -518,7 +518,7 @@ "reference": "82f05cd1aa3edf34e19aa7c8ca312ce13a6a577f", "shasum": "" }, - "time": "2015-07-20 20:28:12", + "time": "2015-07-20T20:28:12+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -573,7 +573,7 @@ "require-dev": { "phpunit/phpunit": "*" }, - "time": "2015-02-10 20:07:52", + "time": "2015-02-10T20:07:52+00:00", "type": "class", "extra": { "branch-alias": { @@ -632,7 +632,7 @@ "doctrine/cache": "1.*", "phpunit/phpunit": "4.*" }, - "time": "2015-08-31 12:32:49", + "time": "2015-08-31T12:32:49+00:00", "type": "library", "extra": { "branch-alias": { @@ -701,7 +701,7 @@ "replace": { "rsky/pear-core-min": "self.version" }, - "time": "2015-10-17 11:41:19", + "time": "2015-10-17T11:41:19+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -743,7 +743,7 @@ "require": { "php": ">=5.3.0" }, - "time": "2015-09-11 15:10:35", + "time": "2015-09-11T15:10:35+00:00", "type": "library", "extra": { "branch-alias": { @@ -800,7 +800,7 @@ "ext-xz": "lzma2 compression support.", "ext-zlib": "Gzip compression support." }, - "time": "2015-08-05 12:31:03", + "time": "2015-08-05T12:31:03+00:00", "type": "library", "extra": { "branch-alias": { @@ -859,7 +859,7 @@ "require": { "php": ">=5.4.0" }, - "time": "2015-07-03 13:48:55", + "time": "2015-07-03T13:48:55+00:00", "type": "library", "extra": { "branch-alias": { @@ -905,7 +905,7 @@ "require": { "php": ">=5.3.2" }, - "time": "2014-09-09 13:34:57", + "time": "2014-09-09T13:34:57+00:00", "type": "library", "extra": { "branch-alias": { @@ -964,7 +964,7 @@ "require-dev": { "phpunit/phpunit": "~4.0" }, - "time": "2015-04-14 22:21:58", + "time": "2015-04-14T22:21:58+00:00", "type": "library", "extra": { "branch-alias": { @@ -1036,7 +1036,7 @@ "require-dev": { "apigen/apigen": "4.0.*" }, - "time": "2015-06-16 13:04:27", + "time": "2015-06-16T13:04:27+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1101,7 +1101,7 @@ "codeclimate/php-test-reporter": "~0.1.2", "phpunit/phpunit": "~4.0" }, - "time": "2015-03-11 20:06:43", + "time": "2015-03-11T20:06:43+00:00", "type": "library", "extra": { "branch-alias": { @@ -1157,7 +1157,7 @@ "ext-tokenizer": "*", "php": ">=5.3" }, - "time": "2015-09-19 14:15:08", + "time": "2015-09-19T14:15:08+00:00", "type": "library", "extra": { "branch-alias": { @@ -1206,7 +1206,7 @@ "require-dev": { "phpunit/phpunit": "4.*" }, - "time": "2015-11-06 14:35:42", + "time": "2015-11-06T14:35:42+00:00", "type": "library", "extra": { "branch-alias": { @@ -1282,7 +1282,7 @@ "suggest": { "ext-curl": " to make http requests with the Client class" }, - "time": "2016-01-06 23:00:08", + "time": "2016-01-06T23:00:08+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1334,7 +1334,7 @@ "codeclimate/php-test-reporter": "dev-master", "phpunit/phpunit": "4.*" }, - "time": "2015-08-01 16:27:37", + "time": "2015-08-01T16:27:37+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1389,7 +1389,7 @@ "pear/pear-core-minimal": "v1.10.0alpha2", "phpunit/phpunit": "^4.8" }, - "time": "2016-02-15 10:52:44", + "time": "2016-02-15T10:52:44+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1435,7 +1435,7 @@ "ext-mbstring": "Use Mbstring for best performance", "ext-wfio": "Use WFIO for UTF-8 filesystem access on Windows" }, - "time": "2015-12-15 15:33:41", + "time": "2015-12-15T15:33:41+00:00", "type": "library", "extra": { "branch-alias": { @@ -1489,7 +1489,7 @@ "require": { "php": ">=5.3.0" }, - "time": "2016-02-17 22:47:09", + "time": "2016-02-17T22:47:09+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1549,7 +1549,7 @@ "suggest": { "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." }, - "time": "2016-03-18 20:34:03", + "time": "2016-03-18T20:34:03+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1594,7 +1594,7 @@ "paragonie/random_compat": "~1.0", "php": ">=5.3.3" }, - "time": "2016-01-28 22:42:02", + "time": "2016-01-28T22:42:02+00:00", "type": "library", "extra": { "branch-alias": { @@ -1677,7 +1677,7 @@ "league/flysystem-webdav": "Allows you to use WebDAV storage", "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter" }, - "time": "2016-03-14 21:54:11", + "time": "2016-03-14T21:54:11+00:00", "type": "library", "extra": { "branch-alias": { @@ -1739,7 +1739,7 @@ "require": { "php": ">=5.4.0" }, - "time": "2016-04-04 09:34:50", + "time": "2016-04-04T09:34:50+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1776,7 +1776,7 @@ "require": { "php": ">=5.3.0" }, - "time": "2016-04-19 09:28:22", + "time": "2016-04-19T09:28:22+00:00", "type": "library", "extra": { "branch-alias": { @@ -1807,49 +1807,6 @@ "minification" ] }, - { - "name": "icewind/streams", - "version": "0.4.1", - "version_normalized": "0.4.1.0", - "source": { - "type": "git", - "url": "https://github.com/icewind1991/Streams.git", - "reference": "d3620e8dc410c86c2ba55579803679c4e0b289ac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/icewind1991/Streams/zipball/d3620e8dc410c86c2ba55579803679c4e0b289ac", - "reference": "d3620e8dc410c86c2ba55579803679c4e0b289ac", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "^4.8", - "satooshi/php-coveralls": "v1.0.0" - }, - "time": "2016-06-02 14:37:52", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Icewind\\Streams\\Tests\\": "tests/", - "Icewind\\Streams\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Robin Appelman", - "email": "icewind@owncloud.com" - } - ], - "description": "A set of generic stream wrappers" - }, { "name": "guzzlehttp/guzzle", "version": "5.3.1", @@ -1873,7 +1830,7 @@ "ext-curl": "*", "phpunit/phpunit": "^4.0" }, - "time": "2016-07-15 19:28:39", + "time": "2016-07-15T19:28:39+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1925,7 +1882,7 @@ "suggest": { "ext-mbstring": "For best performance" }, - "time": "2016-05-18 14:26:46", + "time": "2016-05-18T14:26:46+00:00", "type": "library", "extra": { "branch-alias": { @@ -1994,7 +1951,7 @@ "symfony/event-dispatcher": "", "symfony/process": "" }, - "time": "2016-07-26 08:04:17", + "time": "2016-07-26T08:04:17+00:00", "type": "library", "extra": { "branch-alias": { @@ -2065,7 +2022,7 @@ "symfony/http-foundation": "For using a Symfony Request object", "symfony/yaml": "For using the YAML loader" }, - "time": "2016-08-16 14:58:24", + "time": "2016-08-16T14:58:24+00:00", "type": "library", "extra": { "branch-alias": { @@ -2134,7 +2091,7 @@ "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." }, - "time": "2016-08-18 18:49:14", + "time": "2016-08-18T18:49:14+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2227,7 +2184,7 @@ "symfony/dependency-injection": "", "symfony/http-kernel": "" }, - "time": "2016-07-19 10:45:57", + "time": "2016-07-19T10:45:57+00:00", "type": "library", "extra": { "branch-alias": { @@ -2282,7 +2239,7 @@ "require-dev": { "phpunit/phpunit": "~4.4" }, - "time": "2016-02-24 05:08:54", + "time": "2016-02-24T05:08:54+00:00", "type": "library", "extra": { "branch-alias": { @@ -2333,7 +2290,7 @@ "predis/predis": "~1.0", "satooshi/php-coveralls": "~0.6" }, - "time": "2015-12-31 16:37:02", + "time": "2015-12-31T16:37:02+00:00", "type": "library", "extra": { "branch-alias": { @@ -2405,7 +2362,7 @@ "require-dev": { "phpunit/phpunit": "~4.8|~5.0" }, - "time": "2015-12-25 13:18:31", + "time": "2015-12-25T13:18:31+00:00", "type": "library", "extra": { "branch-alias": { @@ -2480,7 +2437,7 @@ "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." }, - "time": "2016-09-09 19:13:33", + "time": "2016-09-09T19:13:33+00:00", "bin": [ "bin/doctrine-dbal" ], @@ -2545,7 +2502,7 @@ "require": { "php": ">=5.5.9" }, - "time": "2016-09-29 14:13:09", + "time": "2016-09-29T14:13:09+00:00", "type": "library", "extra": { "branch-alias": { @@ -2600,7 +2557,7 @@ "phpunit/phpunit": "*", "sabre/cs": "~1.0.0" }, - "time": "2016-10-27 04:56:33", + "time": "2016-10-27T04:56:33+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2658,7 +2615,7 @@ "phpunit/phpunit": "*", "sabre/cs": "~1.0.0" }, - "time": "2016-10-09 22:57:52", + "time": "2016-10-09T22:57:52+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2723,7 +2680,7 @@ "suggest": { "hoa/bench": "If you would like to run the benchmark scripts" }, - "time": "2016-07-15 19:52:17", + "time": "2016-07-15T19:52:17+00:00", "bin": [ "bin/vobject", "bin/generate_vcards" @@ -2817,7 +2774,7 @@ "phpunit/phpunit": "*", "sabre/cs": "~0.0.4" }, - "time": "2015-11-05 20:14:39", + "time": "2015-11-05T20:14:39+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2872,7 +2829,7 @@ "require": { "php": ">=5.3.0" }, - "time": "2016-10-10 12:19:37", + "time": "2016-10-10T12:19:37+00:00", "type": "library", "extra": { "branch-alias": { @@ -2946,7 +2903,7 @@ "ext-curl": "*", "ext-pdo": "*" }, - "time": "2016-06-28 02:44:05", + "time": "2016-06-28T02:44:05+00:00", "bin": [ "bin/sabredav", "bin/naturalselection" @@ -2987,5 +2944,48 @@ "framework", "iCalendar" ] + }, + { + "name": "icewind/streams", + "version": "0.5.2", + "version_normalized": "0.5.2.0", + "source": { + "type": "git", + "url": "https://github.com/icewind1991/Streams.git", + "reference": "6bfd2fdbd99319f5e010d0a684409189a562cb1e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/icewind1991/Streams/zipball/6bfd2fdbd99319f5e010d0a684409189a562cb1e", + "reference": "6bfd2fdbd99319f5e010d0a684409189a562cb1e", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^4.8", + "satooshi/php-coveralls": "v1.0.0" + }, + "time": "2016-12-02T14:21:23+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Icewind\\Streams\\Tests\\": "tests/", + "Icewind\\Streams\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Robin Appelman", + "email": "icewind@owncloud.com" + } + ], + "description": "A set of generic stream wrappers" } ] diff --git a/icewind/streams/src/CallbackWrapper.php b/icewind/streams/src/CallbackWrapper.php index c5847b95f..4eef55681 100644 --- a/icewind/streams/src/CallbackWrapper.php +++ b/icewind/streams/src/CallbackWrapper.php @@ -107,6 +107,8 @@ public function stream_close() { $result = parent::stream_close(); if (is_callable($this->closeCallback)) { call_user_func($this->closeCallback); + // prevent further calls by potential PHP 7 GC ghosts + $this->closeCallback = null; } return $result; } diff --git a/icewind/streams/src/Path.php b/icewind/streams/src/Path.php index 46d2156b6..bef9fd5f6 100644 --- a/icewind/streams/src/Path.php +++ b/icewind/streams/src/Path.php @@ -56,7 +56,7 @@ public function wrapPath($path) { protected function register() { if (!$this->registered) { - $this->appendDefaultContent($this->getProtocol(), $this->contextOptions); + $this->appendDefaultContent($this->contextOptions); stream_wrapper_register($this->getProtocol(), $this->class); $this->registered = true; } @@ -71,13 +71,17 @@ protected function unregister() { /** * Add values to the default stream context * - * @param string $key * @param array $values */ - protected function appendDefaultContent($key, $values) { + protected function appendDefaultContent($values) { + if (!is_array(current($values))) { + $values = array($this->getProtocol() => $values); + } $context = stream_context_get_default(); $defaults = stream_context_get_options($context); - $defaults[$key] = $values; + foreach ($values as $key => $value) { + $defaults[$key] = $value; + } stream_context_set_default($defaults); } diff --git a/icewind/streams/src/PathWrapper.php b/icewind/streams/src/PathWrapper.php new file mode 100644 index 000000000..88af7e17b --- /dev/null +++ b/icewind/streams/src/PathWrapper.php @@ -0,0 +1,25 @@ + + * This file is licensed under the Licensed under the MIT license: + * http://opensource.org/licenses/MIT + */ + +namespace Icewind\Streams; + +/** + * A string-like object that maps to an existing stream when opened + */ +class PathWrapper extends NullWrapper { + /** + * @param resource $source + * @return Path|string + */ + public static function getPath($source) { + return new Path(__CLASS__, [ + 'null' => [ + 'source' => $source + ] + ]); + } +} diff --git a/icewind/streams/src/Wrapper.php b/icewind/streams/src/Wrapper.php index 53de2942c..8e52eff9a 100644 --- a/icewind/streams/src/Wrapper.php +++ b/icewind/streams/src/Wrapper.php @@ -53,7 +53,7 @@ protected function loadContext($name) { if (isset($context[$name])) { $context = $context[$name]; } else { - throw new \BadMethodCallException('Invalid context, "callable" options not set'); + throw new \BadMethodCallException('Invalid context, "' . $name . '" options not set'); } if (isset($context['source']) and is_resource($context['source'])) { $this->setSourceStream($context['source']);