views:

89

answers:

1

I've got a project developed circa Zend Framework 1.7 that I'd like to migrate to Zend Tool and ZF 1.9.4pl1. The main benefit I hope to gain is to be able to use automatic loading of Models, Forms, etc. In other words, I want to eliminate all of these little methods:

protected function _getSurveyForm() { require_once APPLICATION_PATH . '/forms/Survey.php'; $form = new Form_Survey(); $form->setAction($this->_helper->url('survey')); return $form; }

My strategy was going to be this. First,

zf create project foo
zf create controller bar
zf create controller arf
etc.

until I managed to recreate the structure for all the controllers, views, etc. Second, I was going to copy in my existing controllers, views, models, etc., overwriting the stubs created by zf tool, and making sure that all my class names and file names lined up.

Is this the best way to go? Am I confused thinking that I'm going to be able to eliminate the little loader methods like _getSurveyForm() above?

+1  A: 

Well you can use directly the new Autoloader and just register your namespaces with it so it can autoload your classes, you don't need to create a new project layout.

Chris
I had tried registering my namespaces with the Autoloader in 1.8.x, but it seemed buggy... Maybe it's OK now. In any case, it seems cleaner to just use the Autoloader defaults rather than registering my own.Still, does my migration strategy make sense?
Jack Tanner
Indeed it is, so you can re-create the necessary XML files that Zend_Tool needs to keep adding actions and controllers.I would recommend using only the autoloader namespaces if you don't have the time to do the migration / testing to the new one.
Chris