Pragmatism in the real world

Where is php ?

A question came up on the phpwomen channel today about how to find the path to php executable for use in cron scripts. The answer that came back very quickly to use which or whereis. It turns out that the server in question is a shared host with a control panel for access to cron and ftp to upload your files. A test proved that shell_exec() wasn't going to work too. After discussing it for… continue reading.

PHPNW08 schedule posted

From one conference to another one. On the 22nd November 2008, the PHPNW08 conference in Manchester takes place and I'm speaking! My talk is entitled "First steps with Zend Framework" and it will cover an introduction to ZF and then walk through building an MVC application using the Zend Framework. There are lots of interesting talks scheduled so far. They look aimed at a wide and I want to see every one. If you are… continue reading.

ZendCon 08

I'm now back from ZendCon which was the most intense conference I've ever been too. I arrived late Saturday evening and after dropping off the stuff at my hotel, I walked the mile or so to the conference hotel to meet up with some #phpc people. I didn't stay in the Hyatt as it was too expensive for me. The walk took a little longer than I expected as I kept walking the wrong way,… continue reading.

Uninstalling MySQL on Mac OS X Leopard

To uninstall MySQL and completely remove it (including all databases) from your Mac do the following: Use mysqldump to backup your databases to text files! Stop the database server sudo rm /usr/local/mysql sudo rm -rf /usr/local/mysql* sudo rm -rf /Library/StartupItems/MySQLCOM sudo rm -rf /Library/PreferencePanes/My* edit /etc/hostconfig and remove the line MYSQLCOM=-YES- rm -rf ~/Library/PreferencePanes/My* sudo rm -rf /Library/Receipts/mysql* sudo rm -rf /Library/Receipts/MySQL* sudo rm -rf /private/var/db/receipts/*mysql* The last three lines are particularly important as otherwise,… continue reading.

PHPNW Conference

There's a new UK PHP conference coming in November. PHPNW08 will take place on 22nd November 2008 which is a Saturday so there's no excuses not to go! To select the talks that will be presented, a Call for Papers has been announced with a deadline of 21st September 2008. From my reading of the website, this is a developer-centric conference and so if you have something to say about current PHP technologies and development… continue reading.

Busy

I'm kind of neglecting this blog at the moment. Sorry. I was away last week and I'm head down into editing Zend Framework in Action. It's amazing how many details the technical proof reader and our copy editor have found. The book is going to be so much better as a result. I need to go through each suggestion though and ensure that the meaning hasn't changed and to implement the suggested technical changes. When… continue reading.

Recursion

PHPWomen are running an article contest at the moment. All you have to do is write an article for the Best Practices forum and you could win a Zend Studio for Eclipse license and a a 1-year subscription to Linux Pro magazine! Obviously, never one to miss an opportunity to win free swag, I've entered with an article on recursion. Now it's your turn. Write a article on a best practice when coding PHP, but… continue reading.

Notes on Zend_Cache

Recently I needed to speed up a legacy project that makes a lot of database calls to generate each page. After profiling, I discovered that 90% of the database calls returned data that rarely changed, so decided to cache these calls. One of the nice things about Zend_Framework is that its use-at-will philosophy means that you can use any given component with minimal dependencies on the rest of the framework code. In my case, I… continue reading.

UK Readers: Don't buy petrol from BP or ESSO

This is very off-topic, so feel free to skip! Received a round-robin today via email. As I don't send on such things, I thought I'd mention it here as I'm getting fed up with the price of petrol, especially given the profit that the big oil companies have recently announced: Received from a good friend so leave the rest to you! See what you think and pass it on if you agree with it. We… continue reading.

Zend Framework URLs without mod_rewrite

Some of our Zend Framework applications have to run on IIS without ISAPI_Rewrite installed. In these cases we need urls of the form http://www.example.com/index.php?module=mod&controller=con&action=act. I couldn't get this to work out of the box with Zend Framework 1.5, so wrote my own router called App_Controller_Router_Route_RequestVars. This code obviously only supports what I needed and I've only tested it on IIS for Windows 2003 Server, so you may need to tweak to make it do what… continue reading.