shindig-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Lindner (JIRA)" <>
Subject [jira] Updated: (SHINDIG-678) Autoloader chain
Date Mon, 13 Jul 2009 22:03:14 GMT


Paul Lindner updated SHINDIG-678:

    Fix Version/s:     (was: 1.0.x-incubating)

> Autoloader chain
> ----------------
>                 Key: SHINDIG-678
>                 URL:
>             Project: Shindig
>          Issue Type: Improvement
>          Components: PHP
>    Affects Versions: trunk, 1.0
>            Reporter: Nagy Attila
>            Priority: Minor
>             Fix For: trunk
>         Attachments: shindig_autoloader_chain-tab.patch
> During integrating shindig with a more complex container it would be nice to be possible
to use the container's autoloader also. Unfortunately php allows only one __autoload method
to exists, so it should function as a chain: if one does not find the class, then calls the
second one.
> As a starting point I've attached my solution on this: I've modified Shindig's autoloader
so that if the class is not found then it will check the 'extension_autoloader' configuration
parameter, and if a function named like this exists it will call it. This way I could hook
up our fairly different autoloader, and Service classes are able to call the container's controller
classes directly.
> Yet there are still a few questions to think about:
>  - should this chain be located before, or after shindig autoloader? If it's before,
it may break shindig, if two classes of the same name exists. If it's behind, many unnecessary
file_exists() are performed, what is generally not a good idea.
>  - where should one place his autoloader function? It should be accessible from the autoload
method, so can't be loaded through the autoloader. This could be elliminated if the chained
autoloader should be a class method, so that it could be loaded through the autloader. Now
I just placed my function into config/local.php, what works fine also.
>  - is this configuration parameter ok?

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message