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 revision | Next revisionBoth sides next revision | ||
development:code_generators [2017/08/02 17:58] – demiankatz | development:code_generators [2018/02/07 20:53] – demiankatz | ||
---|---|---|---|
Line 59: | Line 59: | ||
</ | </ | ||
- | ===== Overriding Existing Plugins and Services ===== | + | ===== Overriding Existing Plugins and Services |
If you want to extend one of VuFind' | If you want to extend one of VuFind' | ||
+ | |||
+ | :!: Starting with VuFind 5.0, the ' | ||
==== Usage ==== | ==== Usage ==== | ||
Line 111: | Line 113: | ||
Saved file: / | Saved file: / | ||
Created backup: / | Created backup: / | ||
+ | Successfully updated / | ||
+ | </ | ||
+ | |||
+ | ===== Overriding Existing Plugins and Services (VuFind 5.0 and later) ===== | ||
+ | |||
+ | If you want to extend one of VuFind' | ||
+ | |||
+ | ==== Usage ==== | ||
+ | |||
+ | <code bash> | ||
+ | cd $VUFIND_HOME | ||
+ | php public/ | ||
+ | </ | ||
+ | |||
+ | * --extendfactory is a switch which will cause the existing factory method to be cloned into your local module. If you omit the switch, the existing factory will be used. :!: Using the existing factory only makes sense for factories that dynamically determine the name of the constructed object using the service name; however, a significant number of VuFind services use this type of factory starting in release 5.0. | ||
+ | * Fully\\Qualified\\ClassName is the name of the class you wish to extend/ | ||
+ | * MyModule is the name of your local module where you wish to create a new class. | ||
+ | |||
+ | ==== 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 wish to create a custom subclass of VuFind' | ||
+ | |||
+ | <code bash> | ||
+ | cd $VUFIND_HOME | ||
+ | php public/ | ||
+ | </ | ||
+ | |||
+ | The output should look something like this: | ||
+ | |||
+ | < | ||
+ | Saved file: / | ||
+ | Saved file: / | ||
+ | Saved file: / | ||
+ | Created backup: / | ||
+ | Successfully updated / | ||
Successfully updated / | Successfully updated / | ||
</ | </ |
development/code_generators.txt · Last modified: 2023/11/09 21:19 by demiankatz