About Chris Morrell

I am a Philadelphia web designer and developer who focuses on PHP development and usable design. I am also the Director of IT for the International Association of Certified Home Inspectors.

Please Note: My site fell victim to a Wordpress security flaw a few weeks ago, and I'm just getting everything back to normal. Please bear with me.

I am currently not accepting any new clients.

Other Sites/Clients

Contact Me

If you need to get in touch with me, my name is Chris and my domain name is cmorrell.com. Think about it.

Calculating the difference in days between two Zend_Date objects

Posted by Chris Morrell on November 18th, 2009 in Web Development, Zend Framework (tagged , , )

This just came up on #zftalk, and it appears that the information out there is either incomplete or incorrect, so I thought I’d just put out a simple solution.  Here’s a simple way to calculate the difference between two Zend_Date objects (in days):

$jan1 = new Zend_Date('1.12.2009', Zend_Date::DATES);
echo "\nJanuary first: ", $jan1->toString();

$christmas = new Zend_Date('25.12.2009', Zend_Date::DATES);
echo "\nChristmas is on: ", $christmas->toString();

$diff = $christmas->sub($jan1);
echo "\nNumber of days: ", $diff / 60 / 60 / 24;

1 Comment »

Installing Zend Server & Zend Framework on OS X

Posted by Chris Morrell on May 3rd, 2009 in Web Development (tagged , , , )

This post is mostly a reminder to myself, but I thought I’d put it out there just in case other people wanted some help:

Installing Zend Server CE

If Zend Server is already installed, you need to remove it:

  • For older versions of Zend Server:
    1. Run /Applications/ZendServer/bin/zendctl.sh stop
    2. Remove /etc/zce.rc
    3. Double-check that no instances are running (you can use ps ax|grep -i zend)
  • For newer versions of Zend Server
    1. Run /usr/local/zend/bin/uninstall.sh

Now download the latest version of the Zend Server CE Installer and run the installer

Link the CLI binary so you can use PHP from the command line:

  • sudo ln -s /usr/local/zend/bin/php-cli /usr/bin/php
  • Please note that this step is optional

Installing the Zend Framework

Now download the latest version of the Zend Framework

Unzip and copy the following files:

  • library/Zend to /usr/local/zend/share/ZendFramework/library/Zend
  • extras/library/ZendX to /usr/local/zend/share/ZendFramework/library/ZendX
  • bin to /usr/local/zend/share/ZendFramework/bin
  • Please note that if you don’t need the zf command line tool, and the version of the Zend Framework that came with Zend Server is up-to-date, these steps are unnecessary

Finally, link the zf.sh file so you can access it easily:

  • sudo ln -s /usr/local/zend/share/ZendFramework/bin/zf.sh /usr/bin/zf

That’s it for now.  Hope that helps someone else out.

5 Comments »

@inxilpro

  • Just got home after running 10 miles. I don't think my legs work anymore. Jesus. 1 day ago
  • I don't get it. I have 8 x 3 GHz cores and 10 GB of RAM. How can compressing a 80-minute movie still take over an hour? 1 day ago
  • Ooh, that's sexy: http://bit.ly/btAqlc (form labels—yeah, I'm that much of a geek). 3 days ago
  • More updates...
Copyright © Chris Morrell, Powered by WordPress, Entry RSS Feed / Comment RSS Feed