Permalink
Switch branches/tags
Commits on Nov 11, 2012
  1. prepared the 1.11.1 release

    fabpot committed Nov 11, 2012
Commits on Nov 8, 2012
  1. merged branch char101/fix-debug-lineno (PR #894)

    fabpot committed Nov 8, 2012
    This PR was squashed before being merged into the master branch (closes #894).
    
    Commits
    -------
    
    7c5854b Fix twig error lineno off by 2
    
    Discussion
    ----------
    
    Fix twig error lineno off by 2
    
    It seems to me that the lineno reported by Twig_Error is off by 2 from the real lineno in the generated PHP source
    
    For example:
    
    ```
    {% if true %}
    Yes
    {% endif %}
    ```
    
    ```php
    <?php
    
    /*  */
    class __TwigTemplate_d41d8cd98f00b204e9800998ecf8427e extends Twig_Template
    {
        public function __construct(Twig_Environment $env)
        {
            parent::__construct($env);
    
            $this->parent = false;
    
            $this->blocks = array(
            );
        }
    
        protected function doDisplay(array $context, array $blocks = array())
        {
            // line 1
            if (true) { // <- this is line 19
                // line 2
                echo "Yes // <- this is line 21
    ";
            }
        }
    
        public function getTemplateName()
        {
            return null;
        }
    
        public function isTraitable()
        {
            return false;
        }
    
        public function getDebugInfo()
        {
            return array (  19 => 2,  17 => 1,); // <- should be return array (  21 => 2,  19 => 1,);
        }
    }
    ```
    
    ---------------------------------------------------------------------------
    
    by char101 at 2012-11-08T08:23:57Z
    
    Since `$compiler->addDebugInfo()` is called first before writing the node content, usually the number of lines in the PHP code is less than 2 (1 for the // lineno comment, and 1 for the generated content) than the line where the node content is written.
  2. Fix twig error lineno off by 2

    char101 authored and fabpot committed Nov 8, 2012
  3. fixed typo

    fabpot committed Nov 8, 2012
  4. udpated CHANGELOG

    fabpot committed Nov 8, 2012
  5. merged branch char101/fix-ext-crash-on-undef-func-inside-macro (PR #892)

    fabpot committed Nov 8, 2012
    This PR was merged into the master branch.
    
    Commits
    -------
    
    55b76c1 Fix extension crash when calling unknown method inside a macro
    
    Discussion
    ----------
    
    Fix extension crash when calling unknown method inside a macro
    
     Issue #890
  6. fixed CS

    fabpot committed Nov 8, 2012
  7. merged branch char101/optimize-strict-vars-php54 (PR #893)

    fabpot committed Nov 8, 2012
    This PR was squashed before being merged into the master branch (closes #893).
    
    Commits
    -------
    
    f397a8f Use ternary operator with PHP 5.4 when strict_variables is true
    
    Discussion
    ----------
    
    Use ternary operator with PHP 5.4 when strict_variables is true
    
    When strict variables is true, and using PHP 5.4, we can still use the ternary operator to optimize performance.
Commits on Nov 7, 2012
  1. merged branch nomack84/fixed_typo (PR #891)

    fabpot committed Nov 7, 2012
    This PR was merged into the master branch.
    
    Commits
    -------
    
    cc65c88 [template_from_string]Fixed typo
    
    Discussion
    ----------
    
    [template_from_string]Fixed typo in docs
    
    Fix a typo in the template_from_string function docs
  2. bumped version to 1.11.0-DEV

    fabpot committed Nov 7, 2012
  3. prepared the 1.11.0 release

    fabpot committed Nov 7, 2012
  4. merged branch char101/fix-build-warning (PR #886)

    fabpot committed Nov 7, 2012
    This PR was merged into the master branch.
    
    Commits
    -------
    
    3164ee3 Fix build warning for const pointer
    
    Discussion
    ----------
    
    Fix build warning for const pointer
    
     Issue #883
Commits on Nov 6, 2012
  1. merged branch char101/nativeext-exception-info (PR #885)

    fabpot committed Nov 6, 2012
    This PR was merged into the master branch.
    
    Commits
    -------
    
    db13b66 Pass lineno and filename to Twig_Error constructor
    feee667 Merge branch 'nativeext-exception-info' of https://github.com/fabpot/Twig into nativeext-exception-info
    adb31d4 Call Twig_Error constructor
    d4a8c8b added tests for exceptions thrown in Twig_Template::getAttribute()
    1b82bf7 Add template filename for the rest of the exception
    5675140 Handle NULL filename
    71f64bc Add template name to error message
    
    Discussion
    ----------
    
    Add template name to error message
    
    Issue #884
    
    ---------------------------------------------------------------------------
    
    by fabpot at 2012-11-06T07:43:16Z
    
    For some unknown reasons, I don't see your branch when I try to submit a PR. Can you cherry-pick my unit tests from my `nativeext-exception-info` branch?
    
    ---------------------------------------------------------------------------
    
    by Tobion at 2012-11-06T08:29:19Z
    
    @char101 Maybe you could also integrate the fixes of #878?
    
    ---------------------------------------------------------------------------
    
    by fabpot at 2012-11-06T08:30:55Z
    
    @Tobion Let's do one thing at a time.
    
    ---------------------------------------------------------------------------
    
    by char101 at 2012-11-06T08:59:30Z
    
    @Tobion AFAIK, unlike the PHP implementation, the C implementation does not automatically convert array key type.
    
    ---------------------------------------------------------------------------
    
    by char101 at 2012-11-06T09:27:54Z
    
    @fabpot How about the lineno variable? Should I just set it to 0 or is there any function that can be called to obtain it?
    
    ```php
    if (-1 === $this->lineno || null === $this->filename) {
        $this->guessTemplateInfo();
    }
    ```
    
    ---------------------------------------------------------------------------
    
    by fabpot at 2012-11-06T09:32:09Z
    
    You need to keep `-1` for the line.
    
    ---------------------------------------------------------------------------
    
    by char101 at 2012-11-06T09:36:56Z
    
    If `$lineno` is `-1`, wouldn't `$this->guessTemplateInfo()` still be called?
    
    ---------------------------------------------------------------------------
    
    by fabpot at 2012-11-06T09:45:34Z
    
    Yes, but the template name will not be guessed. So, there is a performance overhead for the line guessing, but not for the template name guessing.
  2. Merge branch 'nativeext-exception-info' of https://github.com/fabpot/…

    char101 committed Nov 6, 2012
    …Twig into nativeext-exception-info
  3. Call Twig_Error constructor

    char101 committed Nov 6, 2012
  4. Handle NULL filename

    char101 committed Nov 6, 2012
Commits on Nov 5, 2012
Commits on Nov 3, 2012
  1. fixed CS

    fabpot committed Nov 3, 2012
  2. merged branch fabpot/timezones (PR #876)

    fabpot committed Nov 3, 2012
    This PR was merged into the master branch.
    
    Commits
    -------
    
    f99504a changed the date filter behavior to always apply the default timezone, except if false is passed as the timezone
    d3b0cbd merged branch jmikola/patch-1 (PR #845)
    a6a1ef0 Avoid setting timezones on DateIntervals
    
    Discussion
    ----------
    
    changed the date filter behavior to always apply the default timezone, except if false is passed as the timezone
    
    This PR is based on #845, and addresses issue #778.
    
    Right now, the timezone management when using the date filter is counter-intuitive. When you pass a DateTime object, the default timezone is not applied, but in all other cases, it is.
    
    This PR makes the behavior more consistent by always applying the default timezone (which is probably what users want most of the time), and this can be disabled by explicitly passing ``false`` as the timezone value.
    
    This is a BC break but I think that not many consciously rely on the current behavior.
    
    ---------------------------------------------------------------------------
    
    by fabpot at 2012-10-30T15:49:13Z
    
    @jmikola Can you have a look at this PR and tell me your opinion about this change?
    
    ---------------------------------------------------------------------------
    
    by jmikola at 2012-11-02T20:17:30Z
    
    @fabpot: Will take a look at this tonight. I missed the notifications as I was offline for a few days.
    
    ---------------------------------------------------------------------------
    
    by jmikola at 2012-11-03T04:09:54Z
    
    I read through all of the issues and PR's and this looks reasonable. Are we missing a test case for passing in a DateTime object with `false` for the timezone? I do see one example where we render the current date using the `'e'` format string and provide `false` for the timezone, but that's it.
    
    ---------------------------------------------------------------------------
    
    by fabpot at 2012-11-03T07:09:08Z
    
    ok, I've added an additional test just to be sure.
  3. changed the date filter behavior to always apply the default timezone…

    fabpot committed Oct 30, 2012
    …, except if false is passed as the timezone
Commits on Oct 30, 2012
  1. added a paragraph in the docs about how the Twig blocks work (based o…

    fabpot committed Oct 30, 2012
    …n an explanation from nikic, closes #704, refs #351)
  2. fixed a stupid test

    fabpot committed Oct 30, 2012
  3. fixed broken test

    fabpot committed Oct 30, 2012