Zend Framework

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

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.10.0
  • Fix Version/s: 1.11.0
  • Component/s: Zend_Tool
  • Labels:
    None

Description

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

Issue Links

Activity

Hide
Stefan Stubbe added a comment -

To provide some more information, my current setup:

/local/www/library/My
`-- Tool
    |-- HelloProvider.php
    `-- Manifest.php

My/Tool/Manifest.php:

<?php

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

My/Tool/HelloProvider.php

<?php

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/zf.sh say hello
Show
Stefan Stubbe added a comment - To provide some more information, my current setup:
/local/www/library/My
`-- Tool
    |-- HelloProvider.php
    `-- Manifest.php
My/Tool/Manifest.php:
<?php

class My_Tool_Manifest implements Zend_Tool_Framework_Manifest_ProviderManifestable
{
        public function getProviders()
        {
                return array(
                        new My_Tool_HelloProvider
                );
        }
}
My/Tool/HelloProvider.php
<?php

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/zf.sh say hello
Hide
Benjamin Eberlei added a comment -

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.

Show
Benjamin Eberlei added a comment - 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.
Hide
Stefan Stubbe added a comment -

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

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

Show
Stefan Stubbe added a comment - Adding the custom classes to my .zf.ini did the trick. The documentation however does not mention this and still talks about the IncludePathLoader
Hide
Guillermo Thiemann added a comment -

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?

Show
Guillermo Thiemann added a comment - 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?
Hide
James Stuart added a comment -

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.

Show
James Stuart added a comment - 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.
Hide
Ralph Schindler added a comment -

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

Show
Ralph Schindler added a comment - Fixed in r23201 in trunk & r23202 in release branch 1.11 (as part of ZF-9397)

People

Vote (3)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: