From adb5327dbbdc06e5a0db6009efd55eb14fdcfba1 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 14 Aug 2015 12:18:53 +0200 Subject: [PATCH 1/2] [FrameworkBundle] Fix precedence of xdebug.file_link_format --- .../DependencyInjection/FrameworkExtension.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 127e7f9c84..75e45202de 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -356,14 +356,16 @@ class FrameworkExtension extends Extension $loader->load('templating.xml'); $loader->load('templating_php.xml'); - $links = array( - 'textmate' => 'txmt://open?url=file://%%f&line=%%l', - 'macvim' => 'mvim://open?url=file://%%f&line=%%l', - 'emacs' => 'emacs://open?url=file://%%f&line=%%l', - 'sublime' => 'subl://open?url=file://%%f&line=%%l', - ); + if (!$container->hasParameter('templating.helper.code.file_link_format')) { + $links = array( + 'textmate' => 'txmt://open?url=file://%%f&line=%%l', + 'macvim' => 'mvim://open?url=file://%%f&line=%%l', + 'emacs' => 'emacs://open?url=file://%%f&line=%%l', + 'sublime' => 'subl://open?url=file://%%f&line=%%l', + ); - $container->setParameter('templating.helper.code.file_link_format', isset($links[$ide]) ? $links[$ide] : $ide); + $container->setParameter('templating.helper.code.file_link_format', ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: (isset($links[$ide]) ? $links[$ide] : $ide)); + } $container->setParameter('templating.helper.form.resources', $config['form']['resources']); $container->setParameter('fragment.renderer.hinclude.global_template', $config['hinclude_default_template']); From cbe6bc9ac4cc1f866e20666e2fb0395f375f3d5f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 24 Aug 2015 08:32:52 +0200 Subject: [PATCH 2/2] fixed CS --- src/Symfony/Component/Finder/Tests/Shell/CommandTest.php | 2 +- src/Symfony/Component/HttpFoundation/Request.php | 2 +- src/Symfony/Component/HttpFoundation/Tests/RequestTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Finder/Tests/Shell/CommandTest.php b/src/Symfony/Component/Finder/Tests/Shell/CommandTest.php index 8c6c0064cd..f967cdaa54 100644 --- a/src/Symfony/Component/Finder/Tests/Shell/CommandTest.php +++ b/src/Symfony/Component/Finder/Tests/Shell/CommandTest.php @@ -133,7 +133,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase public function testErrorHandler() { $cmd = Command::create(); - $handler = function() { return 'error-handler'; }; + $handler = function () { return 'error-handler'; }; $cmd->setErrorHandler($handler); $this->assertSame($handler, $cmd->getErrorHandler()); diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index 0bd76f3aba..f591ca90be 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -1479,7 +1479,7 @@ class Request // Content passed in parameter (test) if (is_string($this->content)) { - $resource = fopen('php://temp','r+'); + $resource = fopen('php://temp', 'r+'); fwrite($resource, $this->content); rewind($resource); diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php index 797a00acda..bc4b0fd5a2 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php @@ -934,7 +934,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase public function testContentAsResource() { - $resource = fopen('php://memory','r+'); + $resource = fopen('php://memory', 'r+'); fwrite($resource, 'My other content'); rewind($resource);