My “AOP in PHP” slides from secon-2007.11 conference

November 19th, 2007

AOPman Here are my Russian “AOP in PHP” slides from secon conference which took place on the 13th of the November 2007 in Penza, Russia.

Go grab it if you are interested in Aspect Oriented Programming in PHP or simply want to practice your Russian ;)

Automating packages upload for PEAR channels running Chiara_PEAR_Server

November 19th, 2007

Setting up Chiara_PEAR_Server with Crtx front end is a little bit confusing(even if you follow the official guide) but at least it happens just once ;)

Another important matter is maintaining your lovely PEAR channel up-to-date which, of course, assumes nice and easy way of uploading new packages. Actually Crtx’s web interface provides such a way and it works just fine for a couple of packages but if you have more than a dozen of them uploading new packages quickly becomes a boring process(e.g. we have 20+ packages at Limb3 PEAR channel)

That’s why I hacked up a script which automates this process quite a bit ;)

Read the rest of this entry »

Bug in Crtx_PEAR_Channel_Frontend?

November 17th, 2007

I’m using Crtx_PEAR_Channel_Frontend-0.3.1-alpha as a PEAR channel front end and I’m pretty happy about it. However there seems to be a bug in the Crtx_PEAR_Channel_Frontend :: getPackageLatestReleases() method at line 500.

It reads:

unset($release[$states[$i+1]]);

While it should read:

unset($release[$states[$i]]);

I tried to email the original author Davey Shafik some time ago to no avail but at least now you are warned ;)

limb/tests_runner-0.8.7 released!

November 10th, 2007

I’m glad to announce the new release of the limb/tests_runner package which reached 0.8.7-beta version! This package ships with limb_unit - a SimpleTest tests “swiss army knife” console based runner. If you’d like to know more about limb_unit utility I would highly recommend reading its documentation since it provides quite unique features like nested fixtures, code coverage and so on(documentation it’s actual for 0.8.5-beta as of this writing, but that’s ok).

This release introduces some unique filtering features which can be quite useful for large sets of tests. Now it’s possible to use filters for the following entities:

  • test classes
  • test classes’ methods
  • test classes’ PHPDoc @group annotation tags

In the rest of this post I’ll describe these new features in detail.
Read the rest of this entry »

{{macro}} - a zillionth attempt to make a PHP template engine that sucks less

November 4th, 2007

After having used multiple template engines for the last 5 years I’m a strong believer that the best template engine is…PHP itself :) We just need some tools to make the usage of raw PHP in templates more friendly and readable.

I have used the forked version of WACT template engine for about 3 years and finally come to the conclusion that its runtime part is way too complicated and non obvious at times. However I do very like the idea of compile time tree of components which generate PHP code. At the same time I just wanted to simplify WACT and make the process of adding new tags much more straight-forward.

That’s why I have hacked up the initial implementation of {{macro}}. To be short, the main idea behind {{macro}} is to use C/C++ alike(but way more sophisticated) macro tags to simplify usage of raw PHP in templates.

Read the rest of this entry »

Buildman - dead simple Continuous Integration tool

November 4th, 2007

If you have ever tried to setup the Continuous Integration process using one of the well known ‘classic’ tools like CruiseControl you might have been wondering if there’s a simpler and quicker way. I have been wondering too, thus meet Buildman ;)

Read the rest of this entry »

Script for adding new MySQL database and user easily

October 20th, 2007

At my company we have lots of MySQL databases(usually one for each virtual host) and each database has its unique user. Adding a new database and a user with proper permissions can be quite tedious, that’s why I hacked up the following script which saves some of my precious time ;)

Read the rest of this entry »

A couple of nginx utility scripts

October 20th, 2007

In my previous nginx related post I promised to show a couple of utility scripts we use to simplify managing of multiple virtual hosts both under Apache and nginx. Well, here they come ;)

Read the rest of this entry »

lmbActiveRecord’s late static binding emulation

October 15th, 2007

I was quite inspired on having heard that the late static binding(LSB) patch will make it into PHP-5.3. In short, it should allow to know the name of a class which invoked the parent’s static class method.

Read the rest of this entry »

vim automatic directory upward search for Make and Scons build scripts

October 8th, 2007

If you happen to have your vim configured to change the current directory to the one where the edited file is stored(e.g. “autocmd BufEnter * :cd %:p:h”) you might find the following vim script handy.
Read the rest of this entry »