Zend Framework

Allows to register plugins with Zend_App via configuration

Details

  • Type: Docs:  Improvement Docs: Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Zend_Application
  • Labels:
    None

Description

Its impossible to extend Zend_Application with additional plugin loader paths or plugins from configuration.

You would have to change the code that initializes Zend_Application to mainipulate the PluginLoader.

However for re-use you dont always wan't to use the "_init<Resource>" syntax, but add your own classes.

I propose to add a new options namespace:

bootstrap.pluginloader.doctrine2.prefix = "Zend_Doctrine2_Application_Resource_"
bootstrap.pluginloader.doctrine2.path = "Zend/Doctrine2/Application/Resource"

Inside Zend_Application then one would add the additional paths to the plugin loader bootstrap.

Activity

Hide
Matthew Weier O'Phinney added a comment -

Actually, you can provide additional bootstrap resource plugin paths:

pluginpaths.Zend_Doctrine2_Application_Resource = "Zend/Doctrine2/Application/Resource"

Does this not work for you?

Show
Matthew Weier O'Phinney added a comment - Actually, you can provide additional bootstrap resource plugin paths:
pluginpaths.Zend_Doctrine2_Application_Resource = "Zend/Doctrine2/Application/Resource"
Does this not work for you?
Hide
Benjamin Eberlei added a comment -

Ah nice,

this is not documented, and i havent found it in the code

Show
Benjamin Eberlei added a comment - Ah nice, this is not documented, and i havent found it in the code
Hide
Benjamin Eberlei added a comment -

Changed to docs improvement category.

Show
Benjamin Eberlei added a comment - Changed to docs improvement category.
Hide
Wil Moore III (wilmoore) added a comment -

This doesn't seem to work with namespaced (PHP 5.3) classes. I could be missing something but I have tried the following:

pluginPaths.core\bootstrap\resource = SOURCE_PATH "/library/core/bootstrap/resource"

<?php

namespace core\bootstrap\resource;
use \Zend_Application_Resource_ResourceAbstract as AbstractResource;

class Whatever extends AbstractResource {}

Show
Wil Moore III (wilmoore) added a comment - This doesn't seem to work with namespaced (PHP 5.3) classes. I could be missing something but I have tried the following: pluginPaths.core\bootstrap\resource = SOURCE_PATH "/library/core/bootstrap/resource" <?php namespace core\bootstrap\resource; use \Zend_Application_Resource_ResourceAbstract as AbstractResource; class Whatever extends AbstractResource {}
Hide
Wil Moore III (wilmoore) added a comment -

So, as I suspected...I was doing something wrong.

this:
pluginPaths.core\bootstrap\resource = SOURCE_PATH "/library/core/bootstrap/resource"

should be (ending backslash):
pluginPaths.core\bootstrap\resource\ = SOURCE_PATH "/library/core/bootstrap/resource"

Show
Wil Moore III (wilmoore) added a comment - So, as I suspected...I was doing something wrong. this: pluginPaths.core\bootstrap\resource = SOURCE_PATH "/library/core/bootstrap/resource" should be (ending backslash): pluginPaths.core\bootstrap\resource\ = SOURCE_PATH "/library/core/bootstrap/resource"
Hide
Marco Kaiser added a comment -

pluginPaths.Zend_Doctrine2_Application_Resource = "Zend/Doctrine2/Application/Resource"

works perfectly

Show
Marco Kaiser added a comment - pluginPaths.Zend_Doctrine2_Application_Resource = "Zend/Doctrine2/Application/Resource" works perfectly

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: