On Tue, Jun 24, 2014 at 2:30 PM, Bryan Davis <[email protected]> wrote:
> I suggested MediaWiki\Extensions\OAuth because it seems like the most > natural naming to me. PSR-4 [2] is very opinionated about namespaces. > It requires a top-level (or vendor) namespace. I chose "MediaWiki" > because ... MediaWiki. Beyond that sub-namespaces are optional, but > the file system path from the base directory to the php file must > match. That's not quite accurate: PSR-4 fully qualified classnames have a namespace prefix corresponding to a base directory, but that prefix can have any number of components. So a class could be called, say, Wikimedia\CSteipp\OAuthExtension\Frontend\SpecialPages\ SpecialMWOAuthConsumerRegistration, the autoloader would be configured with 'Wikimedia\CSteipp\OAuthExtension' => "$IP/extensions/OAuth", and the file would be loaded from $IP/extensions/OAuth/Frontend/SpecialPages/ SpecialMWOAuthConsumerRegistration.php (I am not disagreeing that MediaWiki\Extensions\<extensionname> is the obvious choice, just noting that nothing in PSR-4 requires this.) _______________________________________________ Wikitech-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikitech-l
