enhancement
avatar elkuku
elkuku
25 Oct 2012

I am playing around with an idea for an CMS extension autoloader.
The goal is to create a single function capable of loading the classes for every extension for both the admin and site application.

Since we are at a very early stage with our project, and have only two components so far in our "site" application, maybe we can implement it and see how it works.

The required changes would be to register the common autoloader instead of the specific autoloader for com_tracker, change the lookup for the view- and model classes inside the tracker default controller (or even better, create a common default controller) and - to prefix all the classes with a Com.

The "magic" function can be seen here: https://gist.github.com/3936393

The logic to name the classes would be:

  • ComFooModelBar to load
    • JROOT/components/com_foo/model/bar.php
  • ComAdminFooModelBar to load
    • JROOT/administrator/components/com_foo/model/bar.php

Same for modules, plugins and templates.

Thoughts ¿

avatar elkuku elkuku - open - 25 Oct 2012
avatar elkuku elkuku - open - 25 Oct 2012
avatar mbabker
mbabker - comment - 27 Oct 2012

Performance wise, is it any better or worse than using the Platform autoloader? I guess I've never really thought of autoloading across applications, but always though it'd be nice if certain files were always auto loaded (the plugin structure should really be the first to change to adapt to the Platform's autoloader, but good luck convincing the CMS to take it...).

I'll definitely be watching the mvc branch to see where things go. Seeing it in action a little more will probably help me think things through.

avatar elkuku
elkuku - comment - 29 Apr 2013

Should be covered by the namespacing stuff and composer autoloader introduced recently.

avatar elkuku elkuku - close - 29 Apr 2013
avatar - close - 29 Apr 2013

Add a Comment

Login with GitHub to post a comment