You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shindig.apache.org by "Ian Boston (JIRA)" <ji...@apache.org> on 2009/06/19 14:33:07 UTC

[jira] Updated: (SHINDIG-678) Autoloader chain

     [ https://issues.apache.org/jira/browse/SHINDIG-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ian Boston updated SHINDIG-678:
-------------------------------

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

> Autoloader chain
> ----------------
>
>                 Key: SHINDIG-678
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-678
>             Project: Shindig
>          Issue Type: Improvement
>          Components: PHP
>    Affects Versions: trunk, 1.0
>            Reporter: Nagy Attila
>            Priority: Minor
>             Fix For: trunk, 1.0.x-incubating
>
>         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.