This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Fabien Potencier b6a98bfc98 merged branch dpb587/patch-trace (PR #2593)
Commits
-------

4858fbe [TwigBundle] Fix trace to not show 'in at line' when file/line are empty.

Discussion
----------

[TwigBundle] Fix trace to not show 'in at line' when file/line are empty.

Occasionally I saw call stacks where file/line are empty in the raw exception object, but the trace.html.twig file was still showing 'in at line' with empty values. I believe this fixes that.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -

---------------------------------------------------------------------------

by fabpot at 2011/11/09 22:49:35 -0800

The current code looks correct to me. Can you try with the latest version of Twig to be sure that you don't have this issue because of a bug in Twig that has been fixed since then?

---------------------------------------------------------------------------

by dpb587 at 2011/11/10 07:20:34 -0800

Thanks for the feedback. Should I change my patch to check that both are defined and non-empty, such as `trace.file is defined and trace.file and trace.line is defined and trace.line`?

I think the issue is that I'm seeing the file and line keys are defined but empty. I created another branch with a pseudo-test case that shows a little more information. Using symfony-standard with symfony in deps as follows and symfony/twig removed from deps.lock.

    [symfony]
        git=git://github.com/dpb587/symfony.git
        version=origin/patch-trace-debug

Then running the following:

    phpunit -c app/ vendor/symfony/tests/Symfony/Tests/Bundle/TwigBundle/Controller/ExceptionController.php

The test (is backwards) and passes, dumping the following (this call happens right after a call_user_func):

    Array
    (
        [namespace] => Symfony\Bundle\FrameworkBundle\EventListener
        [short_class] => RouterListener
        [class] => Symfony\Bundle\FrameworkBundle\EventListener\RouterListener
        [type] => ->
        [function] => onKernelRequest
        [file] =>
        [line] =>
        [args] => Array
            (
                [0] => Array
                    (
                        [0] => object
                        [1] => Symfony\Component\HttpKernel\Event\GetResponseEvent
                    )

            )

    )

I saw the same results with two php versions:

    PHP 5.3.3-7+squeeze3 with Suhosin-Patch (cli) (built: Jun 28 2011 08:24:40)
    Copyright (c) 1997-2009 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
        with Xdebug v2.1.1, Copyright (c) 2002-2011, by Derick Rethans
        with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

    PHP 5.3.8 (cli) (built: Nov  4 2011 05:43:22)
    Copyright (c) 1997-2011 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
        with the ionCube PHP Loader v4.0.10, Copyright (c) 2002-2011, by ionCube Ltd., and
        with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies

Sorry if I'm simply missing something or doing something silly.

---------------------------------------------------------------------------

by fabpot at 2011/11/11 13:12:21 -0800

`trace.file is defined and trace.file and trace.line is defined and trace.line` looks good to me.
2011-11-12 09:19:12 +01:00
src/Symfony merged branch dpb587/patch-trace (PR #2593) 2011-11-12 09:19:12 +01:00
tests merged branch jalliot/file_widget (PR #2608) 2011-11-11 22:01:59 +01:00
.gitignore Added vendor directory to .gitignore 2010-06-24 10:44:28 +02:00
autoload.php.dist fixed autoloader when tests are run on a machine without intl installed 2011-07-20 14:27:10 +02:00
CHANGELOG-2.0.md updated CHANGELOG for 2.0.5 2011-11-02 12:39:10 +01:00
check_cs fixed root search path to include only './src' and './tests' 2011-06-08 18:11:05 +02:00
composer.json bumped Symfony version to 2.0.6-DEV 2011-11-02 14:18:45 +01:00
CONTRIBUTORS.md update CONTRIBUTORS for 2.0.1 2011-11-02 12:39:30 +01:00
LICENSE added the LICENSE file for the YAML component 2011-02-18 11:52:11 +01:00
phpunit.xml.dist [Security] cleaned up opt-in to benchmark test 2011-03-06 20:06:13 +01:00
README.md [README] Adding a small section with information about contributing. 2011-09-23 11:21:11 -05:00
UPDATE.ja.md updated translation of UPDATE file (Japanese RC5 added) 2011-07-30 02:08:25 +09:00
UPDATE.md updated UPDATE file 2011-07-22 17:45:02 +02:00
vendors.php updated vendors for 2.0.5 2011-11-02 12:34:34 +01:00

README

What is Symfony2?

Symfony2 is a PHP 5.3 full-stack web framework. It is written with speed and flexibility in mind. It allows developers to build better and easy to maintain websites with PHP.

Symfony can be used to develop all kind of websites, from your personal blog to high traffic ones like Dailymotion or Yahoo! Answers.

Requirements

Symfony2 is only supported on PHP 5.3.2 and up.

Installation

The best way to install Symfony2 is to download the Symfony Standard Edition available at http://symfony.com/download.

Documentation

The "Quick Tour" tutorial gives you a first feeling of the framework. If, like us, you think that Symfony2 can help speed up your development and take the quality of your work to the next level, read the official Symfony2 documentation.

Contributing

Symfony2 is an open source, community-driven project. If you'd like to contribute, please read the Contributing Code part of the documentation. If you're submitting a pull request, please follow the guidelines in the Submitting a Patch section.