Book Review: Zend Enterprise PHP Patterns

Thursday, February 18th, 2010

Today we have a brief review of the book “Zend Enterprise PHP Patterns”. I want to thank the Utah PHP Users Group for the gift of this book, along with the great knowledge base and friendship that come with participating with them. If you are in Utah, and specifically in the Wasatch Front Area you should really check them out.

Zend Enterprise PHP Patterns written by John Coggeshall with Morgan Tocker. Published by apress publishing. About the authors: “John Coggeshall is CEO of Internet Technology Solutions . . . and the former Senior Architect of Zend Technologies’ Global Services team.” He has been using PHP since 1997 and can be followed on twitter by adding @coggle. Morgan Tocker “is a Consultant at Percona, a company that provides consulting and custom development for MySQL.”

Lets start by talking about what PHP is. PHP stands for Hypertext Preprocessor and is a server-side scripting language for web development. It started in 1995 and quickly became popular not only because it was easy and free to deploy but it was also easy to use. It has colloquially been called the little kids scripting language and often seems to be the but of jokes due to an apparent overuse by those with a lack of coding standards. My own friend Synic told me once that part of his issues with PHP was that code that does the work, and code that displays the UI should be held separate (MVC development model), and that without a proper framework PHP could not be separated.

In steps the Zend Framework (and consequently this book) do discuss a tool to put PHP applications into the enterprise level. As said on page 1, “When developing an enterprise application in any language, tooling is almost as important to you as the way you use the tools. . . When it comes to tooling, the PHP world is no different. While I’ll admit there are decidedly fewer options available to a PHP development team, those options that do exist are impressively robust and easy to use. One such category of tools is frameworks that help ease the pain of development and maintenance of application for their entire lifetime while promoting best practices. One such framework is Zend Framework (ZF).”

When deciding which of the frameworks to use, why use Zend Framework? Why not CakePHP or Codeignitor or any of the other php frameworks? “Zend Framework is quiet different than most other PHP-based frameworks in the sense that your commitment to using the framework is left entirely to you. Where most frameworks force you into specific coding practice or impose on you a specific way the framework must be used to be effective, Zend Framework is based on the notion that each component can be used completely independently of the rest of the framework.”

As you continue to explore the Zend Framework throughout the book you are lead through simple examples of every part of the development process. From creating a simple “Hello World” application using the MVC development model, to deploying your application on a PHP server farm this book gives an easy to follow formula for getting the job done.

Be forewarned, if you are a beginning PHP developer, or don’t feel quiet up to snuff as an intermediate user this book will be target over your head. To have a full grasp of what is going on an intermediate to advanced understanding of PHP and general coding is required. The book can be found on Apress.com.

Introducing Stackable

Tuesday, February 9th, 2010

As part of my new business adventures I bought several domains. Then came the thought of hosting several domains and that was a nightmare. Not because it is hard but for the most part I usually encourage people just to use some generic hosting through xmission, godaddy or whoever-it-is today dot com. But I didn’t want to have several hosting accounts out there for my own stuff.

Also, as a system administrator I want to have full and granular control of what is going on. This made me think that I either need to have a colo-ed server of some kind, or a VPS. This would give me great control, and I could have as many websites on the machine as I want to, or until the server crashes. Whichever comes first.

Now, I like to support local businesses, especially ones that support open source because that is just who I am. After some looking around and finding that my budget would curtail things like colo-ing a server, I caught wind of stackable.com. A subsidiary of xmission that is offering a cloud computing solution something similar to Amazon EC2.

Screenshot of StackableSo, what is Stackable. Stackable is cloud computing offering a sort of managed hosting option. You the consumer can set up as many ‘containers’ (servers) you would like to pay for in your account. Each container is running CentOS 5 and you get shell and ftp access to the container itself.

Once you have your containers set up you can set up sites. When you set up a site using the dashboard it creates the appropriate directory structure in your container home folder for the doc_root, creates the appropriate virtual host files for apache and reloads the httpd service.

Lastly, you can create as many databases as you need for your applications. These are held on different xmission servers and you are given all the information that you will need to use the database.

Once you have all your pieces in place you are ready to point your DNS to your site ‘DNS Address’ and away you go. It works well. You are using it right now :)

So the good: It is quite reasonably priced and helps out a local Utah business. It is designed to let you quickly set up a site and get back to what you need to do. The dashboard is actually quite easy to navigate, and you are given a section to restart, stop, start services on your server as needed. The support staff for stackable is actually on the ball. They know what they are talking about and get back to you quickly. Very refreshing. They use the xmission data center which is quite nice (they will give you a tour, you should check it out). In addition to that all the containers are on servers using raid for drive redundancy and the container home folders are on some network attached storage that is backed up nightly. All that security at no effort to myself.

What is not good: To sign up for the service you have to actually request an invite. It is not at the point of ‘active’ deployment yet. While the hosting portion itself works fine there are some things missing. Many of these are outlined in stackable’s faq but I could share a few. It seems that it is only set up at this point to support PHP, MySQL, and Apache. You get your lamp stack and can go on your way. If your site is running Ruby on Rails, Python or Django, etc. you will have to wait, they will implement that in the future. Also, there is no root access. At first, I thought this was a holdup, but after thinking about it for a while, I can do most of my admin stuff from the web-dashboard. So for me, this is no longer a show stopper but it could be for some as you don’t have full control. Lastly, there is extremely poor documentation. For example, I pointed the DNS of my site to the container IP address and was not getting anything served out as webpages. What I needed to do was point my DNS to the ‘DNS Address’ of the ‘site’. Not documented. Had to use the help email.

All in all I am so far very happy with stackable.com and look forward to seeing the project mature. Cudos to xmission.

Why choose proprietary languages?

Wednesday, September 30th, 2009

I am trying to figure this out. I am now supposed to be supporting a web application that is on our local intranet. It is made by one of our suppliers and although it is supposed to be a client management system its real purpose it to sell more of their product. As a free software lover I use firefox for web browsing and I was hoping to just use firefox to administer this website. But they use VBScript to do some of the work on the website. VBScript only works in Internet Explorer so I can’t use linux to use.

Now I know about ies4linux, and PlayOnLinux and stuff like this. But they suck and don’t work 90% of the time.

So this may be something beyond my brains ability to understand but, if you want to sell more product wouldn’t it make sense to use technologies that everyone can access? Why limit your demographic at all?

Maybe another way that open is ultimately better.

To the rescue

Monday, April 13th, 2009

Ok, the title might not be good on this one. But I recently redid one of our company websites. We wanted an event calendar. I thought about it and really, someone else must have on event calendar and made it open source. So after a little digging I have one that really fits my needs. It is called WebCalendar. From their about page: “WebCalendar is a PHP application used to maintain a calendar for a single user or an internet / intranet group of users. It can also be configured as an event calendar.”

It was really easy to set up. It was even easy to add my own custom CSS, Header and footer and have match the rest of my site.

Website for webcalendar: http://www.k5n.us/webcalendar.php
Website that I made with it: This will have to be updated. I am waiting on the official launch.

Links > Lynx

Thursday, December 18th, 2008

So, every once in a while a text based webbrowser is just neccessary. Since I don’t use it often I always forget the suggested one between lynk and links and I end up picking one at random. Tonight I decided to spent a little time with each and see which I really like better.

Both have similar keystrokes, and are both very easy to navigate. Lynx has a instructions at the bottom which may be nice if you don’t know what to do.

Lynx also will show you full links. So for instance, what may normally just say ‘New Post’ as a link, would show as http://blogspot.com/new/post/whatever/else/the/link/is.html. That can be nice if you really want to see it but it does make the page a little harder to read.

The kicker for me is that lynx will not do ssl. So no https for you. No logging into stuff. Just no. So, that made the decision easier. Links > Lynx.