Merge remote-tracking branch 'origin/master'

This commit is contained in:
bzick
2013-07-04 10:38:23 +04:00
5 changed files with 61 additions and 65 deletions

View File

@ -1,35 +1,34 @@
CHANGELOG CHANGELOG
========= =========
## 1.0.5 ## 1.0.5 (2013-07-04)
### Add `Fenom::AUTO_ESCAPE` support (feature #2) - Add `Fenom::AUTO_ESCAPE` support (feature #2)
### Update documentation - Update documentation
## 1.0.4 (2013-06-27) ## 1.0.4 (2013-06-27)
### Add nested level for {extends} and {use} - Add nested level for {extends} and {use}
### Small bug fix - Small bug fix
### Update documentation - Update documentation
## 1.0.3 (2013-06-20) ## 1.0.3 (2013-06-20)
### Allow any callable for modifier (instead string) - Allow any callable for modifier (instead string)
### Bug fix - Bug fix
### Update documentation - Update documentation
## 1.0.2 (2013-06-18) ## 1.0.2 (2013-06-18)
### Optimize extends - Optimize extends
### Bug fix - Bug fix
### Update documentation - Update documentation
## 1.0.1 (2013-05-30) ## 1.0.1 (2013-05-30)
### Bug fix - Bug fix
- comments don't work - comments don't work
## 1.0 (2013-05-30) ## 1.0 (2013-05-30)
- First release - First release

View File

@ -1,3 +1,3 @@
Project Founder and Developer: Project Founder and Developer:
- Ivan Shalganov <ivan.shalganov@gmail.com> - Ivan Shalganov <a.cobest@gmail.com>

View File

@ -5,49 +5,50 @@ To start benchmark run script `benchmark/run.php`.
### Smarty3 vs Twig vs Fenom ### Smarty3 vs Twig vs Fenom
PHP 5.4.11 Smarty3 vs Twig vs Fenom
Printing of varaibles Generate templates... Done
smarty3: !compiled and !loaded 8.7919 sec, 21.1 MiB Testing a lot output...
smarty3: compiled and !loaded 0.0341 sec, 16.4 MiB smarty3: !compiled and !loaded 3.9101 sec, 15.1 MiB
smarty3: compiled and loaded 0.0028 sec, 16.4 MiB smarty3: compiled and !loaded 0.0235 sec, 9.3 MiB
smarty3: compiled and loaded 0.0015 sec, 9.3 MiB
twig: !compiled and !loaded 3.9040 sec, 67.5 MiB
twig: compiled and !loaded 0.0337 sec, 16.1 MiB twig: !compiled and !loaded 1.8725 sec, 68.9 MiB
twig: compiled and loaded 0.0027 sec, 16.1 MiB twig: compiled and !loaded 0.0337 sec, 17.0 MiB
twig: compiled and loaded 0.0013 sec, 17.0 MiB
fenom: !compiled and !loaded 1.0142 sec, 8.8 MiB
fenom: compiled and !loaded 0.0167 sec, 6.1 MiB fenom: !compiled and !loaded 0.3157 sec, 8.9 MiB
fenom: compiled and loaded 0.0024 sec, 6.1 MiB fenom: compiled and !loaded 0.0159 sec, 6.6 MiB
fenom: compiled and loaded 0.0012 sec, 6.6 MiB
Iterating of array ({foreach})
smarty3: !compiled and !loaded 0.0369 sec, 5.7 MiB Testing 'foreach' of big array...
smarty3: compiled and !loaded 0.0048 sec, 3.1 MiB smarty3: !compiled and !loaded 0.0355 sec, 5.8 MiB
smarty3: compiled and loaded 0.0039 sec, 3.1 MiB smarty3: compiled and !loaded 0.0032 sec, 3.1 MiB
smarty3: compiled and loaded 0.0024 sec, 3.1 MiB
twig: !compiled and !loaded 0.0810 sec, 4.3 MiB
twig: compiled and !loaded 0.0605 sec, 2.9 MiB twig: !compiled and !loaded 0.0799 sec, 4.7 MiB
twig: compiled and loaded 0.0550 sec, 2.9 MiB twig: compiled and !loaded 0.0065 sec, 3.2 MiB
twig: compiled and loaded 0.0054 sec, 3.5 MiB
fenom: !compiled and !loaded 0.0093 sec, 3.0 MiB
fenom: compiled and !loaded 0.0033 sec, 2.4 MiB fenom: !compiled and !loaded 0.0459 sec, 3.1 MiB
fenom: compiled and loaded 0.0027 sec, 2.4 MiB fenom: compiled and !loaded 0.0024 sec, 2.5 MiB
fenom: compiled and loaded 0.0017 sec, 2.5 MiB
Inheriting of templates ({extends})
smarty3: !compiled and !loaded 0.6374 sec, 9.8 MiB Testing deep 'inheritance'...
smarty3: compiled and !loaded 0.0009 sec, 3.0 MiB smarty3: !compiled and !loaded 0.3984 sec, 10.2 MiB
smarty3: compiled and loaded 0.0001 sec, 3.0 MiB smarty3: compiled and !loaded 0.0009 sec, 3.1 MiB
smarty3: compiled and loaded 0.0001 sec, 3.1 MiB
twig: !compiled and !loaded 0.5568 sec, 11.1 MiB
twig: compiled and !loaded 0.0255 sec, 6.3 MiB twig: !compiled and !loaded 0.2897 sec, 11.2 MiB
twig: compiled and loaded 0.0038 sec, 6.3 MiB twig: compiled and !loaded 0.0197 sec, 6.5 MiB
twig: compiled and loaded 0.0019 sec, 6.5 MiB
fenom: !compiled and !loaded 0.1222 sec, 3.9 MiB
fenom: compiled and !loaded 0.0004 sec, 2.4 MiB fenom: !compiled and !loaded 0.0546 sec, 3.2 MiB
fenom: compiled and loaded 0.0000 sec, 2.4 MiB fenom: compiled and !loaded 0.0005 sec, 2.5 MiB
fenom: compiled and loaded 0.0000 sec, 2.5 MiB
* **!compiled and !loaded** - template engine object created but parsers not initialized and templates not compiled * **!compiled and !loaded** - template engine object created but parsers not initialized and templates not compiled
* **compiled and !loaded** - template engine object created, template compiled but not loaded * **compiled and !loaded** - template engine object created, template compiled but not loaded

View File

@ -45,16 +45,12 @@ Tag {extends} [RU]
```smarty ```smarty
{use 'blocks.tpl'} {use 'blocks.tpl'}
...
{if $theme.extended?}
{use $theme.extended}
{/if}
``` ```
### {parent} ### {parent}
Planned. Not supported yet. Planned. Not supported yet. Feature #5.
```smarty ```smarty
{block 'block1'} {block 'block1'}
@ -83,4 +79,4 @@ Planned. Not supported yet.
* Имена блоков заданы **не** явно, с использованием переменных, условий или могут быть вложенные в другие теги. * Имена блоков заданы **не** явно, с использованием переменных, условий или могут быть вложенные в другие теги.
Режим может идти только на понижение, при изменении условий во время прохождения по иерархии шаблонов. Режим может идти только на понижение, при изменении условий во время прохождения по иерархии шаблонов.
При любом режиме работы не используется буферизация данных, то есть данные выводятся сразу. При любом режиме работы не используется буферизация данных, то есть данные выводятся сразу.

View File

@ -29,10 +29,10 @@ $result = $fenom->fetch("template/name.tpl", $vars);
Create pipe-line into callback Create pipe-line into callback
```php ```php
$fenom->export( $fenom->pipe(
"template/sitemap.tpl", "template/sitemap.tpl",
$vars, $vars,
$callback = [new SplFileObject("/tmp/sitemap.xml", "w"), "fwrite"], // pipe to file /tmp/sitemap.xml $callback = [new SplFileObject("/tmp/sitemap.xml", "w"), "fwrite"], // pipe to file /tmp/sitemap.xml
$chunk_size = 1e6 // chunk size for callback $chunk_size = 1e6 // chunk size for callback
); );
``` ```