I'm working on a plugin system for my CMS, inside my CMS I use namespaces a lot.
What I would like to have is that the developers of the plugins don't have to use namespaces inside their plugin, because they can be very complicated for developers who doesn't have used namespaces before. The main problem with the namespaces is the events which can be registered. Right now, plugin developers have to load an Event class using use \events\Event;
, and if they just import the class they are still not able to use new Event();
because it uses namespaces. What I would like to have is that they can just use new Event();
(The class itself would be autoloaded by the CMS's auto loader, so no include required).
So basically, I would like to have namespaces disabled in certain classes or files. So new \events\Event();
will just look like new Event();
without removing the namespace events;
from the Event
class.
I hope I explained it clear, I'm not the best in explaining this kind of stuff.