ZF-8899: Custom Zend_Tool_Framework_Provider classes are not found in include_path with ZendFramework-1.10


I'm following the manual for creating a custom Zend_Tool_Framework provider [1] in Zend Framework 1.10 (tested both beta1 and rc1) My custom provider is never found although my provider and manifest are in the include_path.

This seems to be because Zend_Tool_Framework_Client_Console is now forcing the use of the BasicLoader in Zend_Tool_Framework_Registry. Previous zf version (I checked both 1.9.7 and 1.9.6) defaulted to the IncludePathLoader.

I can't find a way to override this new behaviour


To provide some more information, my current setup:

`-- Tool
    |-- HelloProvider.php
    `-- Manifest.php



class My_Tool_Manifest implements Zend_Tool_Framework_Manifest_ProviderManifestable
        public function getProviders()
                return array(
                        new My_Tool_HelloProvider



class My_Tool_HelloProvider implements Zend_Tool_Framework_Provider_Interface
        public function say()
                echo 'Hello from my provider!', PHP_EOL;

Command I am using:

/home/yahiko $ cd /local/www/library
/local/www/library $ ZEND_TOOL_INCLUDE_PATH=$(pwd) /local/www/library/ZendFramework-1.10.0rc1-minimal/bin/ say hello

The include path loader has been replaced with the basic loader.

You have to hook custom classes into Zend Tool by adding the following line to your .zf.ini:

basicloader.classes.0 = "My_ClassName"
basicloader.classes.1 = "My_Manifest"

Or you use the command:

benny@benny-pc:~$ zf enable config.?
Zend Framework Command Line Console Tool v1.10.0alpha
Details for action "Enable" and provider "Config"
    zf enable config.manifest class-name
    zf enable config.provider class-name

This does the same.

Adding the custom classes to my .zf.ini did the trick.

The documentation however does not mention this and still talks about the IncludePathLoader

I would say that the environment-level configuration .zf.ini is a bad location to put custom providers anyway.

What if I have project-specific Providers and more than one Project running in one server?

I agree. Causing Zend Tool extensions to be loaded globally (per user) significantly diminishes their usefulness for project based tasks.

We have many developers, each with multiple workstations, working on many projects. Having your configuration based on the user account (and workstation) that you're using and not the application that you're working on is a hurdle that will prevent us from using Zend Tool at all.

On the server side, our hosting setup causes us to have many applications on the same server running as the same user. We obviously cannot use the same configuration for each application, so the environment-level configuration doesn't work here either.

Fixed in r23201 in trunk & r23202 in release branch 1.11 (as part of ZF-9397)