YMC Extension Loader
ymcExtensionLoader is an alternative concept for INI file handling in eZ Publish. It solves several known problems and also provides some enhancements that have been continuously discussed in the eZ Ecosystem
ymcExtensionLoader for eZ Publish
ymcExtensionLoader is an alternative concept for INI file handling in eZ Publish. It solves several known problems and also provides some enhancements that have been continuously discussed in the eZ Ecosystem. See for example:
To a standard eZ Publish, ymcExtensionLoader adds the following functionality:
- Support for global override settings, limited to a specific siteaccess (useful for local development).
- Nested extension loading: Extension can be loaded from any other extension. This makes the "ActiveAccessExtension?" setting dispensable.
- Support for PHP autoloads using the eZ Components autoload system, thus enabling autoloads by extension, rather than having a general autoload file for all extensions.
Notes and explanations
- ActiveExtensions are tried to be loaded before ActiveAccessExtensions. However, it makes no difference if an extension is defined for loading as Active Extension or ActiveAccessExtension. Using the ActiveExtension setting is recommended.
- PHP autoloads can be triggered from any extension by simply putting a file autoload.php into its autoload subfolder, e.g. extension/ymcextensionloader/autoload/autoload.php.
Assume three extensions called FIRST, SECOND, THIRD. The extension FIRST is activated in settings/site.ini (or in settings/override/site.ini if you just want to try out a new extension). Inside FIRST (which now is active), SECOND is activated in extension/FIRST/settings/site.ini. This will trigger loading SECOND. In its extension/SECOND/settings/site.ini THIRD can be specified for loading, and so on.
New loading hierarchy
When settings are loaded, ymcExtensionLoader looks for settings according to the following sequence (higher numbers first, so global siteaccess overrides have the highest priority):
- Default Settings (/settings)
- In ActiveExtensions? (extension/EXTENSION/settings)
- In ActiveAccessExtensions? (/extension/EXTENSION/settings)
- Default Siteaccess-Settings (/settings/siteaccess)
- Siteaccess in ActiveExtensions? (/extension/EXTENSION/settings/siteaccess/SITEACCESS)
- Siteaccess in ActiveAccessExtensions? (/extension/EXTENSION/settings/siteaccess/SITEACCESS)
- Global overrides (/settings/override)
- Global siteaccess overrides (/settings/override/sitaccess/SITEACCESS)
As stated above, it is also possible to load an additional extension via the siteaccess settings of an already activated extension.
YMC AG, Switzerland