Skip to content

Month: November 2010

Codebits 2010 wrap up – part 1 / 2

For the past 3 days, between 11 and 13 of November, i had been at Codebits 2010, and let me share with you, was such a great event. As a short opinion i would just say the following, if you haven’t been to a Codebits yet, please make it on your agenda for 2011, you will not regret, year after year a greater event.

Codebits 2010
Photo by Sara Santos

Great content

The event talks were divided by 4 concurrent stages, that means some chooses need to be made. Here’s what i attended and my opinion on it. You should check out the event calendar at the event page and watch the videos from most of the talks, it really worth your time.

Day 1 – Mahout, Activity Streams and How to talk to marketing people

Revisiting PHP 5.3 __invoke magic method

PHP version 5.3 introduced a new magic method designed __invoke, this method is called when a script tries to call an object as a function.

The __invoke magic method

< ?php
 
class Car {
 
	public function __invoke($v) 
	{
		echo "Just called object as function with parameter '".$v."'\n";
	}
 
}
 
$c	=	new Car;
 
// Just to make sure we have an object
echo "I am an object of type: ".get_class($c)."\n";
 
// Now let's use it as a function
$c('ford');

Speeding up your application with Cache_Lite

Cache_Lite is one of the fast, light and reliable cache system for PHP. It’s an extremely easy and small learning curve system to work with. This post will try to make you a light introduction to PHP Cache_Lite.

Installing PEAR Cache_Lite

In order to work with Cache_Lite you need to install the PEAR package.

pear install Cache_Lite-1.7.8

Starting with Cache_Lite

Is easy as instantiating the object to start using Cache_Lite.