From 41fd0a881e31a2e7e0efc0fc0a0e52096f6c1338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Tue, 2 Oct 2018 17:56:33 +0200 Subject: [PATCH 1/2] [FWBundle] Throw if PropertyInfo is enabled, but the component isn't installed --- .../DependencyInjection/FrameworkExtension.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index c36b85cc9a..6b33715ab6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -61,6 +61,7 @@ use Symfony\Component\Lock\StoreInterface; use Symfony\Component\PropertyAccess\PropertyAccessor; use Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface; use Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface; +use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface; use Symfony\Component\PropertyInfo\PropertyListExtractorInterface; use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface; use Symfony\Component\Routing\Loader\AnnotationDirectoryLoader; @@ -296,7 +297,7 @@ class FrameworkExtension extends Extension } if ($this->isConfigEnabled($container, $config['property_info'])) { - $this->registerPropertyInfoConfiguration($config['property_info'], $container, $loader); + $this->registerPropertyInfoConfiguration($container, $loader); } if ($this->isConfigEnabled($container, $config['lock'])) { @@ -1543,8 +1544,12 @@ class FrameworkExtension extends Extension } } - private function registerPropertyInfoConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader) + private function registerPropertyInfoConfiguration(ContainerBuilder $container, XmlFileLoader $loader) { + if (!interface_exists(PropertyInfoExtractorInterface::class)) { + throw new LogicException('PropertyInfo support cannot be enabled as the PropertyInfo component is not installed. Try running "composer require symfony/property-info".'); + } + $loader->load('property_info.xml'); $container->getDefinition('property_info')->setPrivate(true); From 9630a38d67811b1849293d29e18b7039b5507c33 Mon Sep 17 00:00:00 2001 From: Gerd Christian Kunze Date: Wed, 26 Sep 2018 12:57:02 +0200 Subject: [PATCH 2/2] [Finder] fixed root directory access for ftp/sftp wrapper --- src/Symfony/Component/Finder/Finder.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Finder/Finder.php b/src/Symfony/Component/Finder/Finder.php index 2270b36226..0501629701 100644 --- a/src/Symfony/Component/Finder/Finder.php +++ b/src/Symfony/Component/Finder/Finder.php @@ -732,12 +732,20 @@ class Finder implements \IteratorAggregate, \Countable /** * Normalizes given directory names by removing trailing slashes. * + * Excluding: (s)ftp:// wrapper + * * @param string $dir * * @return string */ private function normalizeDir($dir) { - return rtrim($dir, '/'.\DIRECTORY_SEPARATOR); + $dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR); + + if (preg_match('#^s?ftp://#', $dir)) { + $dir .= '/'; + } + + return $dir; } }