Recent Topics

1 Apr 04, 2006 16:14    

I just bumped into an issue that could cause problems in the plugin system. I made a plugin that parses some xml using a class called XmlToArray. Now I'm working on a second plugin and I want to use that same class to parse some more xml, so I added it to the bottom of my plugin file in the same way as before:

class XmlToArray extends youtube_plugin


Then when I try to do anything in the backoffice, I get an error saying that a class has been redeclared. Now, I know that I can just rename one of the classes to keep from getting this error, but it's only a matter of time until two plugin developers end up choosing the same class name (or both use a pre-made class like I did) and then a user installs both plugins and suddenly their blog is broken.

I'm not sure what the answer is. Perhaps a naming scheme where any extending classes need to include the plugin name (e.g., youtube_XmlToArray).


Form is loading...