From de7b348dddce2d2f2c5984c9af573501a491e49c Mon Sep 17 00:00:00 2001 From: Boris Nikolaus Betzholz Date: Fri, 22 Dec 2017 08:53:40 +0100 Subject: [PATCH 1/6] Problem in phar If packed into phar the old version creates path like 'file:///phar%3A/'. --- .../Component/DependencyInjection/Loader/XmlFileLoader.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index 598cf36f859a6..d1440fe84aa58 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -599,6 +599,7 @@ public function validateSchema(\DOMDocument $dom) $imports = ''; foreach ($schemaLocations as $namespace => $location) { $parts = explode('/', $location); + $locationstart= 'file:///'; if (0 === stripos($location, 'phar://')) { $tmpfile = tempnam(sys_get_temp_dir(), 'symfony'); if ($tmpfile) { @@ -606,9 +607,11 @@ public function validateSchema(\DOMDocument $dom) $tmpfiles[] = $tmpfile; $parts = explode('/', str_replace('\\', '/', $tmpfile)); } + array_shift($parts); + $locationstart='phar:///'; } $drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : ''; - $location = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts)); + $location = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts)); $imports .= sprintf(' '."\n", $namespace, $location); } From 4b93eb52b662afa26786f13a7509164f4da1fe4c Mon Sep 17 00:00:00 2001 From: Boris Nikolaus Betzholz Date: Fri, 22 Dec 2017 09:38:54 +0100 Subject: [PATCH 2/6] Phar Problem like last commit: If packed into phar the old version creates path like 'file:///phar%3A/'. --- src/Symfony/Component/Translation/Loader/XliffFileLoader.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Translation/Loader/XliffFileLoader.php b/src/Symfony/Component/Translation/Loader/XliffFileLoader.php index 31ab0be3b1660..9f01b5f063f5a 100644 --- a/src/Symfony/Component/Translation/Loader/XliffFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/XliffFileLoader.php @@ -234,16 +234,19 @@ private function fixXmlLocation($schemaSource, $xmlUri) { $newPath = str_replace('\\', '/', __DIR__).'/schema/dic/xliff-core/xml.xsd'; $parts = explode('/', $newPath); + $locationstart= 'file:///'; if (0 === stripos($newPath, 'phar://')) { $tmpfile = tempnam(sys_get_temp_dir(), 'symfony'); if ($tmpfile) { copy($newPath, $tmpfile); $parts = explode('/', str_replace('\\', '/', $tmpfile)); } + array_shift($parts); + $locationstart='phar:///'; } $drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : ''; - $newPath = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts)); + $newPath = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts)); return str_replace($xmlUri, $newPath, $schemaSource); } From 5a608e61a46fad99ac95ddab86898d6ae61a57b0 Mon Sep 17 00:00:00 2001 From: Boris Betzholz Date: Sat, 23 Dec 2017 11:28:09 +0100 Subject: [PATCH 3/6] Fabbot --- .../Component/DependencyInjection/Loader/XmlFileLoader.php | 4 ++-- src/Symfony/Component/Translation/Loader/XliffFileLoader.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index d1440fe84aa58..41b9715d0877a 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -599,7 +599,7 @@ public function validateSchema(\DOMDocument $dom) $imports = ''; foreach ($schemaLocations as $namespace => $location) { $parts = explode('/', $location); - $locationstart= 'file:///'; + $locationstart = 'file:///'; if (0 === stripos($location, 'phar://')) { $tmpfile = tempnam(sys_get_temp_dir(), 'symfony'); if ($tmpfile) { @@ -608,7 +608,7 @@ public function validateSchema(\DOMDocument $dom) $parts = explode('/', str_replace('\\', '/', $tmpfile)); } array_shift($parts); - $locationstart='phar:///'; + $locationstart = 'phar:///'; } $drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : ''; $location = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts)); diff --git a/src/Symfony/Component/Translation/Loader/XliffFileLoader.php b/src/Symfony/Component/Translation/Loader/XliffFileLoader.php index 9f01b5f063f5a..c6b9cbc132f9d 100644 --- a/src/Symfony/Component/Translation/Loader/XliffFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/XliffFileLoader.php @@ -234,7 +234,7 @@ private function fixXmlLocation($schemaSource, $xmlUri) { $newPath = str_replace('\\', '/', __DIR__).'/schema/dic/xliff-core/xml.xsd'; $parts = explode('/', $newPath); - $locationstart= 'file:///'; + $locationstart = 'file:///'; if (0 === stripos($newPath, 'phar://')) { $tmpfile = tempnam(sys_get_temp_dir(), 'symfony'); if ($tmpfile) { @@ -242,7 +242,7 @@ private function fixXmlLocation($schemaSource, $xmlUri) $parts = explode('/', str_replace('\\', '/', $tmpfile)); } array_shift($parts); - $locationstart='phar:///'; + $locationstart = 'phar:///'; } $drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : ''; From 41cdd7953603e2a67b228be5d6293cfb9e73b1f4 Mon Sep 17 00:00:00 2001 From: Boris Betzholz Date: Sat, 23 Dec 2017 13:16:35 +0100 Subject: [PATCH 4/6] Phar only when Tmpfile cannot be written --- .../Component/DependencyInjection/Loader/XmlFileLoader.php | 6 ++++-- .../Component/Translation/Loader/XliffFileLoader.php | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index 41b9715d0877a..36d98dfd7c56f 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -606,9 +606,11 @@ public function validateSchema(\DOMDocument $dom) copy($location, $tmpfile); $tmpfiles[] = $tmpfile; $parts = explode('/', str_replace('\\', '/', $tmpfile)); + + }else{ + array_shift($parts); + $locationstart = 'phar:///'; } - array_shift($parts); - $locationstart = 'phar:///'; } $drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : ''; $location = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts)); diff --git a/src/Symfony/Component/Translation/Loader/XliffFileLoader.php b/src/Symfony/Component/Translation/Loader/XliffFileLoader.php index c6b9cbc132f9d..58667e85003e4 100644 --- a/src/Symfony/Component/Translation/Loader/XliffFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/XliffFileLoader.php @@ -240,9 +240,10 @@ private function fixXmlLocation($schemaSource, $xmlUri) if ($tmpfile) { copy($newPath, $tmpfile); $parts = explode('/', str_replace('\\', '/', $tmpfile)); + }else{ + array_shift($parts); + $locationstart = 'phar:///'; } - array_shift($parts); - $locationstart = 'phar:///'; } $drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : ''; From 0652dcce4eac79740777fd55bb5be7ac009775e8 Mon Sep 17 00:00:00 2001 From: Boris Betzholz Date: Sat, 23 Dec 2017 13:17:43 +0100 Subject: [PATCH 5/6] Fabbot, i am sorry --- .../Component/DependencyInjection/Loader/XmlFileLoader.php | 2 +- src/Symfony/Component/Translation/Loader/XliffFileLoader.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index 36d98dfd7c56f..e1ca9323538bd 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -607,7 +607,7 @@ public function validateSchema(\DOMDocument $dom) $tmpfiles[] = $tmpfile; $parts = explode('/', str_replace('\\', '/', $tmpfile)); - }else{ + } else { array_shift($parts); $locationstart = 'phar:///'; } diff --git a/src/Symfony/Component/Translation/Loader/XliffFileLoader.php b/src/Symfony/Component/Translation/Loader/XliffFileLoader.php index 58667e85003e4..8e4e5a787bc8c 100644 --- a/src/Symfony/Component/Translation/Loader/XliffFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/XliffFileLoader.php @@ -240,7 +240,7 @@ private function fixXmlLocation($schemaSource, $xmlUri) if ($tmpfile) { copy($newPath, $tmpfile); $parts = explode('/', str_replace('\\', '/', $tmpfile)); - }else{ + } else { array_shift($parts); $locationstart = 'phar:///'; } From d04b98a912b0d997ef7f372adb13714d1c47cd2f Mon Sep 17 00:00:00 2001 From: Boris Betzholz Date: Sat, 23 Dec 2017 13:18:57 +0100 Subject: [PATCH 6/6] Fabbot, i am sorry --- .../Component/DependencyInjection/Loader/XmlFileLoader.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index e1ca9323538bd..4b7ef92e09ce4 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -606,7 +606,6 @@ public function validateSchema(\DOMDocument $dom) copy($location, $tmpfile); $tmpfiles[] = $tmpfile; $parts = explode('/', str_replace('\\', '/', $tmpfile)); - } else { array_shift($parts); $locationstart = 'phar:///'; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy