Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove global functions from autoload class #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

6dg
Copy link

@6dg 6dg commented Sep 27, 2013

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.

Alan Hollis 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.
@huglester
Copy link

Wow this is nice. @OpenSRS you won't merge this in?

Thanks for the pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants