Re: Class and interface location

From: Date: Thu, 20 Jan 2011 18:27:34 +0000
Subject: Re: Class and interface location
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-310908@lists.php.net to get a copy of this message
Larry, I suggested the docblock tag because it seemed you didn't want to mandate that plugins that extend other plugins be forced to include the interface in an actual PHP implements clause. Duplicating the implements clause doesn't cause any problems for PHP as you said, so that's one route. Advantages: Validated at runtime by the PHP compiler when the plugin is loaded. Disadvantages: If they forget to add the implements, their plugin won't be loaded. Then there's the docblock tag idea. Advantages: Easy to grab using grep. Disadvantages: If they forget to add the tag, their plugin won't be loaded. Someone mentioned creating a manifest file. If the plugins require any other configuration, this is a great place for it. Advantages: Easy to process. Disadvantages: If they forget to add an interface, their plugin won't receive its events but it will be "loaded" (not the class but the manifest). No matter which method you choose, you can make the plugin developer's life easier by writing a small script to validate the plugin and report which events it will receive. David

« previous php.general (#310908) next »