Archive for the ‘PHP’ Category

Fluent Arrays and Strings in PHP - Adding JSON and more

Friday, July 11th, 2008

Table of contents for Fluent interfaces in PHP

  1. Fluent Arrays and Strings in PHP
  2. Fluent Arrays and Strings in PHP - Adding JSON and more

Recently I’ve had the need to extend the interface further, among other things with JSON support. I’ve used code published by Nicolas Crovatti to do this. There was one line in there though that wasn’t consistent with its purpose. If you use that code you have to replace if($i != $keys[$i]) with if($i !== $keys[$i]). On the other hand if you use PHP >= 5.2 you don’t need this function at all, you use json_encode instead.... Read More

Fluent Arrays and Strings in PHP

Monday, June 23rd, 2008

Table of contents for Fluent interfaces in PHP

  1. Fluent Arrays and Strings in PHP
  2. Fluent Arrays and Strings in PHP - Adding JSON and more

I’ve been working some with jQuery and Ruby lately, as you might know they both have very neat fluent interfaces for writing short and easily understandable code. Especially Ruby’s array and string handling should be something that can be done in PHP so I started googling for something nice but so far the best I’ve been able to find is pooQuery. Update: Apparently pooQuery really is a joke (see the comments at the bottom of this post), anyway here is an example from it of how fluent stuff can go too far: ... Read More

Nice ZF, jQuery and Smarty combo

Thursday, June 19th, 2008

Today I noticed a nice, short example of the Zend Framework, jQuery and Smarty stack I’m using. It’s got a lot of niceties from each component in a very small space, perfect for showcasing each and how they can be integrated!... Read More

Extending Zend DB Table

Thursday, June 19th, 2008

For some time now I’ve been working on an administrative backend system. I quickly found the need to extend DB Table with more stuff than needed when I extended the Zend Framework, it’s mostly convenience functions designed to reduce repetitive code snippets. If you have your own copy of ExtModel.php open you should have no problems walking this, we start below fetchAllKeyValue().... Read More

PHP import and export

Wednesday, May 21st, 2008

God how I hate Webmin. No wonder everyone is using phpMyAdmin, everyone except my admin of course.... Read More

IP to Country

Tuesday, March 18th, 2008

Since I’m currently working with advertising related stuff it might be a good thing to learn the whole geographic location by ip number thing. A good starting point is The IP-to-Country Handbook.... Read More

Comparing TYPO3, Joomla, Drupal and MODx

Saturday, March 15th, 2008

My current CMS experience spans TYPO3, Joomla, Drupal, XOOPS and MODx and I’ve started to feel qualified enough to offer some advice regarding these solutions. There are many CMSs out there, both free and commercial and doing research with the intention of making an informed decision can be very, very time consuming. I hope this contribution will make that process somewhat easier.... Read More

ZF Community/CMS Bugfixes

Wednesday, March 12th, 2008

I’m in the process of replacing the horrible PHP code. And I’m using the beefed up version of the Zend Framework that I’ve built in this series of course! However, I’ve started to find some bugs and the fixes will be posted here.... Read More

Farewell HTML Ajax

Tuesday, March 4th, 2008

I just realized that I’ve completely stopped using HTML Ajax. The framework has become completely superfluous for me now that I’m using jQuery’s $.post method.... Read More

Working with other people’s code

Thursday, February 28th, 2008

Yesterday I had to make some changes in VirtueMart for Joomla 1.0.13. This codebase can be a little confusing sometimes. Believe it or not but this was the first time in my PHP-coding career that I felt the need to be able to simply dump all declared variables, not just the globals in $_REQUEST and so on. Perhaps a testament to how little time I’ve spent working on other people’s code, it’s not much.... Read More