I’m all for standardization and standardizing procedures for long-term efficiency. However, up until now, where there were no “official” standards for something, I would make up my own or imitate what I thought was the nicest. One place where I’ve done just this was with regards to my coding styles for PHP - I had my own styles. Well, no more! I’ve finally decided to take the plunge and following the PEAR coding standards. Continue Reading »
One of the new features that came with PHP 5 is the ability to implement Iterators. Implementing one of your objects as an iterator essentially allows you to treat it as a standard array. By default, without adding any additional code, you can enable iteration over a regular objects variable members. So, for example, if I had the following code:
(I’ve removed the plugin that I used to format PHP code here, so until I find out that works, I apologize for not showing my code examples…)
If I were to run a foreach() loop over this, I would get behavior that would correspond to an array with the elements of $bar1, $bar2, & $bar3. This is wonderful default functionality. However, you can go a step further if you want to implement more complex & complete behavior. I’m going to be experimenting on this kind of behavior with my DBObject class - namely, converting it to a DBArray object, and see how well that goes over. I will report on my successes & travails in followup posts.
(Boy I’m having a hard time to get Wordpress to format code on this thing…probably need to get an extension to do it. Any suggestions?)
Mediawiki 1.6 has been released! Why is this so important? Why, because both HidayahWiki & Encyclopedia Islam are powered by it! Oh, and I think there is this other site that uses it too…
Well, bliss might be too strong of a word, but running FC5 on my PC is really enjoyable. If only for the new Gnome interface, it would be worth it, but FC5 (and Linux, generally) really is a pleasant experience, though definitely not recommended for mainstream computers users yet without getting a system fully prepped. Continue Reading »