<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Extensible PHP software: Hooks &amp; patches</title>
	<atom:link href="http://www.jamierf.co.uk/2010/02/08/extensible-php-software-hooks-patches/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jamierf.co.uk/2010/02/08/extensible-php-software-hooks-patches/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 21 Oct 2011 04:46:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Matt</title>
		<link>http://www.jamierf.co.uk/2010/02/08/extensible-php-software-hooks-patches/comment-page-1/#comment-1451</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Fri, 03 Dec 2010 21:04:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.jamierf.co.uk/?p=321#comment-1451</guid>
		<description>Dredging this topic up again, but what about not actually making any alterations to existing code for plugins, but rather make it so that each plugin is a separate entity completely? Install it and it takes precedence, remove it and the original is used. Granted, there would be code repetition in the plugin. but no hooks or suchlike would be needed. The template system would have an inbuilt method for adding extra fields in the page output, so that would take care of any minor additions to output necessary.

For example, if there was a default directory where scripts are located for each valid requested page. When that page is requested, the respectively named file is required/included. There&#039;s also a plugin directory too which is scanned first, however. If a file is found in that directory matching the requested page name, that takes precedence over the default file. In theory, it&#039;s more like a modular approach than plugins per se, but it seems possibly the least hassle method for including additional functionality without bloating the code with hooks, or requiring users to alter the core code. Other than adding entries to the DB if necessary, it could be a completely isolated addition.

Just a thought.</description>
		<content:encoded><![CDATA[<p>Dredging this topic up again, but what about not actually making any alterations to existing code for plugins, but rather make it so that each plugin is a separate entity completely? Install it and it takes precedence, remove it and the original is used. Granted, there would be code repetition in the plugin. but no hooks or suchlike would be needed. The template system would have an inbuilt method for adding extra fields in the page output, so that would take care of any minor additions to output necessary.</p>
<p>For example, if there was a default directory where scripts are located for each valid requested page. When that page is requested, the respectively named file is required/included. There&#8217;s also a plugin directory too which is scanned first, however. If a file is found in that directory matching the requested page name, that takes precedence over the default file. In theory, it&#8217;s more like a modular approach than plugins per se, but it seems possibly the least hassle method for including additional functionality without bloating the code with hooks, or requiring users to alter the core code. Other than adding entries to the DB if necessary, it could be a completely isolated addition.</p>
<p>Just a thought.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Franz</title>
		<link>http://www.jamierf.co.uk/2010/02/08/extensible-php-software-hooks-patches/comment-page-1/#comment-1036</link>
		<dc:creator>Franz</dc:creator>
		<pubDate>Tue, 18 May 2010 13:39:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.jamierf.co.uk/?p=321#comment-1036</guid>
		<description>I actually grew to like Frank&#039;s idea (http://61924.nl/blog/e/00034-extending-php-software.html) now. In a way, it is the back-to-the-roots way, combining mods with auto-installation and hooks and probably the best solution when talking about performance. It is also safer than pure patching...</description>
		<content:encoded><![CDATA[<p>I actually grew to like Frank&#8217;s idea (<a href="http://61924.nl/blog/e/00034-extending-php-software.html" >http://61924.nl/blog/e/00034-extending-php-software.html</a>) now. In a way, it is the back-to-the-roots way, combining mods with auto-installation and hooks and probably the best solution when talking about performance. It is also safer than pure patching&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.jamierf.co.uk/2010/02/08/extensible-php-software-hooks-patches/comment-page-1/#comment-1025</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Sat, 08 May 2010 02:47:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.jamierf.co.uk/?p=321#comment-1025</guid>
		<description>Personally, I see extensions as providing additional functionality outside of the core classes, (extending only), hence overriding a core function shouldn&#039;t be a consideration. However, if that behaviour is desired in certain places, add hooks where appropriate in the base class functions and let the hooks take precedence over the core functions, or add the ability for external classes to be loaded inplace of the base classes. There are so many different ways to approach each and every possibility, (without going the &#039;pure OO&#039; path and throwing 10x the amount of code needed at everything). Simple approach logic and variation seem to take a backseat when people start thinking about OOP, in my opinion.</description>
		<content:encoded><![CDATA[<p>Personally, I see extensions as providing additional functionality outside of the core classes, (extending only), hence overriding a core function shouldn&#8217;t be a consideration. However, if that behaviour is desired in certain places, add hooks where appropriate in the base class functions and let the hooks take precedence over the core functions, or add the ability for external classes to be loaded inplace of the base classes. There are so many different ways to approach each and every possibility, (without going the &#8216;pure OO&#8217; path and throwing 10x the amount of code needed at everything). Simple approach logic and variation seem to take a backseat when people start thinking about OOP, in my opinion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Franz</title>
		<link>http://www.jamierf.co.uk/2010/02/08/extensible-php-software-hooks-patches/comment-page-1/#comment-1024</link>
		<dc:creator>Franz</dc:creator>
		<pubDate>Fri, 07 May 2010 22:07:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.jamierf.co.uk/?p=321#comment-1024</guid>
		<description>Well, how exactly would you imagine an extension overriding some core base class and another extension wanting to do the same? (O.k., it just appeared to me that this might be possible with a hook in __call()...)</description>
		<content:encoded><![CDATA[<p>Well, how exactly would you imagine an extension overriding some core base class and another extension wanting to do the same? (O.k., it just appeared to me that this might be possible with a hook in __call()&#8230;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.jamierf.co.uk/2010/02/08/extensible-php-software-hooks-patches/comment-page-1/#comment-1023</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Fri, 07 May 2010 20:50:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.jamierf.co.uk/?p=321#comment-1023</guid>
		<description>Personally, (I must be thinking along different lines from yourself regarding how extensions would work), I can&#039;t see much of a problem whichever way it&#039;s done. As to what the correct OO approach is, that&#039;s a subjective point. Each will have their own opinion on what constitutes the correct or best method. Simplest is always best, IMHO, whichever that may be.</description>
		<content:encoded><![CDATA[<p>Personally, (I must be thinking along different lines from yourself regarding how extensions would work), I can&#8217;t see much of a problem whichever way it&#8217;s done. As to what the correct OO approach is, that&#8217;s a subjective point. Each will have their own opinion on what constitutes the correct or best method. Simplest is always best, IMHO, whichever that may be.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Franz</title>
		<link>http://www.jamierf.co.uk/2010/02/08/extensible-php-software-hooks-patches/comment-page-1/#comment-1022</link>
		<dc:creator>Franz</dc:creator>
		<pubDate>Fri, 07 May 2010 19:42:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.jamierf.co.uk/?p=321#comment-1022</guid>
		<description>Well, I don&#039;t see how that would work with multiple extensions. You can&#039;t just extend a class with multiple classes or extend an unknown (dynamic) class...

I guess the way a complete OO approach would go would not be via subclasses (at least in most cases), but rather through stuff like the patterns mentioned in my last comment. I should take a look at it. Lacking the time though ;)</description>
		<content:encoded><![CDATA[<p>Well, I don&#8217;t see how that would work with multiple extensions. You can&#8217;t just extend a class with multiple classes or extend an unknown (dynamic) class&#8230;</p>
<p>I guess the way a complete OO approach would go would not be via subclasses (at least in most cases), but rather through stuff like the patterns mentioned in my last comment. I should take a look at it. Lacking the time though <img src='http://www.jamierf.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.jamierf.co.uk/2010/02/08/extensible-php-software-hooks-patches/comment-page-1/#comment-1020</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Fri, 07 May 2010 15:54:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.jamierf.co.uk/?p=321#comment-1020</guid>
		<description>Nice to see you&#039;re still keeping an eye on things Rickard. :)

Franz, I might have missed your point somewhat, but either straight functions or just extending the respective core class with an extension class would both work fine, (in theory)?</description>
		<content:encoded><![CDATA[<p>Nice to see you&#8217;re still keeping an eye on things Rickard. <img src='http://www.jamierf.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Franz, I might have missed your point somewhat, but either straight functions or just extending the respective core class with an extension class would both work fine, (in theory)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Franz</title>
		<link>http://www.jamierf.co.uk/2010/02/08/extensible-php-software-hooks-patches/comment-page-1/#comment-1015</link>
		<dc:creator>Franz</dc:creator>
		<pubDate>Thu, 06 May 2010 11:25:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.jamierf.co.uk/?p=321#comment-1015</guid>
		<description>I&#039;ve always wondered how exactly a strict-OO approach would work with multiple extensions. Obviously every extension class would overwrite some base class and not just the last extension class. Thus, it seems, it would not be possible to extend a class with multiple extensions (except for something like decorator or command patterns probably). How would that be done?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve always wondered how exactly a strict-OO approach would work with multiple extensions. Obviously every extension class would overwrite some base class and not just the last extension class. Thus, it seems, it would not be possible to extend a class with multiple extensions (except for something like decorator or command patterns probably). How would that be done?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: damaxxed</title>
		<link>http://www.jamierf.co.uk/2010/02/08/extensible-php-software-hooks-patches/comment-page-1/#comment-1013</link>
		<dc:creator>damaxxed</dc:creator>
		<pubDate>Wed, 05 May 2010 22:25:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.jamierf.co.uk/?p=321#comment-1013</guid>
		<description>I like the idea with the special function calls best:
* a whole extension is stored in one file without any xml or db usage
* saving the registered function calls in an array allows on-the-fly disabling of some hooks and extensions
* dynamic function calls with $name($parameter) have a good performance according to http://weierophinney.net/matthew/archives/121-Benchmarking-dynamic-functionmethod-calls.html</description>
		<content:encoded><![CDATA[<p>I like the idea with the special function calls best:<br />
* a whole extension is stored in one file without any xml or db usage<br />
* saving the registered function calls in an array allows on-the-fly disabling of some hooks and extensions<br />
* dynamic function calls with $name($parameter) have a good performance according to <a href="http://weierophinney.net/matthew/archives/121-Benchmarking-dynamic-functionmethod-calls.html" >http://weierophinney.net/matthew/archives/121-Benchmarking-dynamic-functionmethod-calls.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: google.com/accounts/o8&#8230;</title>
		<link>http://www.jamierf.co.uk/2010/02/08/extensible-php-software-hooks-patches/comment-page-1/#comment-1003</link>
		<dc:creator>google.com/accounts/o8&#8230;</dc:creator>
		<pubDate>Thu, 22 Apr 2010 07:22:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.jamierf.co.uk/?p=321#comment-1003</guid>
		<description>I&#039;m Rickard by the way, not google.com/accounts/o8… :)</description>
		<content:encoded><![CDATA[<p>I&#8217;m Rickard by the way, not google.com/accounts/o8… <img src='http://www.jamierf.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

