Pragmatism in the real world

svn and case-insentive file systems

Another one to chalk up to a doh! moment… I'm checking out my wife's website to my new MacBook and get this error message: svn: In directory 'website/gallery/piccies' svn: Can't move source to dest svn: Can't move 'website/gallery/piccies/.svn/tmp/prop-base/IMG_0013-thumb.jpg.svn-base' to 'website/gallery/piccies/.svn/prop-base/IMG_0013-thumb.jpg.svn-base': No such file or directory I'm pretty sure that there's no problem with the subversion repository as I've been using it for months with no problem so I asked a friend to check it out… continue reading.

post2cat doesn't exist after upgrading WordPress

Note to help anyone else who has the same problem! If you are a "little behind" the times when you upgrade you WordPress installation, you may see errors like this: WordPress database error: [Table 'xxx.wp_post2cat' doesn't exist] SELECT cat_ID AS ID, MAX(post_modified) AS last_mod FROM `wp_posts` p LEFT JOIN `wp_post2cat` pc ON p.ID = pc.post_id LEFT JOIN `wp_categories` c ON pc.category_id = c.cat_ID WHERE post_status = 'publish' GROUP BY cat_ This is because the tables… continue reading.

The move to Mac

A couple of days after Leopard came out, my wife and I found ourselves in the Apple store in Solihull and came away with an iMac for her and a MacBook Pro for me. The main reasons we have been interested in Macs recently are: Disappointed with Vista on my wife's brand new computer Disappointed with our last two Inspiron laptops Sleep that works The hardware looks good! Unix in the terminal Interestingly, the biggest… continue reading.

Do it before goddamned breakfast

jwz on 29th Oct 2007: When (WHEN) your backup drive goes bad, which you will notice because your last backup failed, replace it immediately. This is your number one priority. Don't wait until the weekend when you have time, do it now, before you so much as touch your computer again. Do it before goddamned breakfast. The universe tends toward maximum irony. Don't push it. Some very good advice. I just back up my "cannot… continue reading.

PHPAbstract

If you read DevZone, then you'll notice that Cal's looking for some PHP Abstract advertising. I'm always up for free books, so there's my link Cal! (Though I doubt that technorati picks up my little blog!) More seriously, PHPAbstract is worth listening to. Unusually for a podcast, each episode is short (around 10 mins) so that I actually get to listen to a whole episode without being distracted. They have episodes by many (lots?) well… continue reading.

Life outside of PHP

I thought that I'd answer Davey's question: what do you do to get away from PHP?. I also enjoy seeing the non-PHP side of people on Twitter, though I'm tending to use Twitter as a micro-blogging tool more at the moment. I enjoy spending my "non-PHP" time with my family. We are members of the National Trust as it gives us cheap access to land where the boys can run around freely. We also go… continue reading.

Luke – Lucene Index Toolbox

If you want to understand what's in your Zend_Search_Lucene index files, then download Luke (http://www.getopt.org/luke/) and point it at the directory containing your index files. This is screenshot of my test index: Wow! What a very useful tool!

View Helper Case Notes

This is how it works: views/helpers/MyHelper.php contains class Zend_View_Helper_MyHelper which has a function called myHelper() Also, if you add a function called setView() to your class, then the View will pass you an instance of itself before it calls your view helper function. i.e. Class Zend_View_Helper_MyHelper { protected $_view; public function setView($view) { $this->_view = $view; } public function myHelper($myVar) { return $this->_view->escape($myVar); } }

Downtime

Just a heads-up. Tomorrow, this site is being moved to a new server and so is going to be down for most of tomorrow from around 10:00 (GMT) to late evening.

Zend_Filter_Input / Zend_Validate Messages

The basic usage of Zend_Filter_Input is: $filters = array('body' => array('StringTrim' , 'StripTags')); $validators = array('body' => 'Alpha'); $input = new Zend_Filter_Input($filters, $validators, $_POST); if ($input->isValid()) { // do something with form } else { // failed validation $messages = $input->getMessages(); // iterate though $messages to display to user } The problem is that the message you get out isn't always written as you would like. Consider the output if the body record is empty.… continue reading.