MyBB Community Forums

Full Version: How to put template code under version control?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,

I keep my MyBB code under version control, as I am developing a large plugin at the moment. As you may know, MyBB stores part of its code in database tables. This includes the templates and the style sheets.

For this reason, the code in the templates is not under version control (the CSS is can be under semi version control, since it gets cached into css files).

Does anyone know a means by which it could be put under version control? Perhaps some kind of scripting or something? Does anyone else already do this?

Cheers!
What exactly do you mean by "version control"? Templates have in-built version field that's mainly utilized by MyBB upgrades, but e.g PluginLibrary makes management much easier: http://community.mybb.com/thread-87399.html
(2016-03-02, 11:34 PM)Destroy666 Wrote: [ -> ]What exactly do you mean by "version control"? Templates have in-built version field that's mainly utilized by MyBB upgrades, but e.g PluginLibrary makes management much easier: http://community.mybb.com/thread-87399.html

Version control is where you use software to keep track of changes in code, each change being a 'version'. Examples are Git and SVN.

Since I'm doing a large modification, it doesn't make sense to constantly edit template inserter functions and then do plugin activate/deactivates to push that into the templates.

Hence the solution I came up with is simply to do a table export (using phpMyAdmin) on mybb_templates and mybb_themestylesheets, into csv, and then save that as a file somewhere in my MyBB source tree (which is under Git version control). That way if I ever need to diff or roll things back, I have prior versions of templates under version control.