Commit Graph

2564 Commits

Author SHA1 Message Date
Fabien Potencier 2a08a67108 Merge branch '1.x'
* 1.x:
  fixed CS
  bumped version to 1.18.3-DEV
  prepared the 1.18.2 release

Conflicts:
	CHANGELOG
	ext/twig/php_twig.h
	lib/Twig/Environment.php
2015-06-24 18:24:55 +02:00
Fabien Potencier 12bf70d9ad fixed CS 2015-06-24 18:24:09 +02:00
Fabien Potencier e22fb8728b bumped version to 1.18.3-DEV 2015-06-07 01:35:59 +02:00
Fabien Potencier e8e6575abf prepared the 1.18.2 release v1.18.2 2015-06-07 01:31:24 +02:00
Fabien Potencier fe67c5ba3a Merge branch '1.x'
* 1.x:
  updated CHANGELOG
  reverted unexpected change
  fixed previous merge
  Organize and show value types
  Added label for "Whitespace Control" section
  Added note about case sensitivity of logic operators
  Fixed CS
  Fixed error guessing for nested templates
  Travis no longer supports hhvm-nightly
  fixed CS
  Added an example for "and" on if statment
  Updated exception messages for null vars in Twig_Template::getAttribute().
  Use stubs for profiles. Fixes #1660

Conflicts:
	doc/api.rst
2015-06-07 01:29:09 +02:00
Fabien Potencier 3e3aa8e26d updated CHANGELOG 2015-06-07 01:28:33 +02:00
Fabien Potencier b560a2c14f reverted unexpected change 2015-06-07 01:26:25 +02:00
Fabien Potencier d0b71307d6 fixed previous merge 2015-06-07 01:22:13 +02:00
Fabien Potencier 47f06e8237 minor #1624 Organize and show value types (kevinsimper)
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
2015-06-07 01:19:31 +02:00
Kevin Simper 0a46d06069 Organize and show value types 2015-06-07 01:19:31 +02:00
Fabien Potencier 69984ee652 minor #1664 Use mocks for profiles. Fixes #1660 (matthieuauger)
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
2015-06-07 00:23:40 +02:00
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 56e515b64e Merge branch '1.x'
* 1.x:
  Fix two failed unit tests on Windows:
  updated CHANGELOG
  Reduce the name of the cache directories to 1 character
  clean ups
  bumped version to 1.18.2-DEV
  prepared the 1.18.1 release
  updated CHANGELOG
  Cleanup API - make the compiler happy
  Fixed memory leaks
  tweaked docs about the C extension
  removed an obsolete recipe

Conflicts:
	CHANGELOG
	doc/api.rst
	doc/recipes.rst
	ext/twig/php_twig.h
	lib/Twig/Environment.php
	lib/Twig/NodeTraverser.php
	lib/Twig/Template.php
2015-05-16 16:12:48 +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 e8ab066fc7 minor #1687 Update empty.rst (violuke)
This PR was merged into the 2.0-dev branch.

Discussion
----------

Update empty.rst

Correcting English.

Commits
-------

d2d7ec8 Update empty.rst
2015-05-16 16:06:18 +02:00
violuke d2d7ec817b Update empty.rst
Correcting English.
2015-05-11 10:01:11 +01: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
Matthieu Auger f6bce94d52 Use stubs for profiles. Fixes #1660 2015-03-30 20:17:39 +02: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 34e943ae7c minor #1656 [2.0] remove dead code (SpacePossum)
This PR was merged into the 2.0-dev branch.

Discussion
----------

[2.0] remove dead code

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

Remove some unused code

Commits
-------

5928331 remove dead code
2015-03-17 07:32:29 +01:00
Fabien Potencier 29c87f6609 bug #1655 [2.0] unclosed "verbatim" block should be litteraly written (ninsuo)
This PR was merged into the 2.0-dev branch.

Discussion
----------

[2.0] unclosed "verbatim" block should be litteraly written

Fixes #1654
cc @SpacePossum

Commits
-------

4ea4749 [2.0] unclosed "verbatim" block should be litteraly written
2015-03-17 07:31:26 +01:00
Possum 5928331477 remove dead code 2015-03-16 23:14:58 +01:00
Alain Tiemblo 4ea47499ed [2.0] unclosed "verbatim" block should be litteraly written
Fixes #1654
cc @SpacePossum
2015-03-16 22:54:30 +01:00
Fabien Potencier 204f253173 feature #1567 Let's talk about Twig 2.0 (fabpot, Tobion)
This PR was merged into the 1.18-dev branch.

Discussion
----------

Let's talk about Twig 2.0

No big changes, just the removal of deprecated features and things already documented in the docs.

see #1525 for some discussions.

Commits
-------

72cc7d8 removed obsolete docs
a1d5374 removed obsolete raw tag
c15b426 removed deprecated Twig_Loader_String class
42bd35e updated CHANGELOG
886b863 removed the Autoloader as Composer provide one
73311f1 simplified code with finally
6d50f98 replaced array() by [] in *generated* PHP code
5388a13 removed usage of call_user_func when possible
a9fa64e replaced some functions by anonymous ones
6c3febc removed pre-1.8 autoescape tag syntax, removed true as a valid autoescape strategy
706d659 drop support for PHP 5.3 and 5.4
176f60d removed obsolete Twig_Simple* classes
df3d533 removed obsolete interfaces
f0a81e0 dropped support for PHP 5.2
bb30b98 udpated the docs for 2.0
9aae0a3 removed deprecated Node::toXml() method
dc04436 removed deprecated tests
2def83d added missing deprecation notices
558ca46 remove string casts from loader which was done for template reference objects, but this type of parameter is not contracted by the LoaderInterface
5eff1b1 remove unneeded string cast
6cbbe7c fixed a unit test as Twig_ExistsLoaderInterface has been merged into Twig_LoaderInterface
cd72eb7 simplified code
4be32fb simplified code
84ed354 simplified code
0b0385f removed the ability to register a global variable after the runtime or the extensions have been initialized
79f52aa improved the performance of the filesystem loader
d821ec2 removed deprecated Twig_Environment::removeExtension()
2d659ed removed deprecated token parser broker
13f8ed7 updated CHANGELOG
fbecccd emptied deprecated interfaces
80395d1 removed deprecated Twig_Test_* classes
d2c864d removed deprecated Twig_Function_* classes
4aef0c2 removed deprecated Twig_Filter_* classes
f9195a2 bumped version to 2.0.0-DEV
2015-03-06 10:14:09 +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 72cc7d8081 removed obsolete docs 2015-03-02 18:32:57 +01:00
Fabien Potencier cb732490a3 removed an obsolete recipe 2015-03-02 18:29:18 +01:00