I create own wordpress starter kit for plugins and themes.
I want use php namespaces in my projects (wp plugins and themes).
I set up spl_autoload_register
function:
All is well. Until I create 2 projects based on my starter-kit. In this case, I get an error Cannot redeclare class ...
.
All plugins and themes are in separate directories. And in each such folder there is my starter kit with spl_autoload_register
function.
My structure:
How do I avoid name conflicts?
And what can happen if someone else registers a function spl_autoload_register
?