Zendcasts Forum

A community of developers who work with the Zend Framework and other enterprise PHP technologies

You are not logged in.

#1 2010-04-17 21:24:39

Jon Lebensold
Administrator
Registered: 2009-06-27
Posts: 279

ZC53 – Integrating Zend_Tool Into Your Application

This screencast should help you setup Zend_Tool in your Zend Framework application. Zend_Tool is a command line entry point into your application. Currently, Zend_Tool is used to scaffold (build generic files) the Zend Framework project structure, modules, controllers, database table classes and other tedious processes. The goal of this video is to start looking at how we can generate our own Manifest and Provider classes so that custom command line tools can be integrated into the Zend Framework application.

The advantage of such integration is far reaching: deployable web applications using the Zend Framework can have "installers" and other frameworks, like Doctrine, can easily become first class citizens within the Zend Framework eco-system.


Grab a copy of the project or browse the repository.

Offline

#2 2010-04-18 10:28:14

Michal Lasak
New member
Registered: 2010-04-18
Posts: 1

Re: ZC53 – Integrating Zend_Tool Into Your Application

Very nice screencast, thank you!

The problem with autoloading your own provider is described in the comments, solution could be using basicloader.classes options.

Looking forward to next episode smile

Offline

#3 2010-04-21 22:37:17

jmelnick
New member
Registered: 2010-03-18
Posts: 1

Re: ZC53 – Integrating Zend_Tool Into Your Application

Hello Jon,

is it not:
autoloaderNamespaces[] = "ZC_"
rather than:
autoloaderNamespaces[] = "ZC" ?

the basicloader.classes config option will allow you to add each class by name.
ie:
basicloader.classes.1 = "ZC_Tool_VisitorProvider"
basicloader.classes.2 = "ZC_Tool_Other"

Great tutorial as always.

Joseph

Last edited by jmelnick (2010-04-21 22:43:49)

Offline

#4 2010-04-22 02:11:55

Jon Lebensold
Administrator
Registered: 2009-06-27
Posts: 279

Re: ZC53 – Integrating Zend_Tool Into Your Application

Thanks Joseph!

Offline

#5 2010-04-24 06:31:43

Jon Lebensold
Administrator
Registered: 2009-06-27
Posts: 279

Re: ZC53 – Integrating Zend_Tool Into Your Application

Hey Joseph, I just tried this and I'm still getting Fatal error: Class 'ZC_Tool_VisitorProvider' not found in /Users/jon/Sites/zc/library/ZC/Tool/Manifest.php on line 15

any other ideas on how I can remove the require_once statement?

Offline

#6 2010-04-27 21:12:25

maxbucknell
New member
Registered: 2010-04-27
Posts: 2

Re: ZC53 – Integrating Zend_Tool Into Your Application

No idea actually. I'm still a noob at this kind of thing. That's why I have a probably pretty simple question.

I am getting this error:

An Error Has Occurred
File "Max/Tool/Manifest.php" does not exist or class
"Max_Tool_Manifest" was not found in the file

I noticed that when I run './zf.sh show config, it returns:

conquistador:bin Max$ ./zf.sh show config
User Configuration: /Users/Max/.zf.ini
  `-- php
      `-- includepath: .:/usr/local/lib/php

'sup with that? Changing it doesn't make a difference either. And I don't know how to get the library directory into the include path, since I don't know where it's being set. Running Mac OSX 10.6 with a XAMPP stack.

Any help appreciated because this is slowly turning me grey.

Thanks in advance,
Max

Offline

#7 2010-04-28 11:37:59

Jon Lebensold
Administrator
Registered: 2009-06-27
Posts: 279

Re: ZC53 – Integrating Zend_Tool Into Your Application

Hi Max,

you can try registering the namespace in your bootstrap, or also using require_once in the Provider class. Also, do other zf zend_tool scripts run?

Offline

#8 2010-04-29 01:18:43

maxbucknell
New member
Registered: 2010-04-27
Posts: 2

Re: ZC53 – Integrating Zend_Tool Into Your Application

I fixed it big_smile I reinstalled my os (I had fiddled with one thing too many) and it miraculously fixed itself. How about it?

That autoloading problem is tricky though. . .

Offline

#9 2010-05-04 17:24:13

Arne
New member
Registered: 2010-05-04
Posts: 1

Re: ZC53 – Integrating Zend_Tool Into Your Application

zf --setup storage-directory

http://framework.zend.com/manual/en/zen … e.cli.html

Possible it helps?

Last edited by Arne (2010-05-04 17:24:27)

Offline

Board footer

Powered by FluxBB