Re: [PEAR2 CS] Channel in paths

From: Date: Tue, 13 Sep 2011 13:38:23 +0000
Subject: Re: [PEAR2 CS] Channel in paths
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-54500@lists.php.net to get a copy of this message
2011/9/13 Васил Рангелов <boen.robot@gmail.com>: > When using the Pyrus make command and installing the resulting package, I > noticed that my test and doc files end up within a channel directory and > only then with the package name. The PEAR2 coding standards talk only about > data files. > > I'm assuming this part is meant to apply for test and doc files too, but > regardless, I want to ask what is the rationale behind that? This is used to namespace the data/docs/test files, and ensure they don't collide. PHP files already have this from the PHP Standards Working Group & PSR-0 naming standards which encourage a vendor namespace prefix for class names. For data files, there are currently no standards besides what Pyrus is trying to do. If one were to just use the package name, there are so many DB packages out there you'd immediately run into conflicts with filenames. You're correct that the PEAR2 packages would not collide, but nothing in the PEAR installation infrastructure requires a vendor prefix on package names (PEAR(1) for example has no vendor prefixes). There could be some debate over whether packages should know which channels they're distributed on, but in practice this rarely changes. The best way to handle this within your PHP files is to add a helper method to retrieve the data_dir. Check once if you're running from a vcs clone/checkout or installed with a pyrus controlled registry. -- Brett Bieber

« previous php.pear.dev (#54500) next »