Plugin Hacks
What are Plugin Hacks?
You all know what code hacks are - changes to the source code of an application, neccesary because of hard coded functions inside the application. While we'll try to do our best at avoiding bugs and hardcoded behavior we expect them to happen ; ). So, since the perfect world - where people are patient for bug fixes and new features - does not exist, we'll not be able to stop them from hacking/fixing the code we produce.
So we decided to actually ease the hacking of SpliceIt! plugins in a way that allows you to keep your hacks in a seperate place, far away from the original files. This has the advantages that updates can be done without fear of overwriting fixed bugs, as well as to costumize plugins for single apps.
How does this work in reality?
Let's assume a simple example. You have Blog Plugin and you are dying to have Tag support for it, even so the plugin itself has no functionality for this. This is how you would use a plugin Hack to solve (a part of) this problem:
Put a file called posts_controller_hack.php inside: app/plugin-hacks/blog/controllers and fill it with the following code:- class PostsControllerHack extends PostsController
- {
- function edit($id)
- {
- parent::edit($id);
- $this->set('AvailableTags', $this->TaggingApi->listTags());
- }
- }
When the PostsController of the Blog plugin is beeing loaded now, SpliceIt! will automatically use the PostsControllerHack class instead and thus your new tagging functionality.
- More stuff about Plugin Hacks needs to be written Todo.
Where to go now?
Now that you are familiar with SpliceIt! Plugin Hacks you might want to learn more about the types of SpliceIt! objects:
SpliceIt!-Documenation v0.1 ALPHA (generated on 28.03.2006)