This PR was merged into the 1.x branch.
Discussion
----------
Added support for unconsumed macro arguments
Fixes#1159 and supplements #1699
Commits
-------
7f00cb9 Added support for unconsumed macro arguments
This PR was submitted for the master branch but it was merged into the 1.x branch instead (closes#1666).
Discussion
----------
add ignore_missing agrument to source function
This basically works the same way as `ignore_missing` on the `include` function/tag.
Commits
-------
afa9358 add ignore_missing agrument to source function
This PR was merged into the 1.x branch.
Discussion
----------
fixed sandbox disabling when using the include function
closes#1668
Commits
-------
af72894 fixed sandbox disabling when using the include function
This PR was submitted for the master branch but it was merged into the 1.x branch instead (closes#1720).
Discussion
----------
Example about how to rename several blocks
It was unclear to me how to rename more than 1 imported block. I had to look into the source code to find that, so I add it to the documentation.
Commits
-------
8af1355 Example about how to rename several blocks
This PR was merged into the 1.x branch.
Discussion
----------
fix batch filter with zero items
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
also added a test for preserving keys behavior
Commits
-------
8d6be28 fix batch filter with zero items
This PR was merged into the 1.x branch.
Discussion
----------
Fix PHP_FE_END value
See explanation on rev c41d305
Commits
-------
a1eee07 Fix PHP_FE_END value
This PR was submitted for the master branch but it was merged into the 1.x branch instead (closes#1624).
Discussion
----------
Organize and show value types
I was a little confused about how `auto_reload` and what kind of types you had to provide. Hope this helps to clarify that for others.
Should it also say something about how `cache: true` and `auto_reload: true` works together, as that is a question i have myself :)
Commits
-------
0a46d06 Organize and show value types
This PR was merged into the 1.x branch.
Discussion
----------
Use mocks for profiles. Fixes#1660
| Q | A
| ------------- | ---
| Bug fix? | yes #1660
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
This PR aims to change the getProfile() method to returns mocks.
This fixes#1660
BTW Is there a specific reason why there are no mocks for the tests in the project ?
Commits
-------
f6bce94 Use stubs for profiles. Fixes#1660
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
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
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
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().
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
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:
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.
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