Skip to content
Maksim Kochkin edited this page Feb 18, 2015 · 1 revision

Blitz is a PHP extension distributed in source code (Win32 users can download compiled DLL's).

To extract the code and build the extension just follow these simple steps:

tar zxvf blitz-0.6.10.tar.gz
cd blitz-0.6.10
phpize
./configure
make install

To test blitz run the test script run-tests.sh. You need to edit this file to change the path to the standart PHP test routine run-tests which comes with PHP. Running the tests you will get something like this:

fisher@fisher:~/prj/blitz> ./run-tests.sh
=====================================================================
PHP         : /usr/local/bin/php5
PHP_SAPI    : cli
PHP_VERSION : 5.3.2-dev
ZEND_VERSION: 2.3.0
PHP_OS      : Linux - Linux fisher 2.6.11.4-20a-smp #1 SMP Wed Mar 23 21:52:37 UTC 2005 i686
INI actual  : /local/php_5_3_fpm/lib/php-cli.ini
More .INIs  :
CWD         : /home/fisher/prj/blitz
Extra dirs  :
VALGRIND    : Not used
=====================================================================
Running selected tests.
PASS block [tests/block.phpt]
PASS Bug #83 (double free on include()) [tests/bug83.phpt]
PASS clean [tests/clean.phpt]
PASS comments [tests/comments.phpt]
PASS contexts [tests/context.phpt]
PASS date output wrapper [tests/date.phpt]
PASS double Blitz object initialization [tests/double_init.phpt]
PASS report duplicate contexts [tests/duplicates_001.phpt]
PASS broken templates 001 [tests/error_001.phpt]
PASS broken templates 002 [tests/error_002.phpt]
PASS errors and warnings: syntax [tests/errors1.phpt]
PASS errors and warnings: execution [tests/errors2.phpt]
PASS escape output wrapper [tests/escape.phpt]
PASS fetch#1 [tests/fetch1.phpt]
PASS fetch#2 [tests/fetch2.phpt]
PASS fetch#3 [tests/fetch3.phpt]
PASS get context [tests/get_context.phpt]
PASS has context [tests/has_context.phpt]
PASS if/unless predefined methods [tests/if.phpt]
PASS conditional contexts (multi-line conditions): if/end and unless/end [tests/if_context.phpt]
PASS controller include method [tests/include-method.phpt]
PASS predefined methods: include [tests/include.phpt]
PASS include with context iteration [tests/include_ctx.phpt]
PASS multiple include cache test [tests/include_multi.phpt]
PASS ini-values settings test [tests/ini.phpt]
PASS nonexistant path iteration [tests/iterate_nonexistant.phpt]
PASS user-defined methods [tests/method.phpt]
PASS method call from inner include [tests/mfi.phpt]
PASS mix #1 [tests/mix1.phpt]
PASS mix #2 [tests/mix2.phpt]
PASS mix #3 [tests/mix3.phpt]
PASS mix #4 [tests/mix4.phpt]
PASS mix #5 [tests/mix5.phpt]
PASS mix #6 [tests/mix6.phpt]
PASS numerical and non-numerical keys in the iteration set [tests/non_num_iter.phpt]
PASS parse with iteration set [tests/parse_with_iterations.phpt]
PASS relative path (blitz.path) [tests/path.phpt]
PASS partial php_templates syntax compability [tests/phpt_compability.phpt]
PASS plugins [tests/plugins.phpt]
PASS predefined loop variables: $_total, $_num, $_even, $_odd, $_first, $_last [tests/predefined.phpt]
PASS returning non-strings from user methods [tests/return_non_string.phpt]
PASS scope lookup test #1 [tests/scope.phpt]
PASS scope lookup test #2 [tests/scope2.phpt]
PASS set and get [tests/set_and_get.phpt]
PASS mixed set [tests/set_mixed.phpt]
PASS remove empty spaces around context tags [tests/spaces.phpt]
PASS variables [tests/var.phpt]
PASS unprefixed variables syntax [tests/var_no_prefix.phpt]
PASS {{ $hash.sub.key }} syntax [tests/var_path.phpt]
PASS iterate after wrong previous iterations [tests/wrong_iterations.phpt]
=====================================================================
Number of tests :   50                50
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    0 (  0.0%) (  0.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :   50 (100.0%) (100.0%)
---------------------------------------------------------------------
Time taken      :    1 seconds
=====================================================================

If Blitz was build as shared module you will probably need to edit your php.ini and include Blitz in extension list: extension=blitz.so

Clone this wiki locally