{"id":818,"date":"2012-10-30T00:39:07","date_gmt":"2012-10-29T23:39:07","guid":{"rendered":"http:\/\/blog.soton.ac.uk\/oneshare\/?p=818"},"modified":"2012-10-30T05:59:00","modified_gmt":"2012-10-30T04:59:00","slug":"redfeather-plugins-learning","status":"publish","type":"post","link":"https:\/\/blog.soton.ac.uk\/oneshare\/2012\/10\/30\/redfeather-plugins-learning\/","title":{"rendered":"Learning from existing plugin systems"},"content":{"rendered":"<p>One of the other defining characteristics of RedFeather is the fact that the core implementation comprises of a single PHP file. \u00a0Despite this, it still provides a highly extensible architecture capable of being customised and tweaked to suit different situations. \u00a0Plugins can be written to add new fields to the workflow, introduce new pages and functionality, or change the site&#8217;s appearance. \u00a0While the concept is nothing new, writing such an architecture while still maintaining the desired simplicity of RedFeather presents a distinct challenge. \u00a0By looking at existing implementations of plugin environments it is easy to appreciate the potential complexity of such a system and identify ways to simplify.<\/p>\n<p>The first architectural style I analysed was the &#8216;hook system&#8217; of plugin management, as used in both WordPress and MediaWiki. \u00a0In these programs, each plugin is associated with a special point within the code, known as a &#8216;hook&#8217;. \u00a0Each hook corresponds to a different point in either the execution of the code (for adding additional processing), or a point in the rendering a page (for adding content). \u00a0The advantage of this system is that is allows for the greatest possible flexibility while still maintaining complete control over how and where the program can be extended.<\/p>\n<p>As you might expect, the code overhead associated with this system is considerable and would turn RedFeather into an unreadable mess of complexity. \u00a0Framework code would need to be written to support the processing of plugins in general, then additional code to handle each category of hook. Furthermore, every page and feature in the system needs to be written in a specific way to support the plugin environment.<\/p>\n<p>The EPrints platform utilises an entirely different system which relies largely on\u00a0inheritance. \u00a0Writing a new feature is done by creating a subclass of an existing one and adjusting the functionality as required. \u00a0Plugins are loaded automatically on server startup and configured using additional scripts within the cfg.d directory. \u00a0The main advantage of this system is that it is possible to entirely rewrite or extend any part of the platform, although a larger understanding of the core EPrints code.<\/p>\n<p>In the interest of keeping these blog posts readable I shall continue this topic in my next post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the other defining characteristics of RedFeather is the fact that the core implementation comprises of a single PHP file. \u00a0Despite this, it still provides a highly extensible architecture capable of being customised and tweaked to suit different situations. &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/blog.soton.ac.uk\/oneshare\/2012\/10\/30\/redfeather-plugins-learning\/\"> <span class=\"screen-reader-text\">Learning from existing plugin systems<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":109,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15431],"tags":[15415,15444,15437,15416],"class_list":["post-818","post","type-post","status-publish","format-standard","hentry","category-redfeather-2","tag-redfeather","tag-lessonslearnt","tag-oerri","tag-ukoer"],"_links":{"self":[{"href":"https:\/\/blog.soton.ac.uk\/oneshare\/wp-json\/wp\/v2\/posts\/818","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.soton.ac.uk\/oneshare\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.soton.ac.uk\/oneshare\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/oneshare\/wp-json\/wp\/v2\/users\/109"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/oneshare\/wp-json\/wp\/v2\/comments?post=818"}],"version-history":[{"count":10,"href":"https:\/\/blog.soton.ac.uk\/oneshare\/wp-json\/wp\/v2\/posts\/818\/revisions"}],"predecessor-version":[{"id":855,"href":"https:\/\/blog.soton.ac.uk\/oneshare\/wp-json\/wp\/v2\/posts\/818\/revisions\/855"}],"wp:attachment":[{"href":"https:\/\/blog.soton.ac.uk\/oneshare\/wp-json\/wp\/v2\/media?parent=818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/oneshare\/wp-json\/wp\/v2\/categories?post=818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/oneshare\/wp-json\/wp\/v2\/tags?post=818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}