I’m trying to devise a plugin system for a simple web app I’m developing.
Each plugin begins with the function call register_plugin that contains that plugins info, like name, description, etc.
I want to be able to set a mode, say, to 1, and then have the ability to include the plugin file, have it call the register_plugin, and then EXIT the included script only. I know that I can stop execution with a simple return;, however, the register_plugin function is located in a different file, a class, so I can’t simply call return because that will only end the function.
How can I do this?
Thanks.
As you already have outlined in your question, you would need to change the structure of your code and files to get this to work.
There is no magic kind of
returnthat would not leave the function but the file or that would leave the function, then the file.You need to re-arrange your code, add additional checks then to provide the functionality you’re looking for.