Category Archives: zend_framework

The working environment

I’m an old guy, and I mostly use pretty old stuff, but occasionally I think I should migrate to more up to date tools. I’ve used svn for 20 years. I know I should have moved to git long ago. I have also been using Eclipse as an IDE since forever. I run on apache. My systems aren’t virtual. One of my main websites is still hand wrought in PHP, and another is using an ancient and obsolete version of zend framework which has been abandoned by Zend. I think of moving it, maybe to laravel, maybe even to ruby on rails.

This documents my effort to modernize, if only a little. This is a very uncomfortable process because there are times when I’m sure I’m going to foul up the running sites, and be unable to get them up, or that I’m not going to be able to fix the next bug that comes along.

Continue reading The working environment

Apache Configuration Issues

Trying to set up a new Zend Framework (ZF) website, I struggled once again with getting the setup correct. I learned some lessons, and this post is supposed to help me remember them.

First, the requirements.

1) ZF websites need rewrite rules to force all the urls through index.php so the can be picked apart. Also, ZF websites using the ZF config mechanisms need an APPLICATION_ENV php variable set somewhere in the site configuration, so the website can figure out where it is running and make hosting specific decisions (like, e.g. where the database will be, whether to turn on debugging, etc.).

2) I want to keep the website in a repository, and check it out onto different web-hostsĀ  for testing, development, production. So any configuration stuff which is web-host specific should not be in the repository but in the host configuration files.

3) Although the urls for the ZF website need to be rewritten to index.php, there may be other urls (like phpmyadmin) that should not be rewritten. So the configuration has to allow for this. In particular on some websites (like the website itself redirects non-logged in users to the blog (this blog) with a redirect to /blog/. The rules need to allow normal handling of this url (to select /blog/index.php) in the normal way.

The rewrite rules and application environment stuff can be put in an .htaccess file within the DocumentRoot. Most ZF documentation describes doing it this way. But for me, at least the application environment variable can’t be here because everything under DocumentRoot is in the repository. So I want APPLICATION_ENV oregano on one box, APPLICATION_ENV tarragon on another box, and if I put this in .htaccess, and .htaccess is in the repository the file can only have one or the other setting.
Continue reading Apache Configuration Issues

JQuery with Zend Framework

A couple of years ago I incorporated some jquery stuff, and some jquery-ui stuff into a website I had built on Zend Framework. At that time Zend Framework didn’t have its own support for jquery (or if it did, I didn’t know about it).

Now I’m working on a new site, and I find that there is now a jquery view helper to help do jquery stuff. It is located in the “extras” library. I also didn’t know about this library. When did this get added? Anyway, stumbling around on the net I discovered that there is now some jquery support in Zend Framework. Cool. So I set about learning how to use it.

I often find the documentation in the Programmers Reference in Zend Framework to be very cryptic and difficult. Probably this is because I am a very old programmer who learned the craft while dodging dinosaurs back in the stone age. I think people freshly learning to program today have a considerably different perspective (and probably vastly better). Sometimes I just have to go read the code. I had a devil of a time getting the jquery stuff to actually work. These notes maybe will help me the next time I have to do it. Continue reading JQuery with Zend Framework