Archive for November, 2007

CGIExt 0.0.2 released - a re-implementation of cgi.rb in C extension

November 26th, 2007

I have released CGIExt 0.0.2.

http://rubyforge.org/projects/cgiext/

About

‘CGIExt’ is a re-implementation of ‘cgi.rb’ in C extension. It makes your web application faster.

Currently, not of all functions are implemented.

Notice: This module is still ‘alpha release’ and it’s specification may change in the future.

10 lines implementation of PHP template engine

November 4th, 2007

PHP provides the following functions.

extract($array) — import associated array as local variables. include($filename) — read PHP file and evalue it.

Using these functions, you can get your own PHP template engine in 10 lines. The following is an example.

Why Smarty is too slow?

November 3rd, 2007

Smarty Template Engine is the most popular and widely used template engine for PHP. It is believed that Smarty is fast because it compiles templates into PHP code, but it is not true.

I have tried a simple benchmark program to measure speed of Smarty and PHP include() function. The result shows that PHP include() function is more [...]