Skip to content

Commit e167d63

Browse files
Merge branch '2.7' into 2.8
* 2.7: Compatibility with Twig 1.27 Enhance GAE compat by removing some realpath() 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 d12a681 + 502a03b commit e167d63

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
@@ -52,7 +52,7 @@ class FrameworkExtension extends Extension
5252
*/
5353
public function load(array $configs, ContainerBuilder $container)
5454
{
55-
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
55+
$loader = new XmlFileLoader($container, new FileLocator(dirname(__DIR__).'/Resources/config'));
5656

5757
$loader->load('web.xml');
5858
$loader->load('services.xml');
@@ -693,7 +693,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
693693
if (class_exists('Symfony\Component\Security\Core\Exception\AuthenticationException')) {
694694
$r = new \ReflectionClass('Symfony\Component\Security\Core\Exception\AuthenticationException');
695695

696-
$dirs[] = dirname($r->getFileName()).'/../Resources/translations';
696+
$dirs[] = dirname(dirname($r->getFileName())).'/Resources/translations';
697697
}
698698
$rootDir = $container->getParameter('kernel.root_dir');
699699
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
@@ -824,21 +824,21 @@ private function getValidatorMappingFiles(ContainerBuilder $container)
824824
$dirname = dirname($reflection->getFileName());
825825

826826
if (is_file($file = $dirname.'/Resources/config/validation.xml')) {
827-
$files[0][] = realpath($file);
827+
$files[0][] = $file;
828828
$container->addResource(new FileResource($file));
829829
}
830830

831831
if (is_file($file = $dirname.'/Resources/config/validation.yml')) {
832-
$files[1][] = realpath($file);
832+
$files[1][] = $file;
833833
$container->addResource(new FileResource($file));
834834
}
835835

836836
if (is_dir($dir = $dirname.'/Resources/config/validation')) {
837837
foreach (Finder::create()->files()->in($dir)->name('*.xml') as $file) {
838-
$files[0][] = $file->getRealPath();
838+
$files[0][] = $file->getPathname();
839839
}
840840
foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) {
841-
$files[1][] = $file->getRealPath();
841+
$files[1][] = $file->getPathname();
842842
}
843843

844844
$container->addResource(new DirectoryResource($dir));
@@ -946,15 +946,15 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
946946
$dirname = dirname($reflection->getFileName());
947947

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

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

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

960960
$serializerLoaders[] = $definition;
@@ -963,13 +963,13 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
963963

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

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

975975
$serializerLoaders[] = $definition;
@@ -1042,7 +1042,7 @@ private function getKernelRootHash(ContainerBuilder $container)
10421042
*/
10431043
public function getXsdValidationBasePath()
10441044
{
1045-
return __DIR__.'/../Resources/config/schema';
1045+
return dirname(__DIR__).'/Resources/config/schema';
10461046
}
10471047

10481048
public function getNamespace()

Tests/DependencyInjection/FrameworkExtensionTest.php

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

376376
$yamlMappings = $calls[4][1][0];
377377
$this->assertCount(1, $yamlMappings);
378-
$this->assertStringEndsWith('TestBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'validation.yml', $yamlMappings[0]);
378+
$this->assertStringEndsWith('TestBundle/Resources/config/validation.yml', $yamlMappings[0]);
379379
}
380380

381381
public function testValidationNoStaticMethod()

0 commit comments

Comments
 (0)