Skip to content

Commit 5f62bd1

Browse files
Merge branch '2.8' into 3.1
* 2.8: Compatibility with Twig 1.27 [VarDumper] Fix dumping Twig source in stack traces Enhance GAE compat by removing some realpath() 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 9f4cb23 + e167d63 commit 5f62bd1

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
@@ -58,7 +58,7 @@ class FrameworkExtension extends Extension
5858
*/
5959
public function load(array $configs, ContainerBuilder $container)
6060
{
61-
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
61+
$loader = new XmlFileLoader($container, new FileLocator(dirname(__DIR__).'/Resources/config'));
6262

6363
$loader->load('web.xml');
6464
$loader->load('services.xml');
@@ -686,7 +686,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
686686
if (class_exists('Symfony\Component\Security\Core\Exception\AuthenticationException')) {
687687
$r = new \ReflectionClass('Symfony\Component\Security\Core\Exception\AuthenticationException');
688688

689-
$dirs[] = dirname($r->getFileName()).'/../Resources/translations';
689+
$dirs[] = dirname(dirname($r->getFileName())).'/Resources/translations';
690690
}
691691
$rootDir = $container->getParameter('kernel.root_dir');
692692
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
@@ -811,21 +811,21 @@ private function getValidatorMappingFiles(ContainerBuilder $container)
811811
$dirname = dirname($reflection->getFileName());
812812

813813
if (is_file($file = $dirname.'/Resources/config/validation.xml')) {
814-
$files[0][] = realpath($file);
814+
$files[0][] = $file;
815815
$container->addResource(new FileResource($file));
816816
}
817817

818818
if (is_file($file = $dirname.'/Resources/config/validation.yml')) {
819-
$files[1][] = realpath($file);
819+
$files[1][] = $file;
820820
$container->addResource(new FileResource($file));
821821
}
822822

823823
if (is_dir($dir = $dirname.'/Resources/config/validation')) {
824824
foreach (Finder::create()->files()->in($dir)->name('*.xml') as $file) {
825-
$files[0][] = $file->getRealPath();
825+
$files[0][] = $file->getPathname();
826826
}
827827
foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) {
828-
$files[1][] = $file->getRealPath();
828+
$files[1][] = $file->getPathname();
829829
}
830830

831831
$container->addResource(new DirectoryResource($dir));
@@ -948,15 +948,15 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
948948
$dirname = dirname($reflection->getFileName());
949949

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

954954
$serializerLoaders[] = $definition;
955955
$container->addResource(new FileResource($file));
956956
}
957957

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

962962
$serializerLoaders[] = $definition;
@@ -965,13 +965,13 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
965965

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

971971
$serializerLoaders[] = $definition;
972972
}
973973
foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) {
974-
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file->getRealPath()));
974+
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file->getPathname()));
975975
$definition->setPublic(false);
976976

977977
$serializerLoaders[] = $definition;
@@ -1094,7 +1094,7 @@ private function getKernelRootHash(ContainerBuilder $container)
10941094
*/
10951095
public function getXsdValidationBasePath()
10961096
{
1097-
return __DIR__.'/../Resources/config/schema';
1097+
return dirname(__DIR__).'/Resources/config/schema';
10981098
}
10991099

11001100
public function getNamespace()

Tests/DependencyInjection/FrameworkExtensionTest.php

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

403403
$yamlMappings = $calls[4][1][0];
404404
$this->assertCount(1, $yamlMappings);
405-
$this->assertStringEndsWith('TestBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'validation.yml', $yamlMappings[0]);
405+
$this->assertStringEndsWith('TestBundle/Resources/config/validation.yml', $yamlMappings[0]);
406406
}
407407

408408
public function testValidationNoStaticMethod()

0 commit comments

Comments
 (0)