Category Archives

Archive of posts published in the category: PHP

Accessing private or protected attributes and methods in PHP

You might need at some point to access the pivate or protected method of a PHP class. Of course, this is in general a bad sign because methods are not available in the public interface of the class for a reason: their implementation can…

PHP – extending classes – reverse inheritance

This one is quite interesting and one reason for which I don’t like PHP that much. From http://php.net/manual/en/language.oop5.visibility.php: Members declared protected can be accessed only within the class itself and by inherited and parent classes. So members declared in a class can be accessed…

CakePHP REST API

Recently I had to implement a REST API on a website developed on CakePHP. CakePHP is a great framework and has its own (easy) ways to setup a REST API. But I needed something a bit more flexible and a bit more strict.…

PHP German Stemmer

I’m pretty proud of this one since is probably the first piece of code that I’m sharing. I recently needed to implement stemming for a search angine in multiple languages. Stemming means reducing the derivated words in a language’s dictionary to the same…