Commit Graph

7732 Commits

Author SHA1 Message Date
Fabien Potencier 00f6949bd9 minor #1857 Remove deprecated return types from the PHPDocs. (SpacePossum)
This PR was merged into the 1.x branch.

Discussion
----------

Remove deprecated return types from the PHPDocs.

There are deprecation warnings added to the environment (for example https://github.com/twigphp/Twig/blob/1.x/lib/Twig/Environment.php#L1287).

This PR aims to remove the deprecated return types from the PHPDocs as well. It will be useful for developers, but for for IDE's/SCA as well.

Commits
-------

831fd60 Remove deprecated return types from the PHPDocs.
2015-09-30 08:17:44 +02:00
Possum 831fd601cd Remove deprecated return types from the PHPDocs. 2015-09-29 17:58:36 +02:00
Fabien Potencier de874a9dec minor #1849 use try-finally for macro compilation (Tobion)
This PR was merged into the 2.0-dev branch.

Discussion
----------

use try-finally for macro compilation

Commits
-------

53d01ff use try-finally for macro compilation
2015-09-24 16:40:33 +02:00
Fabien Potencier 604e94883b feature #1844 changed template cache names to take into account the Twig C extension (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

changed template cache names to take into account the Twig C extension

Commits
-------

76ecd43 changed template cache names to take into account the Twig C extension
2015-09-24 16:39:22 +02:00
Fabien Potencier 76ecd43338 changed template cache names to take into account the Twig C extension 2015-09-24 16:37:46 +02:00
Tobias Schultze 53d01ffed7 use try-finally for macro compilation 2015-09-24 16:26:19 +02:00
Fabien Potencier eea6849837 Merge branch '1.x'
* 1.x:
  bumped version to 1.22.3-DEV
  prepared the 1.22.2 release
  removed unrelevant CHANGELOG entry
2015-09-22 16:08:50 +02:00
Fabien Potencier f0b5b8ce8e bumped version to 1.22.3-DEV 2015-09-22 16:03:12 +02:00
Fabien Potencier 79249fc8c9 prepared the 1.22.2 release v1.22.2 2015-09-22 15:59:32 +02:00
Lorenz Schori 40555fc16e Add test coverage for Twig_Cache_Filesystem 2015-09-21 16:03:23 +02:00
Fabien Potencier 821464ad01 removed unrelevant CHANGELOG entry 2015-09-21 09:07:22 +02:00
Fabien Potencier 40730603f0 Merge branch '1.x'
* 1.x:
  simplified code
  updated CHANGELOG
  Non-existing files are not cached by statcache
  Fix race condition in `Environment::loadTemplate`
  Fix instance variable declaration in Filesystem cache
  added @internal when appropriate
  fixed implementation of Null cache
  bumped version to 1.22.2-DEV
  prepared the 1.22.1 release
  updated CHANGELOG
  String-case in template_from_string
  Prevent potential doc comments in escaped inlined source
  bumped version to 1.22.1-DEV
  prepared the 1.22.0 release
  updated CHANGELOG
  More flexible integration test
2015-09-21 09:04:37 +02:00
Fabien Potencier 86e0a92747 simplified code 2015-09-21 08:58:48 +02:00
Fabien Potencier 591a17fc39 updated CHANGELOG 2015-09-21 08:58:44 +02:00
Fabien Potencier 93914e5e75 bug #1840 Fix race condition in Environment::loadTemplate (1.x) (znerol)
This PR was merged into the 1.x branch.

Discussion
----------

Fix race condition in `Environment::loadTemplate` (1.x)

Fixes #1836 (1.x branch)

Commits
-------

1bb7000 Fix race condition in `Environment::loadTemplate`
2015-09-21 08:51:38 +02:00
Fabien Potencier 7ed34dae63 minor #1839 Fix instance variable declaration in Filesystem cache (znerol)
This PR was merged into the 1.x branch.

Discussion
----------

Fix instance variable declaration in Filesystem cache

Commits
-------

d88c8a9 Fix instance variable declaration in Filesystem cache
2015-09-21 08:08:41 +02:00
Fabien Potencier 2b6a9e023b minor #1843 Non-existing files are not cached by statcache (Tobion)
This PR was merged into the 1.x branch.

Discussion
----------

Non-existing files are not cached by statcache

Reverts #1583

Based on the docs this cannot happen because the stat cache is only active for existing files.

> You should also note that PHP doesn't cache information about non-existent files. So, if you call file_exists() on a file that doesn't exist, it will return FALSE until you create the file. If you create the file, it will return TRUE even if you then delete the file. However unlink() clears the cache automatically.

http://php.net/manual/en/function.clearstatcache.php

Also the arugments you pass to clearstatcache(false, $filename) make no sense according the documentation and are not effective.

> filename
Clear the realpath and the stat cache for a specific filename only; only used if clear_realpath_cache is TRUE.

Also doctrine cachee does't use this approach either: https://github.com/doctrine/cache/blob/master/lib/Doctrine/Common/Cache/FileCache.php#L185 And nobody reported problems with this as far as I can see.

Commits
-------

4edf3fd Non-existing files are not cached by statcache
2015-09-21 08:04:46 +02:00
Tobias Schultze 4edf3fd53d Non-existing files are not cached by statcache
Reverts #1583

Based on the docs this cannot happen because the stat cache is only active for existing files.

> You should also note that PHP doesn't cache information about non-existent files. So, if you call file_exists() on a file that doesn't exist, it will return FALSE until you create the file. If you create the file, it will return TRUE even if you then delete the file. However unlink() clears the cache automatically.

http://php.net/manual/en/function.clearstatcache.php

Also the arugments you pass to clearstatcache(false, $filename) make no sense according the documentation and are not effective.

> filename
Clear the realpath and the stat cache for a specific filename only; only used if clear_realpath_cache is TRUE.

Also doctrine cachee does't use this approach either: https://github.com/doctrine/cache/blob/master/lib/Doctrine/Common/Cache/FileCache.php#L185 And nobody reported problems with this as far as I can see.
2015-09-21 02:19:00 +02:00
Lorenz Schori 1bb7000a26 Fix race condition in Environment::loadTemplate 2015-09-20 18:08:49 +02:00
Lorenz Schori d88c8a9cc1 Fix instance variable declaration in Filesystem cache 2015-09-20 17:48:57 +02:00
Fabien Potencier fce1c80766 minor #1835 added @internal when appropriate (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

added @internal when appropriate

Commits
-------

2c0839c added @internal when appropriate
2015-09-20 15:34:30 +02:00
Fabien Potencier 2c0839cd10 added @internal when appropriate 2015-09-20 15:32:25 +02:00
Fabien Potencier 9fde02fe55 bug #1833 fixed implementation of Null cache (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

fixed implementation of Null cache

fixes #1832

Commits
-------

b43e298 fixed implementation of Null cache
2015-09-16 10:32:19 +02:00
Fabien Potencier b43e298ccf fixed implementation of Null cache 2015-09-16 08:24:50 +02:00
Fabien Potencier 7ffa3a2ae1 bumped version to 1.22.2-DEV 2015-09-15 08:52:30 +02:00
Fabien Potencier b7fc2469fa prepared the 1.22.1 release v1.22.1 2015-09-15 08:50:16 +02:00
Fabien Potencier 443d1dbd02 updated CHANGELOG 2015-09-15 08:49:31 +02:00
Fabien Potencier c7940f89d1 bug #1830 String-cast in template_from_string (Tobion)
This PR was merged into the 1.x branch.

Discussion
----------

String-cast in template_from_string

Fixes #1829 caused by https://github.com/twigphp/Twig/pull/1807/files#diff-5e190f538c5c328c7473a5cfd3b7cd95R578

As twig allows many types in twig templates, e.g. array or traversable, we can do the same for string.
But we only take this approach for twig exposed function/filters etc, i.e. template code, but not core code.

Commits
-------

e1e3655 String-case in template_from_string
2015-09-15 07:16:37 +02:00
Tobias Schultze e1e3655722 String-case in template_from_string
Fixes #1829 caused by https://github.com/twigphp/Twig/pull/1807/files#diff-5e190f538c5c328c7473a5cfd3b7cd95R578

As twig allows many types in twig templates, e.g. array or traversable, we can do the same for string.
But we only take this approach for twig exposed function/filters etc, i.e. template code, but not core code.
2015-09-15 00:59:52 +02:00
Fabien Potencier 1292dcc69a bug #1828 Prevent potential doc comments in escaped inlined source (nicolas-grekas)
This PR was merged into the 1.x branch.

Discussion
----------

Prevent potential doc comments in escaped inlined source

Hopefully the last patch of this multi-patches feature...

Commits
-------

f35a540 Prevent potential doc comments in escaped inlined source
2015-09-14 10:36:12 +02:00
Nicolas Grekas f35a540b1f Prevent potential doc comments in escaped inlined source 2015-09-14 10:00:28 +02:00
Fabien Potencier 7c8ddbddbc bumped version to 1.22.1-DEV 2015-09-13 19:17:07 +02:00
Fabien Potencier 204a6c9490 prepared the 1.22.0 release v1.22.0 2015-09-13 19:12:38 +02:00
Fabien Potencier f2c01786fa updated CHANGELOG 2015-09-13 19:00:01 +02:00
Fabien Potencier 0bb7184a17 feature #1806 More flexible integration test (SpacePossum)
This PR was squashed before being merged into the 1.x branch (closes #1806).

Discussion
----------

More flexible integration test

replaces https://github.com/twigphp/Twig/pull/1805 as a 1.x version

Commits
-------

3f779f6 More flexible integration test
2015-09-13 18:59:35 +02:00
Possum 3f779f6b3a More flexible integration test 2015-09-13 18:59:34 +02:00
Fabien Potencier 0c87b8b44c Merge branch '1.x'
* 1.x:
  fixed recipe
  No need to check modification time when opcache_invalidate
2015-09-13 18:56:45 +02:00
Fabien Potencier 2b6cfc01aa fixed recipe 2015-09-13 18:56:37 +02:00
Fabien Potencier 9df64cf582 minor #1827 No need to check modification time when opcache_invalidate (Tobion)
This PR was merged into the 1.x branch.

Discussion
----------

No need to check modification time when opcache_invalidate

- We know the file is new
- No need to check if opcache/apc is enabled as these methods will just return false in this case

Commits
-------

f63099e No need to check modification time when opcache_invalidate
2015-09-13 18:55:45 +02:00
Tobias Schultze f63099e00b No need to check modification time when opcache_invalidate
- We know the file is new
- No need to check if opcache/apc is enabled as these methods will just return false in this case
2015-09-13 18:50:03 +02:00
Fabien Potencier 8ae2062567 fixed bad merge 2015-09-13 13:26:49 +02:00
Fabien Potencier a3f273f1b9 Merge branch '1.x'
* 1.x:
  added a recipe about how to render a template stored as a string
  added an option to force PHP bytecode invalidation when writing a compiled template into the cache
  rewrote the recipes about APC and opcache to avoid deprecation notices
  added a note about Twig_Loader_String alternatives
2015-09-13 13:18:41 +02:00
Fabien Potencier b673f65d34 feature #1823 rewrote the recipes about APC and opcache to avoid deprecation notices (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

rewrote the recipes about APC and opcache to avoid deprecation notices

Commits
-------

96a54b3 added an option to force PHP bytecode invalidation when writing a compiled template into the cache
e9b0802 rewrote the recipes about APC and opcache to avoid deprecation notices
2015-09-13 13:17:46 +02:00
Fabien Potencier 257c354b97 minor #1826 added a recipe about how to render a template stored as a string (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

added a recipe about how to render a template stored as a string

Commits
-------

77fed4e added a recipe about how to render a template stored as a string
2015-09-13 13:17:13 +02:00
Fabien Potencier 77fed4e659 added a recipe about how to render a template stored as a string 2015-09-13 12:37:19 +02:00
Fabien Potencier 96a54b3f40 added an option to force PHP bytecode invalidation when writing a compiled template into the cache 2015-09-13 12:26:27 +02:00
Fabien Potencier e9b08026b3 rewrote the recipes about APC and opcache to avoid deprecation notices 2015-09-13 12:12:56 +02:00
Fabien Potencier b5c7f5cd5a added a note about Twig_Loader_String alternatives 2015-09-13 08:53:43 +02:00
Fabien Potencier cec0338c87 Merge branch '1.x'
* 1.x:
  changed the arguments of generateKey
  deprecated Twig_Environment::getTemplateClassPrefix
  removed empty () in an error message
  added enabled extension names in the generated template class names
  fixed the profiler duration for the root node
  no need to call setTimezone on a current date
  use str_replace instead of strtr to escape the source in the template
2015-09-12 19:46:28 +02:00
Fabien Potencier fc2dafc2de bug #1825 Profiler root duration fix (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

Profiler root duration fix

When using the Twig profiler, the root node is a bit special and the duration should really be the sum of the children duration. That should fix #1792

Commits
-------

f1e963c fixed the profiler duration for the root node
2015-09-12 19:43:05 +02:00