mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Mass refactory
Rename project
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
About Aspect [RU]
|
||||
=================
|
||||
About Cytro [RU]
|
||||
================
|
||||
|
||||
Aspect - самый быстрый, гибкий и тонкий шаблонизатор для PHP, унаследовавший синтаксис от Smarty3 и улучшив его.
|
||||
Cytro - самый быстрый, гибкий и тонкий шаблонизатор для PHP, унаследовавший синтаксис от Smarty3 и улучшив его.
|
||||
Пожалуй это единственный шаблонизатор, который не использет ни регулярные выражения, как Twig, ни лексер от BISON, как Smarty3.
|
||||
Вы не найдёте ни одного регулярного выражения в ядре Aspect, но тем не менее ядро простое, компактное и очень быстрое.
|
||||
|
||||
|
@@ -15,9 +15,9 @@ To start benchmark run script `benchmark/run.php`.
|
||||
twig: compiled and !loaded 0.0337 sec, 16.1 MiB
|
||||
twig: compiled and loaded 0.0027 sec, 16.1 MiB
|
||||
|
||||
aspect: !compiled and !loaded 1.0142 sec, 8.8 MiB
|
||||
aspect: compiled and !loaded 0.0167 sec, 6.1 MiB
|
||||
aspect: compiled and loaded 0.0024 sec, 6.1 MiB
|
||||
cytro: !compiled and !loaded 1.0142 sec, 8.8 MiB
|
||||
cytro: compiled and !loaded 0.0167 sec, 6.1 MiB
|
||||
cytro: compiled and loaded 0.0024 sec, 6.1 MiB
|
||||
|
||||
Iterates array
|
||||
|
||||
@@ -29,9 +29,9 @@ To start benchmark run script `benchmark/run.php`.
|
||||
twig: compiled and !loaded 0.0605 sec, 2.9 MiB
|
||||
twig: compiled and loaded 0.0550 sec, 2.9 MiB
|
||||
|
||||
aspect: !compiled and !loaded 0.0093 sec, 3.0 MiB
|
||||
aspect: compiled and !loaded 0.0033 sec, 2.4 MiB
|
||||
aspect: compiled and loaded 0.0027 sec, 2.4 MiB
|
||||
cytro: !compiled and !loaded 0.0093 sec, 3.0 MiB
|
||||
cytro: compiled and !loaded 0.0033 sec, 2.4 MiB
|
||||
cytro: compiled and loaded 0.0027 sec, 2.4 MiB
|
||||
|
||||
templates inheritance
|
||||
|
||||
@@ -43,9 +43,9 @@ To start benchmark run script `benchmark/run.php`.
|
||||
twig: compiled and !loaded 0.0255 sec, 6.3 MiB
|
||||
twig: compiled and loaded 0.0038 sec, 6.3 MiB
|
||||
|
||||
aspect: !compiled and !loaded 0.1222 sec, 3.9 MiB
|
||||
aspect: compiled and !loaded 0.0004 sec, 2.4 MiB
|
||||
aspect: compiled and loaded 0.0000 sec, 2.4 MiB
|
||||
cytro: !compiled and !loaded 0.1222 sec, 3.9 MiB
|
||||
cytro: compiled and !loaded 0.0004 sec, 2.4 MiB
|
||||
cytro: compiled and loaded 0.0000 sec, 2.4 MiB
|
||||
|
||||
* **!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
|
||||
|
@@ -5,11 +5,11 @@ For installation use [composer](http://getcompoer.org). Add in your `composer.js
|
||||
```json
|
||||
{
|
||||
"require": {
|
||||
"bzick/aspect": "dev-master"
|
||||
"bzick/cytro": "dev-master"
|
||||
}
|
||||
}
|
||||
```
|
||||
or use shell
|
||||
`composer require bzick/aspect`
|
||||
`composer require bzick/cytro`
|
||||
|
||||
If you do not use composer - use `psr-0` format for loading Aspect's classes.
|
||||
If you do not use composer - use `psr-0` format for loading Cytro's classes.
|
||||
|
@@ -1,7 +1,7 @@
|
||||
Documentation
|
||||
=============
|
||||
|
||||
### Aspect
|
||||
### Cytro
|
||||
|
||||
* [About](./about.md)
|
||||
* [Install](./install.md)
|
||||
|
@@ -5,4 +5,5 @@ Modifier length [RU]
|
||||
|
||||
* если массив - длина массива
|
||||
* если итератор - длина итератора
|
||||
* если строка - длина строки (поддерживается UTF8 и не требует `mbstring`)
|
||||
* если строка - длина строки (поддерживается UTF8 и не требует `mbstring`)
|
||||
* для других значений возвращается 0
|
@@ -6,31 +6,31 @@ Settings [RU]
|
||||
Что бы установить папку для хранения кеша собранных шаблонов
|
||||
|
||||
```php
|
||||
$aspect->setCompileDir($dir);
|
||||
$cytro->setCompileDir($dir);
|
||||
```
|
||||
|
||||
### Template settings
|
||||
|
||||
```php
|
||||
// set options using factory
|
||||
$aspect = Aspect::factory($tpl_dir, $compile_dir, $options);
|
||||
$cytro = Cytro::factory($tpl_dir, $compile_dir, $options);
|
||||
// or inline using method setOptions
|
||||
$aspect->setOptions($options);
|
||||
$cytro->setOptions($options);
|
||||
```
|
||||
|
||||
Параметры могут быть массивом `'option_name' => true` (если ключ не указан автоматически задаётся false) или битовой маской.
|
||||
|
||||
* **disable_methods**, `Aspect::DENY_METHODS`, запретить вызов методов у объектов
|
||||
* **disable_native_funcs**, `Aspect::DENY_INLINE_FUNCS`, запретить использование PHP функций, кроме разрешенных
|
||||
* **auto_reload**, `Aspect::AUTO_RELOAD`, пересобирать шаблон если его оригинал был изменён (замедляет работу шаблонизатора).
|
||||
* **force_compile**, `Aspect::FORCE_COMPILE`, пересобирать шаблон при каждом вызове (сильно замедляет работу шаблонизатора).
|
||||
* **force_include**, `Aspect::FORCE_INCLUDE`, оптимизировать вставку шаблона в шаблон. Это увеличит производительность и размер собранного шаблона.
|
||||
* **disable_methods**, `Cytro::DENY_METHODS`, запретить вызов методов у объектов
|
||||
* **disable_native_funcs**, `Cytro::DENY_INLINE_FUNCS`, запретить использование PHP функций, кроме разрешенных
|
||||
* **auto_reload**, `Cytro::AUTO_RELOAD`, пересобирать шаблон если его оригинал был изменён (замедляет работу шаблонизатора).
|
||||
* **force_compile**, `Cytro::FORCE_COMPILE`, пересобирать шаблон при каждом вызове (сильно замедляет работу шаблонизатора).
|
||||
* **force_include**, `Cytro::FORCE_INCLUDE`, оптимизировать вставку шаблона в шаблон. Это увеличит производительность и размер собранного шаблона.
|
||||
|
||||
```php
|
||||
$aspect->setOptions(array(
|
||||
$cytro->setOptions(array(
|
||||
"compile_check" => true,
|
||||
"force_include" => true
|
||||
));
|
||||
// same
|
||||
$aspect->setOptions(Aspect::AUTO_RELOAD | Aspect::FORCE_INCLUDE);
|
||||
$cytro->setOptions(Cytro::AUTO_RELOAD | Cytro::FORCE_INCLUDE);
|
||||
```
|
Reference in New Issue
Block a user