Categories
benchmarks

ZF Config XML vs Ini Showdown

Back at php|tek11 Rob Allen gave a talk on optimizing Zend Framework. During the tutorial he pointed out how you could cache your application config files so that they are not loaded and parsed at every request. This got me thinking about something that had been bugging me for a long time. What is the best format for your config file?

Back before ZF 1.0 there was a fair bit of confusion on how to do everything “right”, especially setting up a “modular” build. One of the first good examples out there was made by Dasprid, and he used an xml based application config. We are talking back in early 2007 when it was the wild west for ZF. Since then, I only see people using ini files.

Well, here it finally is, the official synthetic Zend_Config benchmark shootout.

Categories
howto

PHP Oracle [notice] child pid NNNN exit signal Bus error (10)

After some frustration I learned from a forum post that the default password time limit for Oracle 11g is 120 days. Once you get close to that you will go into a grace period, where PHP’s oci connection dies on you with no explanation. You will notice a message like this in you apache log:

  • [notice] child pid NNNN exit signal Bus error (10) in the apache log.

Step 1: Change your password, or rather lets just keep it as it is…

  • ALTER USER myname IDENTIFIED BY mypassword

Step 2: Make us not have to do this again:

  • ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

Hope this helps someone.

Categories
contest

tek11 Winner

My brother and I got 1st place in the Tropo hackathon at phptek11. If you want to read the rules they were here. We won a Parrot AR.Drone Quadricopter for making a two-factor authentication system using Tropo’s apis.

Categories
howto

Eliminating Mysterious Oracle Indexes

Oracle by default will create cryptic names for indexes unless you specify your own. To get a list of all the indexes currently in use for your schema you can execute:
> select * from user_indexes;
Anything that starts with SYS_ and ends with a $ is an autogenerated index name. It is good to have a common format for your indexes so that any errors are meaningful. address_id_pk is much more readable than SYS_IL0000088969C00006$$. Over here we use the [table]_[column]_[type] format so we can know at a glance where to hunt for the problem.

While doing this I noticed that LOB and CLOB field types automatically generate a SYS_blahblahblah$$ index, polluting your clean design. If that rubs you the wrong way, you can specify the index name for them as well, but the code is a bit messier.