One of the things that Habari does to make it a better development platform is implement "user overrides". If you look in your Habari directory, you'll see system and user directories, and inside each are directories named classes, plugins, and themes. The stuff in system is all core code required for the successful execution of Habari. You ought not fiddle with the contents of those directories. But what if you want to test a major change to one of the core Habari classes? Easy: copy the file from system/classes to user/classes and hack away -- Habari will use the copy of the file in your user/classes directory if it exists!
This makes it trivially easy to work on substantial changes to the core files without requiring you to maintain two separate copies of the code so that you can compare or revert between versions. You can override core classes, plugins, and themes using this feature. If you're testing an improvement to one of the core Habari themes, or one of the core Habari plugins, simply copy the whole thing into the appropriate directory inside your user directory and get to work!
Most blog tools -- Habari included -- strongly discourage you from making changes to the core system files. Not only is it possible to screw up your site through a simple coding mistake, it's a real pain to upgrade: you need to manually apply your changes to the upgraded version of the file. Another benefit of the user overridefeature of Habari is that local changes can be more elegantly preserved through an upgrade cycle. Rather than manually copy upgraded files from a Habari download into your production site, you can simply upgrade the entire system directory (or the entire Habari installation, if you're using Subversion), which leave your user directory untouched. You may still need to manually adjust the file in your user directory, but you'll have an easier time of doing so by comparing the pristine version from the system directory to your version of the file.
If you're doing any work with the Habari core code, I'm sure you'll find the user override functionality to be extremely helpful as you prepare and test patches. Even if you're not working on core Habari files, user overrides make it easier for you to keep Habari doing what you want it to do.
0 Responses to Habari Development: User Overrides
Leave a Reply