Justin Hileman
01d413de0d
Merge branch 'hotfix/2.2.0' into dev
...
Conflicts:
src/Mustache/Compiler.php
src/Mustache/Engine.php
2013-03-25 09:12:36 -07:00
Justin Hileman
934a5495bb
Bump Genghis version.
2013-03-25 09:02:46 -07:00
Justin Hileman
c160134b6d
Add a 'strict_callables' option to Mustache_Engine
...
Prevents treating array('ClassName', 'methodName') or array($instance, 'methodName') as section or interpolation callables. This helps protect against arbitrary code evaluation when user input is passed directly into the template.
This setting is recommended for PHP 5.3+, and all PHP 5.2 projects not using section or interpolation lambdas.
The default value is false to preserve backwards compatibility.
See #138
2013-03-23 10:54:13 -07:00
Justin Hileman
7fb7758178
Include header in generated bootstrap files.
2013-03-12 16:40:36 -07:00
Justin Hileman
32a397f93d
Remove unused submodule.
2013-03-12 16:20:02 -07:00
Justin Hileman
ca44ef68f8
Move loader cascading into the loadPartial method.
...
This means the `partialsLoader` property is never set to the default loader, fixing things like `setPartials`, but template loading cascades as per the spec.
Add test coverage for partial cascading.
2013-03-12 16:03:58 -07:00
Justin Hileman
72007e65b4
Simplify setPartials nested ifs.
2013-03-12 15:29:18 -07:00
Matt DeClaire
32b747be5c
fix test: a partialLoader should match the loader when neither are specified
2013-03-12 15:19:12 -07:00
Matt DeClaire
5a3802e2a6
fix for when loader is not defined
2013-03-12 15:14:07 -07:00
Matt DeClaire
62435a5705
lazily default partialsLoader to loader
...
Conflicts:
src/Mustache/Engine.php
2013-03-12 15:14:04 -07:00
Matt DeClaire
8053ce7093
implement default behavior for the partials_loader
2013-03-12 15:06:47 -07:00
Justin Hileman
12d6884b4b
Improve test coverage for custom escapers and charsets.
2013-01-26 16:48:35 -08:00
Justin Hileman
c75b4c2e0b
Fix compiled templates' PSR-2 compliance.
2013-01-26 16:34:16 -08:00
Justin Hileman
d5e199b3b9
Update build_bootstrap with all the new classes!
2013-01-26 16:25:57 -08:00
Justin Hileman
a777c587f2
Add resolveValue method to base Template.
...
DRYs up compiled class output a bit and makes things FASTER!
Speeds up value resolution by 33% for primitives, 25% for methods and properties, and 10% for lambdas.
2013-01-26 16:19:06 -08:00
Justin Hileman
cf76a4b8f9
Remove unused escape param from renderInternal
2013-01-26 14:49:14 -08:00
Justin Hileman
05e527fe21
Don't instantiate a LambdaHelper for classes with no Lambdas :)
2013-01-26 14:36:24 -08:00
Justin Hileman
38453d0eac
Merge remote-tracking branch 'rothshahar/patch-1' into dev
2013-01-24 16:45:04 -08:00
Shahar Roth
2c29f7e2b6
Update src/Mustache/Engine.php
2013-01-24 15:09:36 -08:00
Justin Hileman
b1ca6f3cae
Update Lambda Helper docblock. It was a lie.
2013-01-23 06:24:15 -08:00
Justin Hileman
e5bc8d5edf
Add a CascadingLoader implementation.
2013-01-21 10:26:12 -08:00
Justin Hileman
b22d15a759
Add an inline template loader.
...
This loader is awesome for micro-frameworks such as Silex :)
2013-01-21 10:03:57 -08:00
Justin Hileman
59020c2e4f
Remove unnecessary @implements annotations.
2013-01-21 10:02:58 -08:00
Justin Hileman
5fcd9f6d25
mention UnknownTemplateException in loader interface
2013-01-20 15:52:21 -08:00
Justin Hileman
a20068657e
Link to main docs more prominently
2013-01-20 11:24:59 -08:00
Justin Hileman
1f07edd1ad
Bail early on log formatting if message has no placeholders.
2013-01-20 10:59:36 -08:00
Justin Hileman
d0023b5baa
Merge branch 'feature/catchable-exceptions' into dev
2013-01-20 10:51:06 -08:00
Justin Hileman
8b02366a3f
Add test coverage for new exception types.
2013-01-20 10:50:00 -08:00
Justin Hileman
0436c59477
Improve Mustache exception types, catchability.
...
* Subclass common exception types (runtime, logic, invalid argument).
* Add new "unknown x" exceptions for filters, helpers and templates.
* Make all Mustache exceptions implement Mustache_Exception interface… Gotta catch 'em all!
2013-01-20 10:35:55 -08:00
Justin Hileman
5e69e63ffb
Merge branch 'feature/bootstrap' into dev
2013-01-12 09:22:59 -08:00
Justin Hileman
d766076b5a
Add LambdaHelper and Logger to build_bootstrap.
2013-01-12 09:17:33 -08:00
Justin Hileman
01bcf6a51a
Add a build_bootstrap script.
...
Generates `mustache.php`, a single-file bootstrap library which is a lot easier to include in your project.
2013-01-12 09:10:33 -08:00
Justin Hileman
ff66639719
Add Symfony ClassLoader (needed for bootstrap)
2013-01-12 09:10:10 -08:00
Justin Hileman
64dbf3fcb0
Merge branch 'release/2.1.0' into dev
2013-01-11 23:22:53 -08:00
Justin Hileman
6ac9cf03e4
Merge branch 'release/2.1.0'
2013-01-11 23:18:03 -08:00
Justin Hileman
638ed9abc1
Bump version to 2.1.0
2013-01-11 23:17:53 -08:00
Justin Hileman
21c2728fef
Merge pull request #116 from bobthecow/feature/logging
...
Add logging
2013-01-11 23:01:58 -08:00
Justin Hileman
d252fddf4a
Add plug for PSR-3
2013-01-11 22:53:27 -08:00
Justin Hileman
1515f5126b
Update logger to implement accepted PSR log spec
...
Add tests!
2013-01-11 22:48:43 -08:00
Justin Hileman
7522e2206d
Update loging to match (proposed) logging PSR.
2012-11-30 19:01:47 -08:00
Justin Hileman
d1fb1d86c5
Handle prematurely closed streams in StreamLogger.
2012-11-28 22:45:15 -08:00
Justin Hileman
8c059f566b
MonologLogger should not extend AbstractLogger.
2012-11-28 22:45:15 -08:00
Justin Hileman
782017e461
Add get/setLevel to AbstractLogger.
2012-11-28 22:45:15 -08:00
Justin Hileman
cd4e6b3b26
Initial logging proposal.
...
C.f. #112
Add logging to the Mustache Engine.
* Add a Logger interface.
* If a Logger instance is passed to the Engine constructor
(or added later via setLogger) template compiling,
caching, errors and missing partials will be logged.
* Add a Stream Logger and Monolog Logger implementation. You
should use the Monolog Logger.
2012-11-28 22:45:15 -08:00
Justin Hileman
2e97db3fc0
Clean up options documentation, order.
2012-11-28 20:28:03 -08:00
Justin Hileman
1792140afa
Default cache permissions to the current umask.
...
Use system-defined umask by default, and strongly recommend going that route, but allow overrides.
2012-11-28 20:24:14 -08:00
jandreasn
197a2b6807
Added option to set cache file permissions.
2012-11-28 20:02:01 -08:00
Justin Hileman
042d537992
Allow "empty" filesystem loader extension.
...
Fixes #123
2012-11-28 12:59:06 -08:00
Justin Hileman
1560863c49
Failing test for empty-string filesystem loader extension.
...
See #123
2012-11-28 12:58:20 -08:00
Rolando Henry
4da2fe4331
changed submodule url to bypass proxy problem
2012-10-29 13:38:01 -07:00