info.xml - Allow PSR-0 style class-loader declarations
Before
------
If an extension defines a class in the style of `CRM_Foo_Bar`, then it
*must* use `hook_civicrm_config` and modify the `include_path`.
```php
function mymod_civicrm_config(&$config = NULL) {
$extRoot = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$include_path = $extRoot . PATH_SEPARATOR . get_include_path();
set_include_path($include_path);
}
```
Consequently:
* The `include_path` gets rather long.
* Setting up the extension class-loader is not sufficient for loading these classes. You must
wait until the DB has initialized and the `hook_civicrm_config` has fired.
After
-----
An extension *may* setup classloading in `info.xml`, e.g.
```xml
<classloader>
<psr0 prefix="CRM_" path="" />
</classloader>
```
If the `<psr0>` style is used, then it is possible to scan the extension
classes without fully booting the extension. This is a pre-requisite for
using interfaces, annotations, or similar for event-registration.
Comments
--------
* This style closely parallels the `<psr4>` support in `info.xml`, and it parallels the semantics of `composer.json`.
* It is still valid for an extension to set `include_path` -- that works the same as ever.