-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Enhance GAE compat by removing some realpath() #20292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ class FrameworkExtension extends Extension | |
*/ | ||
public function load(array $configs, ContainerBuilder $container) | ||
{ | ||
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | ||
$loader = new XmlFileLoader($container, new FileLocator(dirname(__DIR__).'/Resources/config')); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just asking: is this kind of change needed to solve the GAE issues? I agree with @xabbuh that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a DI extension, we don't care about perf :) And yes it is: realpath removes these |
||
|
||
$loader->load('web.xml'); | ||
$loader->load('services.xml'); | ||
|
@@ -689,7 +689,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder | |
if (class_exists('Symfony\Component\Security\Core\Exception\AuthenticationException')) { | ||
$r = new \ReflectionClass('Symfony\Component\Security\Core\Exception\AuthenticationException'); | ||
|
||
$dirs[] = dirname($r->getFileName()).'/../Resources/translations'; | ||
$dirs[] = dirname(dirname($r->getFileName())).'/Resources/translations'; | ||
} | ||
$rootDir = $container->getParameter('kernel.root_dir'); | ||
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) { | ||
|
@@ -811,21 +811,21 @@ private function getValidatorMappingFiles(ContainerBuilder $container) | |
$dirname = dirname($reflection->getFileName()); | ||
|
||
if (is_file($file = $dirname.'/Resources/config/validation.xml')) { | ||
$files[0][] = realpath($file); | ||
$files[0][] = $file; | ||
$container->addResource(new FileResource($file)); | ||
} | ||
|
||
if (is_file($file = $dirname.'/Resources/config/validation.yml')) { | ||
$files[1][] = realpath($file); | ||
$files[1][] = $file; | ||
$container->addResource(new FileResource($file)); | ||
} | ||
|
||
if (is_dir($dir = $dirname.'/Resources/config/validation')) { | ||
foreach (Finder::create()->files()->in($dir)->name('*.xml') as $file) { | ||
$files[0][] = $file->getRealPath(); | ||
$files[0][] = $file->getPathname(); | ||
} | ||
foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) { | ||
$files[1][] = $file->getRealPath(); | ||
$files[1][] = $file->getPathname(); | ||
} | ||
|
||
$container->addResource(new DirectoryResource($dir)); | ||
|
@@ -926,15 +926,15 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder | |
$dirname = dirname($reflection->getFileName()); | ||
|
||
if (is_file($file = $dirname.'/Resources/config/serialization.xml')) { | ||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array(realpath($file))); | ||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file)); | ||
$definition->setPublic(false); | ||
|
||
$serializerLoaders[] = $definition; | ||
$container->addResource(new FileResource($file)); | ||
} | ||
|
||
if (is_file($file = $dirname.'/Resources/config/serialization.yml')) { | ||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array(realpath($file))); | ||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file)); | ||
$definition->setPublic(false); | ||
|
||
$serializerLoaders[] = $definition; | ||
|
@@ -943,13 +943,13 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder | |
|
||
if (is_dir($dir = $dirname.'/Resources/config/serialization')) { | ||
foreach (Finder::create()->files()->in($dir)->name('*.xml') as $file) { | ||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file->getRealPath())); | ||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file->getPathname())); | ||
$definition->setPublic(false); | ||
|
||
$serializerLoaders[] = $definition; | ||
} | ||
foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) { | ||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file->getRealPath())); | ||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file->getPathname())); | ||
$definition->setPublic(false); | ||
|
||
$serializerLoaders[] = $definition; | ||
|
@@ -996,7 +996,7 @@ private function getKernelRootHash(ContainerBuilder $container) | |
*/ | ||
public function getXsdValidationBasePath() | ||
{ | ||
return __DIR__.'/../Resources/config/schema'; | ||
return dirname(__DIR__).'/Resources/config/schema'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we don't really care about a realpath here though (unless GAE also does not support |
||
} | ||
|
||
public function getNamespace() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this breaks BC, because Doctrine does not follow symlinks when reading mapping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure to get what you mean. Does this need a fix? (can you send it please?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah sorry, I looked at it too fast and missed the fact that it was not removed entirely but only when realpath fails.