Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Can a plugin be loaded from the config? #1107
A template can be specified in the config like this:
<phpdoc> <transformations> <template name="template/mytemplate" /> </transformations> </phpdoc>
This is very convenient because we can bundle a project-specific template with the project and run it against a central phpDocumentor installation (preferably keeping template names unique).
Can the same be done with plugins? As I understand, a plugin is just a class that implements
<phpdoc> <plugins> <plugin path="Plugin\Core\ServiceProvider" /> <plugin path="Plugin\Scrybe\ServiceProvider" /> <plugin path="Plugin\MyPlugin\ServiceProvider" /> </plugins> </phpdoc>
However, for this to work my plugin files first need to be registered with the autoloader.
Can I do this from the config? (Or - if it is not yet implemented - how is it going to be?)
Would relying on Composer's autoloader to use plugins require that end-users install phpdocumentor using Composer rather than the phar? Would it be difficult to support a path attribute that could reference either the path to a PHP script on disk or a fully qualifies path name that could be autoloaded via composer?
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
@mtdowling The latter issue that you are describing is a known issue with Zend_Config. I though I had worked around it but apparently did not for loading plugins. That needs to be fixed.
Regarding autoloading: I am considering adopting the way Sculpin (https://github.com/sculpin/sculpin) works; they have a composer.json-like file with which plugins/extensions are included (they actually use composer for that) and your suggestion is the second option if the first doesn't work out. (TBH: that is why there is no docs on plugins at current; this is still a concern)