From eda6467913d292653270a467a68ad76642943974 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 1 Aug 2015 07:22:16 +0200 Subject: php-symfony: 2.7.3 --- php-symfony-pr15249.patch | 173 ---------------------------------------------- php-symfony.spec | 22 +++--- 2 files changed, 8 insertions(+), 187 deletions(-) delete mode 100644 php-symfony-pr15249.patch diff --git a/php-symfony-pr15249.patch b/php-symfony-pr15249.patch deleted file mode 100644 index fc41718..0000000 --- a/php-symfony-pr15249.patch +++ /dev/null @@ -1,173 +0,0 @@ -From eb80fbb48ce47070507918fd692f8c20f65816dd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= -Date: Thu, 9 Jul 2015 11:23:44 +0200 -Subject: [PATCH 1/3] [HttpFoundation] Allow to use resources as content body - and to return resources from string content. - ---- - src/Symfony/Component/HttpFoundation/Request.php | 52 +++++++++++++++------- - .../Component/HttpFoundation/Tests/RequestTest.php | 20 +++++++++ - 2 files changed, 57 insertions(+), 15 deletions(-) - -diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php -index 84b3a69..6fa20ac 100644 ---- a/src/Symfony/Component/HttpFoundation/Request.php -+++ b/src/Symfony/Component/HttpFoundation/Request.php -@@ -199,13 +199,13 @@ class Request - /** - * Constructor. - * -- * @param array $query The GET parameters -- * @param array $request The POST parameters -- * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) -- * @param array $cookies The COOKIE parameters -- * @param array $files The FILES parameters -- * @param array $server The SERVER parameters -- * @param string $content The raw body data -+ * @param array $query The GET parameters -+ * @param array $request The POST parameters -+ * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) -+ * @param array $cookies The COOKIE parameters -+ * @param array $files The FILES parameters -+ * @param array $server The SERVER parameters -+ * @param string|resource $content The raw body data - * - * @api - */ -@@ -219,13 +219,13 @@ public function __construct(array $query = array(), array $request = array(), ar - * - * This method also re-initializes all properties. - * -- * @param array $query The GET parameters -- * @param array $request The POST parameters -- * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) -- * @param array $cookies The COOKIE parameters -- * @param array $files The FILES parameters -- * @param array $server The SERVER parameters -- * @param string $content The raw body data -+ * @param array $query The GET parameters -+ * @param array $request The POST parameters -+ * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) -+ * @param array $cookies The COOKIE parameters -+ * @param array $files The FILES parameters -+ * @param array $server The SERVER parameters -+ * @param string|resource $content The raw body data - * - * @api - */ -@@ -1465,16 +1465,38 @@ public function isMethodSafe() - */ - public function getContent($asResource = false) - { -- if (PHP_VERSION_ID < 50600 && (false === $this->content || (true === $asResource && null !== $this->content))) { -+ $currentContentIsResource = is_resource($this->content); -+ if (PHP_VERSION_ID < 50600 && !$currentContentIsResource && (false === $this->content || (true === $asResource && null !== $this->content))) { - throw new \LogicException('getContent() can only be called once when using the resource return type and PHP below 5.6.'); - } - - if (true === $asResource) { -+ if ($currentContentIsResource) { -+ rewind($this->content); -+ -+ return $this->content; -+ } -+ -+ // Content passed in parameter (test) -+ if (is_string($this->content)) { -+ $resource = fopen('php://temp','r+'); -+ fwrite($resource, $this->content); -+ rewind($resource); -+ -+ return $resource; -+ } -+ - $this->content = false; - - return fopen('php://input', 'rb'); - } - -+ if ($currentContentIsResource) { -+ rewind($this->content); -+ -+ return stream_get_contents($this->content); -+ } -+ - if (null === $this->content) { - $this->content = file_get_contents('php://input'); - } -diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php -index 366b555..fcc73f5 100644 ---- a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php -+++ b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php -@@ -923,6 +923,26 @@ public function testGetContentReturnsResource() - $this->assertTrue(feof($retval)); - } - -+ public function testGetContentReturnsResourceWhenContentSetInConstructor() -+ { -+ $req = new Request(array(), array(), array(), array(), array(), array(), 'MyContent'); -+ $resource = $req->getContent(true); -+ -+ $this->assertTrue(is_resource($resource)); -+ $this->assertEquals('MyContent', stream_get_contents($resource)); -+ } -+ -+ public function testContentAsResource() -+ { -+ $resource = fopen('php://memory','r+'); -+ fwrite($resource, 'My other content'); -+ rewind($resource); -+ -+ $req = new Request(array(), array(), array(), array(), array(), array(), $resource); -+ $this->assertEquals('My other content', stream_get_contents($req->getContent(true))); -+ $this->assertEquals('My other content', $req->getContent()); -+ } -+ - /** - * @expectedException \LogicException - * @dataProvider getContentCantBeCalledTwiceWithResourcesProvider - -From bb6db5768b5bb7e3b1f5e71656d3ddf779151006 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= -Date: Thu, 16 Jul 2015 08:17:59 +0200 -Subject: [PATCH 2/3] Simplify condition - ---- - src/Symfony/Component/HttpFoundation/Request.php | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php -index 6fa20ac..2d28251 100644 ---- a/src/Symfony/Component/HttpFoundation/Request.php -+++ b/src/Symfony/Component/HttpFoundation/Request.php -@@ -1466,7 +1466,7 @@ public function isMethodSafe() - public function getContent($asResource = false) - { - $currentContentIsResource = is_resource($this->content); -- if (PHP_VERSION_ID < 50600 && !$currentContentIsResource && (false === $this->content || (true === $asResource && null !== $this->content))) { -+ if (PHP_VERSION_ID < 50600 && false === $this->content) { - throw new \LogicException('getContent() can only be called once when using the resource return type and PHP below 5.6.'); - } - - -From fc90cfa0c70677b5b119cbbd882059552468d84b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= -Date: Thu, 16 Jul 2015 08:34:36 +0200 -Subject: [PATCH 3/3] Fix test - ---- - src/Symfony/Component/HttpFoundation/Tests/RequestTest.php | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php -index fcc73f5..797a00a 100644 ---- a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php -+++ b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php -@@ -987,7 +987,6 @@ public function getContentCantBeCalledTwiceWithResourcesProvider() - return array( - 'Resource then fetch' => array(true, false), - 'Resource then resource' => array(true, true), -- 'Fetch then resource' => array(false, true), - ); - } - diff --git a/php-symfony.spec b/php-symfony.spec index 241c73c..61df960 100644 --- a/php-symfony.spec +++ b/php-symfony.spec @@ -14,8 +14,8 @@ %{!?php_version: %global php_version %(php -r 'echo PHP_VERSION;' 2>/dev/null)} %global github_owner symfony %global github_name symfony -%global github_version 2.7.2 -%global github_commit 969d709ad428076bf1084e386dc26dd904d9fb84 +%global github_version 2.7.3 +%global github_commit a9af4708b4bb650c4897e9b8dfbfbdb2ea5f0486 %global github_short %(c=%{github_commit}; echo ${c:0:7}) %global composer_vendor symfony @@ -90,7 +90,7 @@ Name: php-%{composer_project} Version: %{github_version} -Release: 3%{?dist} +Release: 1%{?dist} Summary: PHP framework for web projects Group: Development/Libraries @@ -98,12 +98,6 @@ License: MIT URL: http://symfony.com Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_short}.tar.gz -# [HttpFoundation] [PSR-7] Allow to use resources as content body and to return -# resources from string content -# https://github.com/symfony/symfony/pull/15249 -# https://github.com/symfony/psr-http-message-bridge/issues/8 -Patch0: %{name}-pr15249.patch - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch # Tests @@ -1644,9 +1638,6 @@ The YAML Component loads and dumps YAML files. %prep %setup -qn %{github_name}-%{github_commit} -%patch0 -p1 -rm -f src/Symfony/Component/HttpFoundation/Request.php.orig - : Remove unnecessary files find src -name '.git*' -delete @@ -1742,7 +1733,7 @@ sed -e 's#function testSpecialVars56#function SKIP_testSpecialVars56#' \ -e 's#function testGlobalsNoExt#function SKIP_testGlobalsNoExt#' \ -e 's#function testBuggyRefs#function SKIP_testBuggyRefs#' \ -i src/Symfony/Component/VarDumper/Tests/CliDumperTest.php -rm -f \ +rm src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php \ src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php \ src/Symfony/Bundle/SecurityBundle/Tests/Functional/CsrfFormLoginTest.php \ src/Symfony/Bundle/SecurityBundle/Tests/Functional/FormLoginTest.php \ @@ -2512,7 +2503,10 @@ exit $RET # ############################################################################## %changelog -* Mon Jul 21 2015 Shawn Iwinski - 2.7.2-3 +* Fri Jul 31 2015 Remi Collet - 2.7.3-1 +- Update to 2.7.3 + +* Tue Jul 21 2015 Shawn Iwinski - 2.7.2-3 - Added patch for symfony/psr-http-message-bridge - Removed php-mysql dependency from var-dumper -- cgit