Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Cannot redeclare Patchwork\redefine() #49
I guess the below question looks like a newbie PHP question. But I wanted to hear the solution from the developer of this great package.
I am developing a plugin for a CMS which uses Patchwork library. The CMS has another plugin using Patchwork.
Due to 2 declaration of same classes/functions, I am getting the fatal error as below.
If I have to re-declare all classes/function to a new namespace, what will be the best approach? Using function_exist method will help?
Indeed, you might want to surround your own
(Older versions used to have
However, I'll address this in Patchwork's code too, as this is a very general issue.
Also, I'm awfully sorry, but I couldn't quite understand the concern in your last paragraph, so there might still have been some miscommunication.
And thank you for the kind words :)
Checking for function does not help.
I still get the same error.
(My apologies again, I'd been working on a take-home assignment for a job interview for the past few days.)
I see that this might not work if the other copy of Patchwork is autoloaded at an unpredictable point in time. For now, I guess the only thing I can suggest is manually editing out the conflicting
As for your first response: running two copies of Patchwork simultaneously (if you really mean that) would be really difficult to accomplish. The preprocessing component (CodeManipulation) is the main obstacle here.