Re: [PEAR2 CS] Channel in paths

From: Date: Tue, 13 Sep 2011 18:27:23 +0000
Subject: Re: [PEAR2 CS] Channel in paths
References: 1 2 3 4 5  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-54505@lists.php.net to get a copy of this message
2011/9/13 Васил Рангелов <boen.robot@gmail.com>: >> These packages use the same name, but are distributed from different > channels: >> Yaml, Config, Gearman, Zend, PHPUnit, Translator, Routing, Autoload, > REST_Client etc etc. > > But are they in conflict within the PHP folder too? In other words, with the > way Pyrus is currently set up, could you install any of these packages from > all channels it is distributed from without problems? If you can't install > them successfully, then the channel folder wouldn't help unless it also > applies in the PHP folder. (In the case of PHPUnit, AFAIK, installation will > fail exactly because of that) Not necessarily. The package names must be unique to the channel, but that doesn't mean that the PHP files within the foobar.com/Config package aren't prefixed with namespace FooBar; class Config ... or class FooBar_Config, and could certainly be used at the same time as baz.net/Config class Baz_Config. > The only scenario where the current setup helps is if these packages, while > naming themselves in this way also put themselves in a vendor named folder > that is different across the channels. So I guess the real question is do > they do just that? I'm sure we'd see a mix of both. If they're not using a vendor prefix or unique class names there's no possibility of using them together, regardless of what Pyrus does. What Pyrus is doing effectively namespaces the data/docs/test files (on the filesystem) using a simple map. Within any code that references these files, it's a matter of simply: <?php $data = file_get_contents(__DIR__.'/../data/foobar.com/Config/config.ini'); // - vs - $data = file_get_contents(__DIR__.'/../data/Config/config.ini'); Which I don't see as an obstacle for adoption of Pyrus or PEAR2. Do you still see it as an issue? -- Brett Bieber

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