Skip to content

Commit c48ee0b

Browse files
committed
Merge branch '3.4' into 4.1
* 3.4: [Finder] fixed root directory access for ftp/sftp wrapper [FWBundle] Throw if PropertyInfo is enabled, but the component isn't installed
2 parents b1f462f + 636eb9e commit c48ee0b

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
use Symfony\Component\PropertyAccess\PropertyAccessor;
7070
use Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface;
7171
use Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface;
72+
use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface;
7273
use Symfony\Component\PropertyInfo\PropertyListExtractorInterface;
7374
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
7475
use Symfony\Component\Routing\Loader\AnnotationDirectoryLoader;
@@ -263,7 +264,7 @@ public function load(array $configs, ContainerBuilder $container)
263264
}
264265

265266
if ($this->isConfigEnabled($container, $config['property_info'])) {
266-
$this->registerPropertyInfoConfiguration($config['property_info'], $container, $loader);
267+
$this->registerPropertyInfoConfiguration($container, $loader);
267268
}
268269

269270
if ($this->isConfigEnabled($container, $config['lock'])) {
@@ -1352,8 +1353,12 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
13521353
}
13531354
}
13541355

1355-
private function registerPropertyInfoConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
1356+
private function registerPropertyInfoConfiguration(ContainerBuilder $container, XmlFileLoader $loader)
13561357
{
1358+
if (!interface_exists(PropertyInfoExtractorInterface::class)) {
1359+
throw new LogicException('PropertyInfo support cannot be enabled as the PropertyInfo component is not installed. Try running "composer require symfony/property-info".');
1360+
}
1361+
13571362
$loader->load('property_info.xml');
13581363

13591364
if (interface_exists('phpDocumentor\Reflection\DocBlockFactoryInterface')) {

src/Symfony/Component/Finder/Finder.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,12 +727,20 @@ private function searchInDirectory(string $dir): \Iterator
727727
/**
728728
* Normalizes given directory names by removing trailing slashes.
729729
*
730+
* Excluding: (s)ftp:// wrapper
731+
*
730732
* @param string $dir
731733
*
732734
* @return string
733735
*/
734736
private function normalizeDir($dir)
735737
{
736-
return rtrim($dir, '/'.\DIRECTORY_SEPARATOR);
738+
$dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR);
739+
740+
if (preg_match('#^s?ftp://#', $dir)) {
741+
$dir .= '/';
742+
}
743+
744+
return $dir;
737745
}
738746
}

0 commit comments

Comments
 (0)