Pragmatism in the real world

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.

Zend Framework Book coming soon

Now that it's been announced by Manning, I think I can talk a little more about the project that's been taking up most of my spare time! Zend Framework in Action is a collaboration between myself and Nick Lo. We are still writing, but Chapter 1 is available for you to download and see where we are heading with the book. Manning has an early access program where you can get access to pre-production PDFs… continue reading.

Image Resizing Done Right

This is getting a lot of blog-sphere time at the moment. What an excellent idea! (Via The Guardian, who found it on TechCrunch)

ID != id

I've finally updated the source code to my Zend Framework tutorial so that the hidden field in the form is named "id" rather than "ID". A minor error that meant that editing didn't work! This is because in PHP $_POST['id'] is not the same as $_POST['ID']! Whilst I was poking around the source code, I also changed the Zend Auth tutorial to use $db rather than $dbAdapter so that it is consistent with the first… continue reading.