Taking the Zend Framework for a Spin

Oct
03
2007

Last night, I found myself with a bit of free time and mental energy for the first time in quite a few weeks. I headed over to my backlog of "interesting crap" for something I'd marked for later review and took notice of a real-world project using the Zend Framework.

A couple of months ago, I dipped my toe into the Zend Framework for some specific tasks, but hadn't really had time since to look at it in a more general way.

Given that the Zend Framework differs from many of the others out there in being more of a set of libraries that are designed to work together and less of the magic "do it for me" stuff that, while it feels good at first, always tends to make me uneasy.

The linked article about building fav.or.it with the framework does a good job of showing the breadth of components. I was mostly interested in some of the bits that I often put off too long in building applications: logging, exception handling and caching.

That's the stuff that lets you write your own code, your own way, but helps you do it correctly. I wrote a quick test app to try out those features: a basic podcatcher for podcasts.

I used the Zend HTTP Client (instead of CURL or wget) to fetch files, with proper exception handling and logging of the activity. I also used the RSS bits for obvious reasons and included the Cache to keep from hammering the remote sites' RSS every time the app loaded data.

Other than a few early glitches with include paths (why is it that pointers to libraries are a pain in the butt in every mainstream language?) it came together fairly easily.

Of the pieces I was trying out, the Cache is the one that I dug the most. I'm a HUGE proponent of caching stuff whenever you can. There's no reason that data that changes once every six months is fetched on each and every page request.

The Zend Cache module lets you not only cache normal "files", but, by including " 'automatic_serialization' => true" in your options for the cache, you can serialize pretty much any object/variable you want. You pretty much only need to provide a unique name for later retrieval and you have handy caching of whatever you need.

Since a lot of the stuff I write doesn't fit neatly into the CRUD (Create Read Update Delete) mold that many of the frameworks like Rails, CakePHP and company tend to impose, having a framework that's a little more laid back and free about how to do things is a handy thing to have in your toolbox.

October is Finally Here

Oct
01
2007

This morning, I felt like I just entered a clearing in the woods. For all of September, I felt like I was racing through the forest, being chased by a couple of big, hairy projects. For a few days, here and there, I got out ahead of them and had time to enjoy with my family, but I was always watching over my shoulder, waiting to hear them crashing through the brush.

On Friday, we pushed the code for project #1 to staging, thus ending the pursuit of that particular monster. I worked the weekend until the code for project #2 was ready at 8:30pm last night and delivered that as well. Thus, this morning, I found myself facing the alarm clock at 5am without the internal groan that has been there for most of the last month.

Then I thought about it and realized that it was also October 1, the beginning of my favorite month of the year, making this morning an even better new beginning.

I absolutely love the month of October. First, it starts off with my own personal holiday: Sit on Your Butt and Watch Movies Day, which just happens to fall on my birthday each year. Rather than just taking a look at a new number to put in the "age" field in forms and deciding if you're now "old" or not, I take the day to specifically do the things I really enjoy: celebrating my favorite things.

Birthdays mark the passing of another year on this earth and one fewer left before our little blink of existence is over. That fact is made all the more real for me on my birthday as this year's marks the 1st anniversary of my grandmother's passing. The things that made her happy: entertaining, cooking, gospel music, needlework and taking care of others were all present in her daily life. She made each of her 90 years count.

So, on Friday, I take the day off to think about my time on this blue marble thus far, celebrate the things and experiences I enjoy and contemplate how I will spend the next year and those to come. I will observe a moment of silence in her honor and truly enjoy the day.

Birthdays aside, October marks a shift in the weather here in Minnesota that brings crisp, cool mornings where you can see your breath in the early morning sun followed by afternoon breezes that blow through the bright yellow and red leaves as the trees prepare for winter.

October is the first time since May when I know that I'll be free from uncomfortable heat until some time in May.

And, finally, this year, because of how the calendar came out, there are more billable days than any other month of the year. So, not only can I take time off to celebrate life, but still end up with a nice invoice at the end of the month.

There are still leftover effects from September's chaos, but much more manageable and under control. It feels good to be returning to feeling like the "normal" me.

Tracking Accomplishments with PHP, Google Calendar and Zend Framework

Jul
22
2007

A couple of months ago, I pointed out the utility of keeping track of the things you accomplish on a daily basis. I've been keeping mine in just a notebook. However, making something that can be used to extract reporting information for the eventual inclusion in resume's, status reports, etc.

It struck me that keeping track of that stuff on Google Calendar would be a reasonably good way to centralize it and make it accessibly from any of the computers that I work on (Windows, Linux, Mac, etc.) without depending on software. So, I took a quick look at the PHP API for using GCal's information.

It requires the Zend Framework, so this was an opportunity to install that as well. The instructions on installing the Zend Framework were a bit vague. What it boils down to is this. The "Zend" directory inside the "library" needs to be on your "include_path" for PHP. On my Ubuntu development boxes, that means putting that Zend directory as "/usr/share/php/Zend" and the existing configuration picked it up.

I then grabbed the Calendar.php sample file. There's lots of stuff in there I'll (and you'll) want to change in it for ongoing use (like lots of the defaults). However, it works well to get up and running. I stripped all of the stuff at the end of the file (the stuff that wasn't inside a function), thus turning the Calendar.php file into more of a library to be included.

After including that file in my "createaccomplishment.php", I set up a really basic form for creating an entry.
Read the rest of this entry »

Switched Over to Improved SlimStat

Jun
27
2007

For quite a while, I used the Mint stats package. However, as updates came out, I fell behind in doing the upgrades.

They often required multiple steps to upgrade things and, well, I am not particularly fond of that much of that kind of work. Then, when the major version upgrade came out a couple of months ago, and required an upgrade fee, I kind of lost interest.

At $30 a domain, it slid below the value line for me and I went back to SlimStat, which I'd used previously. However, it's bothered me that it only works in PHP pages, which apparently has now been fixed.

I'll be putting that new version in place for the domains where I am most interested in ongoing stats tracking.

Making Your Own Tiny URL's with PHP

May
06
2007

As I've been using Twitter to post frivolous things that aren't worth posting as real posts here on the site, it becomes clear pretty quickly that if you want to post a URL, the 140 character limit gets in the way. The typical solution the people go to is to use something like TinyURL to get a shorter version.

While I could use that service, I decided I'd rather have my own version on my server, so this afternoon, I coded up a quick solution. It consists of an .htaccess file to route everything in a directory called "lnk" to a PHP script. That PHP script either creates a new link or redirects you to an existing one. I also made a quick bookmarklet to make creating links quick and easy.
Read the rest of this entry »

« Older Entries  

J Wynia

For better or worse, I'm the guy who runs things here. I'm a web consultant, software developer, writer and geek from Minneapolis, MN. This site is a fairly wide cross-section of the things I'm interested in and enjoy writing about.

Oh, and if you happen to be looking for hosting for your Subversion repositories or just web hosting in general, take a look at Dreamhost. It's what I use for Subversion and your signup helps me out.

Latest Microposts

Follow Microposts on Twitter | Subscribe to Microposts

My Attendance At the Gym

Feeds and Links


www.flickr.com
This is a Flickr badge showing public photos from J Wynia. Make your own badge here.

Search


Pages

Archives

Computers Blog Directory
© 2003-2008 J Wynia. All original content is licensed under the terms of the Creative Commons Attribution license unless otherwise noted. Content from other sources is licensed under its original terms.