Re: [PHP] What's the best way to make a dynamic plugin architecture?

2012-08-31 Thread Mark
On Tue, Aug 28, 2012 at 1:43 PM, Matijn Woudt wrote: > On Tue, Aug 28, 2012 at 1:16 AM, Larry Garfield > wrote: >> On 8/27/12 6:11 PM, Matijn Woudt wrote: >> You should never be calling require() yourself. Just follow the PSR-0 naming standard and use an autoloader, then you don't hav

Re: [PHP] What's the best way to make a dynamic plugin architecture?

2012-08-28 Thread Matijn Woudt
On Tue, Aug 28, 2012 at 1:16 AM, Larry Garfield wrote: > On 8/27/12 6:11 PM, Matijn Woudt wrote: > >>> You should never be calling require() yourself. Just follow the PSR-0 >>> naming standard and use an autoloader, then you don't have to even think >>> about it. There are many existing autoload

Re: [PHP] What's the best way to make a dynamic plugin architecture?

2012-08-27 Thread Larry Garfield
On 8/27/12 6:11 PM, Matijn Woudt wrote: You should never be calling require() yourself. Just follow the PSR-0 naming standard and use an autoloader, then you don't have to even think about it. There are many existing autoloaders you can use, including Composer's, Symfony2's, and probably Zend

Re: [PHP] What's the best way to make a dynamic plugin architecture?

2012-08-27 Thread Matijn Woudt
On Tue, Aug 28, 2012 at 12:58 AM, Larry Garfield wrote: > On 8/27/12 4:09 PM, Mark wrote: >> >> On Mon, Aug 27, 2012 at 4:26 PM, Stuart Dallas wrote: > > 2. Let the plugin itself (so in this case PluginOne.php) open itself and register it to the PluginLoader. W

Re: [PHP] What's the best way to make a dynamic plugin architecture?

2012-08-27 Thread Larry Garfield
On 8/27/12 4:09 PM, Mark wrote: On Mon, Aug 27, 2012 at 4:26 PM, Stuart Dallas wrote: 2. Let the plugin itself (so in this case PluginOne.php) open itself and register it to the PluginLoader. With the first option i have to do eval which i try to avoid if possible. With the second solution t

Re: [PHP] What's the best way to make a dynamic plugin architecture?

2012-08-27 Thread Mark
On Mon, Aug 27, 2012 at 4:26 PM, Stuart Dallas wrote: > On 27 Aug 2012, at 14:52, Mark wrote: > >> On Mon, Aug 27, 2012 at 3:46 PM, Stuart Dallas wrote: >>> On 27 Aug 2012, at 14:29, Mark wrote: >>> On Mon, Aug 27, 2012 at 12:41 PM, Stuart Dallas wrote: > On 26 Aug 2012, at 19:42, Mar

Re: [PHP] What's the best way to make a dynamic plugin architecture?

2012-08-27 Thread Stuart Dallas
On 27 Aug 2012, at 14:52, Mark wrote: > On Mon, Aug 27, 2012 at 3:46 PM, Stuart Dallas wrote: >> On 27 Aug 2012, at 14:29, Mark wrote: >> >>> On Mon, Aug 27, 2012 at 12:41 PM, Stuart Dallas wrote: On 26 Aug 2012, at 19:42, Mark wrote: > 2. Let the plugin itself (so in this cas

Re: [PHP] What's the best way to make a dynamic plugin architecture?

2012-08-27 Thread Mark
On Mon, Aug 27, 2012 at 3:46 PM, Stuart Dallas wrote: > On 27 Aug 2012, at 14:29, Mark wrote: > >> On Mon, Aug 27, 2012 at 12:41 PM, Stuart Dallas wrote: >>> On 26 Aug 2012, at 19:42, Mark wrote: >>> 2. Let the plugin itself (so in this case PluginOne.php) open itself and register it

Re: [PHP] What's the best way to make a dynamic plugin architecture?

2012-08-27 Thread Stuart Dallas
On 27 Aug 2012, at 14:29, Mark wrote: > On Mon, Aug 27, 2012 at 12:41 PM, Stuart Dallas wrote: >> On 26 Aug 2012, at 19:42, Mark wrote: >> >>> 2. Let the plugin itself (so in this case PluginOne.php) open itself >>> and register it to the PluginLoader. >>> >>> With the first option i have to

Re: [PHP] What's the best way to make a dynamic plugin architecture?

2012-08-27 Thread Mark
On Mon, Aug 27, 2012 at 12:41 PM, Stuart Dallas wrote: > On 26 Aug 2012, at 19:42, Mark wrote: > >> Envision the following plugin architecture: >> >> class PluginLoader >> { >> } >> >> interface PluginInterface >> { >> .. some function definitions .. >> } >> >> class PluginOne implements PluginIn

Re: [PHP] What's the best way to make a dynamic plugin architecture?

2012-08-27 Thread Stuart Dallas
On 26 Aug 2012, at 19:42, Mark wrote: > Envision the following plugin architecture: > > class PluginLoader > { > } > > interface PluginInterface > { > .. some function definitions .. > } > > class PluginOne implements PluginInterface > { > } > > class PluginTwo implements PluginInterface > {