Remove global functions from autoload class#1
Open
6dg wants to merge 5 commits intoOpenSRS:masterfrom
Open
Conversation
added 5 commits
September 27, 2013 10:13
Having global functions in openSRS_loaders prevents this library being used in other projects. Any project using this library / fork would now need to create a wrapper class around the processOpenSRSMethod and call the function through that. Functions that are required as part of the core library have been moved into openSRS_base + openSRS_fastlookup. There is a duplicate function now in both these classes which I didn't have time to resolve.
This should allow all the demos and tests to still function despite moving some of the global functions outside of the autoload script.
Includes the functions that were in the global namespace previously and calls the autoloader.
|
Wow this is nice. @OpenSRS you won't merge this in? Thanks for the pull request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request removes the global functions from the autoload class.
The allows the library to be used in a wider range of applications / libraries without risking collisions in function names.
Two functions have been moved into openSRS_base which most of the classes extends from.
The function convertArray2Formatted is currently duplicated into the openSRS_fastlookup.php class which I believe is the only place this is necessary.
I've updated all the tests/demos to use a wrapper around the autoloader so they still work with this pull request.
This allows the library to be used via composer accurately too.