[wp-hackers] Class conflicts with plugin frameworks

Jonathon Byrd jon at 5twentystudios.com
Wed Apr 27 22:45:04 UTC 2011

I've found that the simplest approach to MVC is the best. I have my mvc
functions included in a single file that I call bootstrap.php. All of the
functions within this class are wrapped in individual function_exist
statements. Also, there's no hard coded paths or names in any of the

For example my controller function reads in models from the models folder
and views from the views folder, but the only hard-coded path is the theme
path for over rides. So what I did is have each plugin preset its models and
views folders. That way the controller will actually look through all of the
plugins models and views files before returning the appropriate model or
view. I just prefix each model or view with a three char string like, twc-.

prefixing every function, constant and global with the same three chars
throughout each plugin has eliminated 99% of conflicts. total widget control
runs perfectly along side hundreds of installed plugins. Open up a copy of
total widget controls code and have a look at my bootstrap file, snag it out
if you want.


Jonathon Byrd | Partner | Senior Software Engineer
5 Twenty Studios, LLC

C: (360) 747-7401 | O: (503) 268-1177 | F: (954) 867-1177
jon at 5twentystudios.com | www.5TwentyStudios.com<http://www.5twentystudios.com/>

On Wed, Apr 27, 2011 at 3:37 PM, Philip Walton <philip at philipwalton.com>wrote:

> I'm in the beginning stages of writing a basic MVC plugin development
> framework, and I'm realizing I'm going to have a naming conflict issue. If I
> want to include this framework in several of the plugins and/or themes I'm
> developing, eventually I'm going to run into an issue that class_exists()
> isn't going to solve.
> I could create the framework as a stand-alone plugin, but that would
> require anyone who downloaded one of my plugins or themes to also download
> the framework, which doesn't seem realistic (especially for upgrades to
> existing plugins that don't have such a dependency currently).
> Anyway, I figured many of you out there have probably run into these same
> issues, and I wanted to see if anyone had developed a good strategy to
> manage the problem.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list