Posts Tagged "PHP5"

There is much debate about the __autoload function introduced in PHP5. I personally love it as all those requires, includes etc. made programs quite messy, and frankly annoy me if you create loads of pages that keep on requiring the same classes.

The one fault __autoload has though is that Exceptions cannot be thrown, and that to me would give potential for some great degradeablity.

Thankfully, there are a few ways of hacking the autoload function so that it does throw an Exception. The most common way is to create a class with the class name the autoload function is looking for using the eval() function, and then throw an exception once autoload is happy.

Read More

I needed to grab a couple of new blog entries on a website’s wordpress blog area, and put it on a non-wordpress home page. I ended up making a PHP 5 class that did the job for me. Very simple, no fancy stuff.

I then needed to get a load of youtube video posts on the same site from a specific account and had to make a list of that, with thumbnails etc. . I ended up tweaking the first class ever so slightly and lucky me, I had an easy feed reader.

Read More