News Feed
Sections
News Archive


Community Events






feed this:

Brian Moon's Blog:
Stupid PHP Tricks Normalizing SimpleXML Data
0 comments :: posted Tuesday June 03, 2008 @ 09:34:22
voice your opinion now!

Brian Moon has a "stupid PHP trick" posted to his blog today - normalizing SimpleXML data you've pulled in from just about any external source.

Anyhow, one annoying thing about SimpleXML has to do with caching. When using web services, we often cache the contents we get back. We were having a problem where we would get an error about a SimpleXML node not existing.

They were using memcache to store the information but came across problems when their code tried to use a (sometimes) empty tag. He gives two solutions - one using a recursive function that identifies the empty items and the other that encodes then decodes the object to and from JSON, keeping the values intact.

tagged with: trick stupid simplexml normalize json recursive empty tag


John Rockefeller's Blog:
PHP Tricks How To Handle Multiple Domains
0 comments :: posted Tuesday May 27, 2008 @ 11:11:01
voice your opinion now!

John Rockefeller has a tip he'd like to share with all of the other PHP developers out there - a little method he's come up with to host multiple domains off of the same code.

This is really handy for those of us who have the same code handling multiple sites or multiple sub-domains. A case in point: When I coded NetBoardz (my free forum hosting service now defunct), I had one codebase handling all 250 forums. How? Simple. When the code runs, it determines which site the user is loading and does different things (like using different databases) dynamically.

He shows the two key points to dividing things up - grabbing the domain and subdomain they were trying to access. This can be fed into a script that can switch things like layout or even functionality based on which site they've chosen.

tagged with: trick multiple domain same codebase subdomain hostname

SaniSoft Blog:
Help! vendor() is deprecated.
0 comments :: posted Monday May 12, 2008 @ 09:35:48
voice your opinion now!

On the SaniSoft blog today, Tarique Sani has a quick hack for CakePHP users needing to transition over from the deprecated vendor() call - import().

Use of vendor() function to load third party libs in CakePHP has been deprecated for some time now... It has been replaced with the more generic App::import() the usage is simple.

There's also a little trick you'll need to know for files with underscores (drop it and replace with an uppercase) and how to get it to be a bit more flexible and recognize vendor files in subdirectories or ones differently named.

tagged with: vendor cakephp framework deprecated trick underscore subdirectory


cakephp application book job conference zend PHP5 pecl code zendframework package PEAR release security releases mysql developer framework database ajax

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework