I wanted to find out interest and get some feedback on an idea for a subversion plugin. I know many people would like to have certain elements (like snippets, templates, chunks...) under version control. Keeping a dump of the DB under version control just isn’t a good solution.
My idea is to create a plugin that automatically creates a file with the contents of an element when the element is saved. These files would be kept in a directory protected by an .htaccess file. When you open an element for editing, the plugin would update (and save) the content of the element from the file first. The plugin would also check all the files in the elements directory when logging in (maybe also logging out) of the manager, and update any elements from the files. This would make it easy to track changes with svn and collaborate. After an SVN update, just log out and log in, and all of the elements would be synced with the repository!
The proposed structure would be:
assets
elements
chunks
chunkname.htm
anotherchunk.htm
snippets
snippetname.php
templates
1.htm
2.htm
.htaccess
(templates saved by id, since that is how they are linked to documents)
I’d like to hear what others think and see how much interest there is in collaborating on this.
Some past discussions on this topic:
http://modxcms.com/forums/index.php/topic,7712.0.html
http://modxcms.com/forums/index.php/topic,22104.0.html