-
Notifications
You must be signed in to change notification settings - Fork 0
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
Make it easier to use OIK_autoload #132
Comments
I should have said where I'm doing this.
Once the library name has been constructed from the class name it uses I also added code to turn on this new logic, with a
Notes:
|
This doesn't appear to work.
|
I had to update the shared library loading to allow a plugin to request the |
Consider the options for making it easier to use
OIK_Autoload
functionality.The current implementation requires any plugin that wants its classes to be autoloaded to opt-in to OIK_Autoload.
Participating plugins must use code like this
When
oik_autoload()
is invoked it loads theOIK_Autoload
class which determines which classes can be autoloaded by invoking theoik_query_autoload_classes
filter function.Plugins respond to this by providing the class names to autoload, and where to find them.
OIK_Autoload then registers its autoloading logic to
spl_autoload_register
.The
OIK_Autoload::autoload
method locates the requested$class
and finds the file to load for the class.Each plugin has to provide a list of classes that can be autoloaded.
There's no composer like logic to provide the list.
In my newer code I've been using namespaces. In order for these classes to be loaded I have to provide the
plugin
,class
andfile
as the logic doesn't cater for the namespace.Considerations / questions
The text was updated successfully, but these errors were encountered: