Commit Graph

2510 Commits

Author SHA1 Message Date
Fabien Potencier dfddd2e0ef bug #1701 Fixed error guessing for nested templates (hason)
This PR was merged into the 1.x branch.

Discussion
----------

Fixed error guessing for nested templates

Commits
-------

00fe940 Fixed CS
dd1b101 Fixed error guessing for nested templates
2015-06-02 16:50:15 +02:00
Fabien Potencier c4bc409088 minor #1700 Travis no longer supports hhvm-nightly (hason)
This PR was merged into the 1.x branch.

Discussion
----------

Travis no longer supports hhvm-nightly

See travis-ci/travis-ci#3788

Commits
-------

329d67c Travis no longer supports hhvm-nightly
2015-06-02 16:48:47 +02:00
Fabien Potencier 5f201abce5 minor #1703 Added note about case sensitivity of logic operators (biozshock)
This PR was merged into the 1.x branch.

Discussion
----------

Added note about case sensitivity of logic operators

Commits
-------

29986a9 Added note about case sensitivity of logic operators
2015-06-02 16:47:56 +02:00
Ulf df9da8e858 Added label for "Whitespace Control" section 2015-06-02 16:46:05 +02:00
Artem Lopata 29986a9c4c Added note about case sensitivity of logic operators 2015-06-02 15:11:17 +03:00
Martin Hasoň 00fe940ebf Fixed CS 2015-06-02 11:21:27 +02:00
Martin Hasoň dd1b1016a7 Fixed error guessing for nested templates 2015-06-02 11:19:07 +02:00
Martin Hasoň 329d67c4bb Travis no longer supports hhvm-nightly 2015-06-02 10:05:33 +02:00
Fabien Potencier d63ac2088e minor #1667 [1.x] Updated exception messages for null vars (phansys)
This PR was merged into the 1.x branch.

Discussion
----------

[1.x] Updated exception messages for null vars

Updated exception messages for null vars in ```Twig_Template::getAttribute()```.

Example:
**Before:**
```
Impossible to invoke a method ("myMethod") on a NULL variable ("") in My:template.html.twig at line 1
```

**After:**
```
Impossible to invoke a method ("myMethod") on a null variable in My:template.html.twig at line 1
```

Commits
-------

ddf011d Updated exception messages for null vars in Twig_Template::getAttribute().
2015-05-16 16:17:41 +02:00
Fabien Potencier c55e60394c fixed CS 2015-05-16 16:14:08 +02:00
Fabien Potencier 5b43c44cae minor #1669 Added an example for "and" on if statment (InFog)
This PR was submitted for the master branch but it was merged into the 1.x branch instead (closes #1669).

Discussion
----------

Added an example for "and" on if statment

Commits
-------

2698a42 Added an example for "and" on if statment
2015-05-16 16:13:37 +02:00
Evaldo Junior 2698a42284 Added an example for "and" on if statment 2015-05-16 16:13:37 +02:00
Fabien Potencier ca76ad98b9 minor #1678 PHP docs and unused code clean ups (SpacePossum)
This PR was merged into the 1.x branch.

Discussion
----------

PHP docs and unused code clean ups

Commits
-------

2030482 clean ups
2015-05-16 16:09:19 +02:00
Fabien Potencier 206d547920 minor #1686 Fix two failed unit tests on Windows: (johnnytemp)
This PR was merged into the 1.x branch.

Discussion
----------

Fix two failed unit tests on Windows:

1. fopen() cannot handle directory, replaced by opendir() for getting a testing resource. (also double check a resource is opened)
2. comparing paths by assertEquals() which has mixed '\' and '/' on Windows.

Commits
-------

9d7163e Fix two failed unit tests on Windows:
2015-05-07 17:16:34 +02:00
Johnny 9d7163e47d Fix two failed unit tests on Windows:
1. fopen() cannot handle directory, replaced by opendir() for getting a testing resource. (also double check a resource is opened)
2. comparing paths by assertEquals() which has mixed '\' and '/' on Windows.
2015-05-07 13:01:06 +08:00
Fabien Potencier f012ea296a updated CHANGELOG 2015-04-29 15:28:48 +02:00
Fabien Potencier 763f42e259 minor #1684 Reduce the name of the cache directories to 1 character (Nicofuma)
This PR was merged into the 1.x branch.

Discussion
----------

Reduce the name of the cache directories to 1 character

Currently Twig spread the cached template over a directory tree and it's a good practice because it makes the filesystem happier (some filesystems limit the number of file per directory and some filesystems do not index the content of the directories => to access a file in a directory you may have to go through all the files in the directory to find it).

But this technique as also a few drawbacks because it will consume more inodes and in PHP because of the realpath cache which could be saturated by the path of too many directories.

`----`

The current implementation use 2 levels of directory with a 2 chars name, which end-up to `36^4 == 1,679,616` combinations and when you have a lot of templates it can be a real issue.

Per example, with 8,000 templates you will have:
- 8,000 different keys because `8,000 <<< 1,679,616` (a key is the combination of the two directories name, so 4 characters)
- 1,296 directories directly under `twig/`
- **1 file** per directory
- a total of `8,000 + 8,000 + 1,296 =` **17,296 keys** in the realpath cache.

My proposal with this PR is to reduce the name of the directories to only one character which for 8,000 templates end up to:
- 1,296 different keys (a key is the combination of the two directories name, so 2 characters)
- 36 directories directly under `twig/`
- ~**8 files** per directory
- a total of `8,000 + 1,296 + 36 =` **9,332 keys** in the realpath cache.

Note: If you don't have a lot of templates (> 1,000) it will not change anything for you.

Commits
-------

2972309 Reduce the name of the cache directories to 1 character
2015-04-29 15:27:01 +02:00
Tristan Darricau 29723092b8 Reduce the name of the cache directories to 1 character 2015-04-28 19:47:53 +02:00
Possum 2030482e4d clean ups 2015-04-24 17:14:22 +02:00
Fabien Potencier 7d5fe0fbd4 bumped version to 1.18.2-DEV 2015-04-19 10:35:47 +02:00
Fabien Potencier 9f70492f44 prepared the 1.18.1 release v1.18.1 2015-04-19 10:30:27 +02:00
Javier Spagnoletti ddf011d360 Updated exception messages for null vars in Twig_Template::getAttribute(). 2015-04-02 16:25:27 -03:00
Fabien Potencier 67920147a8 updated CHANGELOG 2015-03-26 13:33:23 +01:00
Fabien Potencier 8ce76eda73 bug #1662 Fix leaks (jpauli)
This PR was merged into the 1.x branch.

Discussion
----------

Fix leaks

Commits
-------

c41d305 Cleanup API - make the compiler happy
8bb7cbb Fixed memory leaks
2015-03-26 13:32:49 +01:00
Julien Pauli c41d305251 Cleanup API - make the compiler happy 2015-03-26 12:44:45 +01:00
Julien Pauli 8bb7cbbd9d Fixed memory leaks 2015-03-26 12:44:37 +01:00
Fabien Potencier 7ee4aec238 tweaked docs about the C extension 2015-03-17 18:21:28 +01:00
Fabien Potencier eecf85e903 minor #1642 removed an obsolete recipe (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

removed an obsolete recipe

Commits
-------

cb73249 removed an obsolete recipe
2015-03-06 08:12:47 +01:00
Fabien Potencier cb732490a3 removed an obsolete recipe 2015-03-02 18:29:18 +01:00
Fabien Potencier 11f9ebe8b6 feature #1641 deprecated the String loader (fabpot)
This PR was merged into the 1.18-dev branch.

Discussion
----------

deprecated the String loader

Even if the String loader should never be used, people keep trying to use it. It's too confusing to keep and we don't really need it in tests. So, I propose to deprecate it in 1.x and remove it in 2.x

Commits
-------

3779435 deprecated the String loader
2015-03-02 17:39:24 +01:00
Fabien Potencier 3779435d62 deprecated the String loader 2015-03-02 15:45:22 +01:00
Fabien Potencier 19f8d073aa minor #1638 added PHP 7 nightly to the test matrix and HHVM nightly (fabpot)
This PR was merged into the 1.18-dev branch.

Discussion
----------

added PHP 7 nightly to the test matrix and HHVM nightly

Commits
-------

a1295e9 added PHP 7 nightly to the test matrix and HHVM nightly
2015-02-27 17:10:10 +01:00
Fabien Potencier 7e8a54a700 minor #1601 reduced the number of times error information has to be guessed (fabpot)
This PR was merged into the 1.18-dev branch.

Discussion
----------

reduced the number of times error information has to be guessed

Commits
-------

651613c reduced the number of times error information should be guessed
2015-02-27 17:09:18 +01:00
Fabien Potencier a1295e936f added PHP 7 nightly to the test matrix and HHVM nightly 2015-02-27 16:47:28 +01:00
Fabien Potencier 651613c32c reduced the number of times error information should be guessed 2015-02-27 16:01:28 +01:00
Fabien Potencier 5e7bb28517 updated CHANGELOG 2015-02-27 15:27:47 +01:00
Fabien Potencier 3309c3c246 bug #1637 Updates slice so that it still accepts a SimpleXMLElement (bob-p)
This PR was merged into the 1.18-dev branch.

Discussion
----------

Updates slice so that it still accepts a SimpleXMLElement

Since #1503 you cannot pass a SimpleXMLElement to slice as you get:

   Catchable fatal error: Argument 1 passed to LimitIterator::__construct() must implement interface Iterator, instance of SimpleXMLElement given

As SimpleXMLElement implements Traversable but not Iterator

This checks that $item is an instance of Iterator before passing to LimitIterator

Commits
-------

aea075b Updates slice so that it still accepts a SimpleXMLElement
2015-02-27 15:25:52 +01:00
Thomas Pomfret aea075b3a8 Updates slice so that it still accepts a SimpleXMLElement 2015-02-26 15:25:06 -05:00
Fabien Potencier fb8b04ef15 minor #1617 Fix time sensitive profiler test (ready) (SpacePossum)
This PR was squashed before being merged into the 1.18-dev branch (closes #1617).

Discussion
----------

Fix time sensitive profiler test (ready)

The profiler tests fail some times because of the performance of the machine these are run on.
These changes should provide stability.

Commits
-------

a80cb35 Fix time sensitive profiler test (ready)
2015-02-16 11:15:51 +01:00
Possum a80cb35e51 Fix time sensitive profiler test (ready) 2015-02-16 11:15:49 +01:00
Fabien Potencier fd6f28be48 fixed filesystem loader when trying to load a non-file 2015-02-16 11:14:36 +01:00
Fabien Potencier 8e32c5068d minor #1622 [#1621] Failing tests for Filesystem loader (scaytrase)
This PR was squashed before being merged into the 1.18-dev branch (closes #1622).

Discussion
----------

[#1621] Failing tests for Filesystem loader

See #1621

Commits
-------

f7a49f2 [#1621] Failing tests for Filesystem loader
2015-02-16 11:10:38 +01:00
Pavel Batanov f7a49f2687 [#1621] Failing tests for Filesystem loader 2015-02-16 11:10:29 +01:00
Fabien Potencier 74a8bddec4 fixed typo 2015-01-30 12:04:23 +01:00
Fabien Potencier dc15ea0917 simplified code 2015-01-30 12:01:23 +01:00
Fabien Potencier 5a5a640cbc minor #1609 get PHP version info once on construction (SpacePossum)
This PR was squashed before being merged into the 1.18-dev branch (closes #1609).

Discussion
----------

get PHP version info once on construction

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes

Hi,
I was profiling a project and noticed that `phpversion` was called 5000 times by Twig.
This patch reduces the amount of calls without breaking anything (I hope ;)  )

![twig_phpversion](https://cloud.githubusercontent.com/assets/10462973/5921451/53d3e66c-a644-11e4-94aa-a3daf762e34d.png)

Commits
-------

24ff698 get PHP version info once on construction
2015-01-29 10:43:27 +01:00
Possum 24ff698dc5 get PHP version info once on construction 2015-01-29 10:43:24 +01:00
Fabien Potencier 1e46631409 bug #1616 fixed named args for static methods (kriswallsmith)
This PR was merged into the 1.18-dev branch.

Discussion
----------

fixed named args for static methods

This fixes an obscure reflection error that gets thrown if a functioned backed by a static method is called with named arguments.

Commits
-------

7868fe8 fixed named args for static methods
2015-01-29 08:19:54 +01:00
Kris Wallsmith 7868fe838e fixed named args for static methods 2015-01-29 16:46:20 +13:00
Fabien Potencier 6b434f4521 bumped version to 1.18.1-DEV 2015-01-25 18:35:14 +01:00