Add a code library for use in multiple modules?
-
I have tow libraries of code for use in more than one module I want to develop. Can I create an add on module that makes the library available to other modules or do I have to add the code to every module?
Both libraries have a base bit of code to create autoloading for that library. Directory example contains example.php and sets up autoloading for the example directory. Every file in the directory is a class named example_* in file example_*.php.
The modules using the Example library would list the Example module as a prerequisite and need only a way to load example.php then all the classes in example would be autoloaded.
I just need a pointer to a module already doing this or a documentation page. I have experience creating WordPress modules. For this task, my Internet searches have not produced a starting point.
If sharing a library across modules is not legal, what is the recommended way to add the library unmodified so I can maintain the library in Github and just download the updated library direct into the module code as is?
You must be logged in to reply to this topic.