You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Nagy Attila (JIRA)" <ji...@apache.org> on 2008/11/06 09:53:44 UTC

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

Autoloader chain
----------------

                 Key: SHINDIG-678
                 URL: https://issues.apache.org/jira/browse/SHINDIG-678
             Project: Shindig
          Issue Type: Improvement
          Components: Common Components (PHP)
            Reporter: Nagy Attila
            Priority: Minor


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.


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

Posted by "Chris Chabot (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Chabot resolved SHINDIG-678.
----------------------------------

    Resolution: Fixed
      Assignee: Chris Chabot

Better late then never, right? :) I've added the autoloading chaining to svn trunk

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


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

Posted by "Nagy Attila (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nagy Attila updated SHINDIG-678:
--------------------------------

    Attachment:     (was: shindig_autoloader_chain.patch)

> Autoloader chain
> ----------------
>
>                 Key: SHINDIG-678
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-678
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Common Components (PHP)
>            Reporter: Nagy Attila
>            Priority: Minor
>         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.


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

Posted by "Paul Lindner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Lindner updated SHINDIG-678:
---------------------------------

    Fix Version/s:     (was: 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
>
>         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.


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

Posted by "Nagy Attila (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nagy Attila updated SHINDIG-678:
--------------------------------

    Attachment: shindig_autoloader_chain-tab.patch

Patch to allow specification of an extension autoloader function which will be called after shindig's autoloader fails.
This is the same as the previous attachment, but formatted according the new coding styles.

> Autoloader chain
> ----------------
>
>                 Key: SHINDIG-678
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-678
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Common Components (PHP)
>            Reporter: Nagy Attila
>            Priority: Minor
>         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.


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

Posted by "Ian Boston (JIRA)" <ji...@apache.org>.
     [ 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.


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

Posted by "Nagy Attila (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nagy Attila updated SHINDIG-678:
--------------------------------

    Attachment: shindig_autoloader_chain.patch

Patch to allow specification of an extension autoloader function which will be called after shindig's autoloader fails.

> Autoloader chain
> ----------------
>
>                 Key: SHINDIG-678
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-678
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Common Components (PHP)
>            Reporter: Nagy Attila
>            Priority: Minor
>         Attachments: shindig_autoloader_chain.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.


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

Posted by "Nagy Attila (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nagy Attila updated SHINDIG-678:
--------------------------------

        Fix Version/s: 1.0.x-incubating
                       1.0.0-rc1
                       trunk
    Affects Version/s: 1.0.x-incubating
                       1.0.0-rc1
                       trunk

> 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.0-rc1, 1.0.x-incubating
>            Reporter: Nagy Attila
>            Priority: Minor
>             Fix For: trunk, 1.0.0-rc1, 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.