Skip to content

pascalvb/eZ-ExtensionLoader

Repository files navigation

License: See, LICENSE
Installation: See, INSTALL

YMCExtensionLoader introduces a new order how to load ini-settings in eZ
publish. This has been a long time demand as you might see here:
http://issues.ez.no/IssueView.php?Id=2709

Besides a more consistent load-hierarchy YMCExtensionLoader adds support to
global override settings for a specific siteaccess which is useful
for local development.
Note that YMCExtensionLoader does not care much whether an extension is loaded
as "ActiveExtension" or "ActiveAccessExtension". The only thing is,
that an "ActiveExtension" is _tried_ to be loaded before an
"ActiveAccessExtension". It is recommended that you only use the
setting "ActiveExtension" to load an extension as long as you don't
experience problems with that.

Additionally YMCExtensionLoader allows loading of extensions inside any other
extension (so there is in fact no more need to use the
"ActiveAccessExtension"-setting which most likely has been
introduced in eZ publish to workaround this missing feature).

An other feature is, that PHP-autoloads using eZ components autoload
system are automatically supported, by simply putting a file 'autoload.php'
in an extensions subfolder 'autoload'. For this extension this is e.g.:
'extension/ymcextensionloader/autoload/autoload.php'
With this feature it is possible to define autoloads by extension, which is
much easier to handle than having a single autoload-file for all extensions.

----------------------------------------
Here is an example how the loader works:
----------------------------------------
Assume there are four extensions called "FIRST", "SECOND", "THIRD", and
"FOURTH". The extension "FIRST" is activated in "settings/site.ini" (or
in "settings/override/site.ini" if you e.g. just want to try out a new
extension), whether as "ActiveExtension" or "ActiveAccessExtension"
(which doesn't matter much, see above).  Inside the extension "FIRST"
(which now is active), the extension "SECOND" is activated in
"extension/FIRST/settings/site.ini" (again: it doesn't matter whether
as "ActiveExtension" or as "ActiveAccessExtension" - I won't repeat
this fact anymore!). This will make YMCExtensionLoader load the extension
"SECOND" now.
Now we assume that the extension "SECOND" has the extension "THIRD"
referenced in its "extension/SECOND/settings/site.ini" which makes
eZ Publish to load "THIRD" now. I assume you got it now and can imagine
what will happen if "FOURTH" is referenced in "THIRD"...
----------------------------------------

This is the hierarchy used to load settings in YMCExtensionLoader - note that
higher numbers are searched for settings first (first look/load in 8.
then in 7. then in ... 1.):
1. Default Settings (/settings)
2. In ActiveExtensions (extension/EXTENSION/settings)
3. In ActiveAccessExtensions (/extension/EXTENSION/settings)
4. Default Siteaccess-Settings (/settings/siteaccess)
5. Siteaccess in ActiveExtensions
                 (/extension/EXTENSION/settings/siteaccess/SITEACCESS)
6. Siteaccess in ActiveAccessExtensions
                 (/extension/EXTENSION/settings/siteaccess/SITEACCESS)
7. Global overrides (/settings/override)
8. Global siteaccess overrides (/settings/override/sitaccess/SITEACCESS)

Note that it is even possible to load an additional extension in the
siteaccess-settings of an already activated extension.
----------- Here is an example: ------------------
It's possible to activate the extension "FIFTH" for the siteaccess
"SITEACCESS" which has a site.ini in the already active extension
"FOURTH" (so we talking about this site.ini:
"extension/FOURTH/settings/siteacces/SITEACCESS/site.ini"). If you now
access "SITEACCESS", the extension "FOURTH" will be active. And if
"FOURTH" activates the extension "SIX", this one will be active, too.
-------------------------------------------------------------

Releases

No releases published

Packages

No packages published

Languages