Skip to content

Commit 74a59fb

Browse files
Merge branch '3.1'
* 3.1: [PhpUnitBridge] Fix undefined variable Compatibility with Twig 1.27 Remove extra line in doc-block comment [VarDumper] Fix dumping Twig source in stack traces Enhance GAE compat by removing some realpath() [DependencyInjection] Remove old code in XML loader bumped Symfony version to 3.1.7 updated VERSION for 3.1.6 updated CHANGELOG for 3.1.6 bumped Symfony version to 2.8.14 updated VERSION for 2.8.13 updated CHANGELOG for 2.8.13 bumped Symfony version to 2.7.21 updated VERSION for 2.7.20 update CONTRIBUTORS for 2.7.20 updated CHANGELOG for 2.7.20 [SecurityBundle] Fix twig-bridge lowest dep
2 parents 70097c2 + 5f62bd1 commit 74a59fb

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class FrameworkExtension extends Extension
6565
*/
6666
public function load(array $configs, ContainerBuilder $container)
6767
{
68-
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
68+
$loader = new XmlFileLoader($container, new FileLocator(dirname(__DIR__).'/Resources/config'));
6969

7070
$loader->load('web.xml');
7171
$loader->load('services.xml');
@@ -805,7 +805,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
805805
if (class_exists('Symfony\Component\Security\Core\Exception\AuthenticationException')) {
806806
$r = new \ReflectionClass('Symfony\Component\Security\Core\Exception\AuthenticationException');
807807

808-
$dirs[] = dirname($r->getFileName()).'/../Resources/translations';
808+
$dirs[] = dirname(dirname($r->getFileName())).'/Resources/translations';
809809
}
810810
$rootDir = $container->getParameter('kernel.root_dir');
811811
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
@@ -938,21 +938,21 @@ private function getValidatorMappingFiles(ContainerBuilder $container)
938938
$dirname = dirname($reflection->getFileName());
939939

940940
if (is_file($file = $dirname.'/Resources/config/validation.xml')) {
941-
$files[0][] = realpath($file);
941+
$files[0][] = $file;
942942
$container->addResource(new FileResource($file));
943943
}
944944

945945
if (is_file($file = $dirname.'/Resources/config/validation.yml')) {
946-
$files[1][] = realpath($file);
946+
$files[1][] = $file;
947947
$container->addResource(new FileResource($file));
948948
}
949949

950950
if (is_dir($dir = $dirname.'/Resources/config/validation')) {
951951
foreach (Finder::create()->files()->in($dir)->name('*.xml') as $file) {
952-
$files[0][] = $file->getRealPath();
952+
$files[0][] = $file->getPathname();
953953
}
954954
foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) {
955-
$files[1][] = $file->getRealPath();
955+
$files[1][] = $file->getPathname();
956956
}
957957

958958
$container->addResource(new DirectoryResource($dir));
@@ -1115,15 +1115,15 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
11151115
$dirname = dirname($reflection->getFileName());
11161116

11171117
if (is_file($file = $dirname.'/Resources/config/serialization.xml')) {
1118-
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array(realpath($file)));
1118+
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file));
11191119
$definition->setPublic(false);
11201120

11211121
$serializerLoaders[] = $definition;
11221122
$container->addResource(new FileResource($file));
11231123
}
11241124

11251125
if (is_file($file = $dirname.'/Resources/config/serialization.yml')) {
1126-
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array(realpath($file)));
1126+
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file));
11271127
$definition->setPublic(false);
11281128

11291129
$serializerLoaders[] = $definition;
@@ -1132,13 +1132,13 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
11321132

11331133
if (is_dir($dir = $dirname.'/Resources/config/serialization')) {
11341134
foreach (Finder::create()->files()->in($dir)->name('*.xml') as $file) {
1135-
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file->getRealPath()));
1135+
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file->getPathname()));
11361136
$definition->setPublic(false);
11371137

11381138
$serializerLoaders[] = $definition;
11391139
}
11401140
foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) {
1141-
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file->getRealPath()));
1141+
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file->getPathname()));
11421142
$definition->setPublic(false);
11431143

11441144
$serializerLoaders[] = $definition;
@@ -1265,7 +1265,7 @@ private function getKernelRootHash(ContainerBuilder $container)
12651265
*/
12661266
public function getXsdValidationBasePath()
12671267
{
1268-
return __DIR__.'/../Resources/config/schema';
1268+
return dirname(__DIR__).'/Resources/config/schema';
12691269
}
12701270

12711271
public function getNamespace()

Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,11 +409,11 @@ public function testValidationPaths()
409409
// Testing symfony/framework-bundle with deps=high
410410
$this->assertStringEndsWith('symfony'.DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]);
411411
}
412-
$this->assertStringEndsWith('TestBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'validation.xml', $xmlMappings[1]);
412+
$this->assertStringEndsWith('TestBundle/Resources/config/validation.xml', $xmlMappings[1]);
413413

414414
$yamlMappings = $calls[4][1][0];
415415
$this->assertCount(1, $yamlMappings);
416-
$this->assertStringEndsWith('TestBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'validation.yml', $yamlMappings[0]);
416+
$this->assertStringEndsWith('TestBundle/Resources/config/validation.yml', $yamlMappings[0]);
417417
}
418418

419419
public function testValidationNoStaticMethod()

0 commit comments

Comments
 (0)