Commit Graph

696 Commits

Author SHA1 Message Date
Fabien Potencier b1b4e59f5b fixed CS 2015-07-28 16:12:16 +02:00
Nikola Svitlica a.k.a. TheCelavi ac2295c589 Bugfix/constructor should not have optional loader 2015-07-28 16:11:37 +02:00
Fabien Potencier ab88c38a27 removed some test hacks 2015-07-05 08:45:44 +02:00
Fabien Potencier a0261e7040 removed code that people want to overide over and over again 2015-07-03 12:04:33 +02:00
Fabien Potencier 4756b19b98 Merge branch '1.x'
* 1.x:
  fixed edge case where tests would fail because of a cache issue
  tweaked docs to avoid using an internal method in an example
  deprecated Twig_Environment::clearTemplateCache()
  fixed sandbox disabling when using the include function
  Example about how to rename several blocks
  fixed docs
  Update batch filter docs with arguments
2015-07-03 11:33:29 +02:00
Fabien Potencier af728947d6 fixed sandbox disabling when using the include function 2015-07-03 09:28:58 +02:00
Fabien Potencier 881a7b67bc Merge branch '1.x'
* 1.x:
  fixed CS
  fix batch filter with zero items
  Fix PHP_FE_END value
2015-07-03 08:49:50 +02:00
Fabien Potencier b0c41d42c4 fixed CS 2015-07-03 08:47:09 +02:00
Tobias Schultze 8d6be28430 fix batch filter with zero items
also added a test for preserving keys behavior
2015-07-02 23:47:18 +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 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
Martin Hasoň dd1b1016a7 Fixed error guessing for nested templates 2015-06-02 11:19:07 +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 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
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
Possum 2030482e4d clean ups 2015-04-24 17:14:22 +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 a1d5374faf removed obsolete raw tag 2015-03-02 17:53:47 +01:00
Fabien Potencier 886b863dcb removed the Autoloader as Composer provide one 2015-03-02 17:40:39 +01:00
Fabien Potencier 6d50f987fb replaced array() by [] in *generated* PHP code 2015-03-02 17:40:38 +01:00
Fabien Potencier 5388a13641 removed usage of call_user_func when possible 2015-03-02 17:40:38 +01:00
Fabien Potencier 6c3febca9e removed pre-1.8 autoescape tag syntax, removed true as a valid autoescape strategy 2015-03-02 17:40:38 +01:00
Fabien Potencier 706d659deb drop support for PHP 5.3 and 5.4 2015-03-02 17:40:38 +01:00
Fabien Potencier 176f60d79d removed obsolete Twig_Simple* classes 2015-03-02 17:40:21 +01:00
Fabien Potencier df3d5335fa removed obsolete interfaces 2015-03-02 17:40:20 +01:00
Fabien Potencier f0a81e0e83 dropped support for PHP 5.2 2015-03-02 17:40:20 +01:00
Tobias Schultze 558ca46b5e remove string casts from loader which was done for template reference objects, but this type of parameter is not contracted by the LoaderInterface 2015-03-02 17:40:20 +01:00
Fabien Potencier 6cbbe7cc4a fixed a unit test as Twig_ExistsLoaderInterface has been merged into Twig_LoaderInterface 2015-03-02 17:40:19 +01:00
Fabien Potencier 0b0385f32f removed the ability to register a global variable after the runtime or the extensions have been initialized 2015-03-02 17:40:19 +01:00
Fabien Potencier d821ec2e90 removed deprecated Twig_Environment::removeExtension() 2015-03-02 17:40:18 +01:00
Fabien Potencier 3779435d62 deprecated the String loader 2015-03-02 15:45:22 +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 651613c32c reduced the number of times error information should be guessed 2015-02-27 16:01:28 +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
Pavel Batanov f7a49f2687 [#1621] Failing tests for Filesystem loader 2015-02-16 11:10:29 +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
Kris Wallsmith 7868fe838e fixed named args for static methods 2015-01-29 16:46:20 +13:00
Fabien Potencier e7c5bde274 added some more unit tests 2015-01-25 17:01:33 +01:00
Fabien Potencier d34628dd36 bug #1585 Fixed wrong line numbers in error messages for multi-line statements (hason)
This PR was merged into the 1.18-dev branch.

Discussion
----------

Fixed wrong line numbers in error messages for multi-line statements

Partially fixes #1351

Commits
-------

08c5196 Fixed wrong line numbers in error messages for multi-line statements
2015-01-25 16:37:05 +01:00
Martin Hasoň e9b8bccec3 Fixed determining the necessary arguments for callable functions 2015-01-22 14:23:03 +01:00
Martin Hasoň 5f4377b863 Improved an exception message for missing value of optional arguments 2015-01-22 14:22:52 +01:00
Martin Hasoň 08c51964e2 Fixed wrong line numbers in error messages for multi-line statements 2015-01-21 10:46:46 +01:00
Fabien Potencier 3b12d558bb removed the special Sandbox Module class 2015-01-20 19:30:00 +01:00
Fabien Potencier 89df3c20ef fixed CS 2015-01-20 14:45:25 +01:00
Fabien Potencier 4408caae0c added a profiler 2015-01-20 03:04:00 +01:00