Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:code_generators
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
development:code_generators [2018/02/07 20:53] – demiankatz | development:code_generators [2018/10/24 15:27] – [Usage] demiankatz | ||
---|---|---|---|
Line 154: | Line 154: | ||
Successfully updated / | Successfully updated / | ||
Successfully updated / | Successfully updated / | ||
+ | </ | ||
+ | |||
+ | ===== Creating New Plugins ===== | ||
+ | |||
+ | :!: This feature was introduced in VuFind 5.1. | ||
+ | |||
+ | If you want to create a new [[development: | ||
+ | |||
+ | ==== Usage ==== | ||
+ | |||
+ | <code bash> | ||
+ | cd $VUFIND_HOME | ||
+ | php public/ | ||
+ | </ | ||
+ | |||
+ | * MyModule\\PluginType\\PluginName is the name of the class you wish to create. The generator will use the first part of the class name to determine which module it belongs in (since modules correspond to namespaces); | ||
+ | * [optional factory name] may be included to specify the name of an existing factory that should be used to construct your plugin. For example, if your class will not have any dependencies, | ||
+ | |||
+ | ==== Notes ==== | ||
+ | :!: Be sure that MyModule already exists and is included in your VUFIND_LOCAL_MODULES environment variable, or the generator may not work correctly. If MyModule does not yet exist, you can re-run VuFind' | ||
+ | |||
+ | :!: If things don't work right away after generating code, you may need to clear your local/cache directory to get rid of outdated configurations. | ||
+ | |||
+ | ==== Example ==== | ||
+ | |||
+ | Suppose you want to create a new ILS driver for your home-grown system. You could begin like this: | ||
+ | |||
+ | <code bash> | ||
+ | cd $VUFIND_HOME | ||
+ | php public/ | ||
+ | </ | ||
+ | |||
+ | The output should look something like this: | ||
+ | |||
+ | < | ||
+ | Saved file: / | ||
+ | Saved file: / | ||
+ | Created backup: / | ||
+ | Successfully updated / | ||
+ | Successfully updated / | ||
</ | </ | ||
---- struct data ---- | ---- struct data ---- | ||
---- | ---- | ||
development/code_generators.txt · Last modified: 2023/11/09 21:19 by demiankatz