If there is a better place for this discussion, let me know and I will post there. Thanks!
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/php-fig/-/ZVR_4gVMoIkJ.
For more options, visit https://groups.google.com/groups/opt_out.
But in short: Why do you invest your precious time to to change a working system, just because "its ugly"? Usually you don't need to look into the "vendor/"-folder, that is something composer takes care for you, so at the end it doesn't really care, whether it is ugly, or not ;)
That does seem like a sort of cop out. We never need to debug other peoples code right?
Or dig in and see how an interface is defined or copy some boiler plate code?
Or just figure out the logic happening in some class so we understand how to properly use it.
This is open source after all. Basically, I think the reason it keeps coming up because we /do/ have to interact with it.
To view this discussion on the web visit https://groups.google.com/d/msg/php-fig/-/W4WpLU6BK1gJ.
What are others doing? Is anyone as nitpicky as I am on these things? Assuming you agree it's bothersome, should there be a recommendation on a standard approach that others might benefit from?
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
I do have to agree with Amy in some points.Why does Symfony has in its components the Tests folder inside the namespace structure of src/, instead of outside of it, in a separate tests/ folder?
2013/2/10 Brett Bieber <brett....@gmail.com>On Sun, Feb 10, 2013 at 9:46 AM, Amy Stephen <amyst...@gmail.com> wrote:
What are others doing? Is anyone as nitpicky as I am on these things? Assuming you agree it's bothersome, should there be a recommendation on a standard approach that others might benefit from?
If I'm understanding you correctly, the PEAR & Pyrus installers handle this similarly to how you describe. Individual packages are installed to a common directory with the PSR-0 .php files inter-leaved together. Upgrades and filename conflicts are managed by the installer, because it remembers which files belong to each package. This results in (typically) two PSR-0 compliant autoloadable directories for your application: one for the vendor dependencies, and one for your local application.
As for tests and docs, these are handled similarly — all the docs go together, all the tests together etc. It's simply a different approach to how the installer places the dependencies on the local filesystem. I've found that both approaches have advantages and disadvantages.
--
Brett Bieber--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No, not bundles, but components.
Check any component, like HttpFoundation, Config or Validator.They all have the Test namespace inside the main namespace, within the src/ directory.To me, that doesn't make a whole lot of sense.I'd put the tests inside a separate folder from the src/, such as a tests/ directory.
http://s7.postimage.org/7ar0rbvmz/Screen_shot_2013_02_10_at_9_04_50_AM.png
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/php-fig/-/ZVR_4gVMoIkJ.
For more options, visit https://groups.google.com/groups/opt_out.
Justin -
To clarify, I like:
`Symfony/Component/HttpFoundation/JsonResponse.php`Unfortunately, what happens today is this:
That is what my proposal would produce.
`symfony/component/Symfony/Component/HttpFoundation/JsonResponse.php`
My suggestion is a procedural change in the folder structure for packages, a long with using class maps (not dynamic class loading) for unit testing. That change results in Composer and Packagist producing the first path.
Recommend reading https://igor.io/2013/01/23/autoload-insanity.html and the comments https://gist.github.com/igorw/4600419
Actually, the current path is:
vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.phpAnd your recommendation would change that to:vendor/symfony/http-foundation/JsonResponse.php
Your idea works as long as the composer vendor and package names are exactly equal to the first two levels in the project namespace, and as long as the package's classes start at the third level,
and as long as the composer packages use camel case and capitalized vendor and package names.
The problem is, these assumptions don't hold for a vast majority of projects I've used, and I'd guess that they don't hold for a majority of packages available on Packagist.
Also, the last assumption is in direct violation of the Composer best practices for package names, so we can include an additional assumption: it requires a case-insensitive filesystem as well.
Good, I feel like we are on the same track. Going to respond inline.On Sun, Feb 10, 2013 at 5:20 PM, justin <jus...@justinhileman.info> wrote:
Actually, the current path is:
vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/JsonResponse.phpAnd your recommendation would change that to:vendor/symfony/http-foundation/JsonResponse.php
Was going from memory, there, but you are right. That's the complexity I would like to get rid of. I am fine with the PSR-0 namespace. I do not like the extra layers that get added as a result of our best practices, tools, and gitHub.
Your idea works as long as the composer vendor and package names are exactly equal to the first two levels in the project namespace, and as long as the package's classes start at the third level,
And, to be fair, that is the standard. If projects deviate from that, then, other things would result.
and as long as the composer packages use camel case and capitalized vendor and package names.
That is another minor issue that I didn't raise. It is also "fixed" with my proposed approach.
The problem is, these assumptions don't hold for a vast majority of projects I've used, and I'd guess that they don't hold for a majority of packages available on Packagist.
I looked at many this past week and I think there is at least growing conformance.
But, would you agree for projects that follow the PSR-0 folder standard and use the recommended installation tools, it would be good to aim for no additional layers?
To view this discussion on the web visit https://groups.google.com/d/msg/php-fig/-/yIGSz-GzyhwJ.
Actually, Justin, I want to re-address this part of your comments, it
really is the heart of the matter. I see you posted again - but I
think you might agree with this.
Actually, you didn't address my last email at all.On Sun, Feb 10, 2013 at 4:07 PM, Amy Stephen <amyst...@gmail.com> wrote:
Actually, Justin, I want to re-address this part of your comments, it
really is the heart of the matter. I see you posted again - but I
think you might agree with this.
Symfony has three types of packages: Bundles, Components and Bridges. You can see them here:Using `symfony/component` as the package name wouldn't work, because there are a *lot* of symfony components:... each of which has its own Composer package.Using `symfony/http-component` is great, but requiring that to match the PHP namespace would force Symfony to mix their Bundles, Components and Bridges together into one big mess, which would make things decidedly worse for them.
At the other end of the spectrum, what would you suggest Monolog use as the "package" namespace level?Should that class be `Monolog/Monolog/Logger`?
There isn't a second level, because it isn't needed. Monolog is a standalone library, and its vendor name is the same as its package name. Forcing it to use another level of namespace just for the sake of matching its composer package name
would be just as bad for them as forcing Symfony to dump all its packages directly into the Symfony namespace rather than splitting them into sub-namespaces.
I think the problem is that you're assuming a 1:1 map from PHP namespace to Composer package name. That assumption does not hold, and is a sub-optimal requirement for both of the cases I outlined above. And for what it's worth, most packages fall into one or the other of these cases.
To be fair, this is a separate issue and one that probably should be addressed by Composer during the install. (If the first two nodes match, use it once.)
OK, got it, Justin. I need to think about your points a bit. What would probably help would be to see examples of where a package should not be the Vendor/Package namespace nodes. That might be the missing piece for me to agree with your point of view.
I do believe I understand your perspective, but at this time, I really do not see any compelling reason to leave all that room for projects to inject more layering. Frankly, I'm convinced most end up with extra layers simply because they are not aware of how their decisions impact the folders created. Could be wrong though.
On Sun, Feb 10, 2013 at 6:24 PM, justin <jus...@justinhileman.info> wrote:
Actually, you didn't address my last email at all.On Sun, Feb 10, 2013 at 4:07 PM, Amy Stephen <amyst...@gmail.com> wrote:
Actually, Justin, I want to re-address this part of your comments, it
really is the heart of the matter. I see you posted again - but I
think you might agree with this.
Good god! Trying to keep up! Was hitting send when you emailed - but I did respond. Old woman here, go slow. Patience young fella!
\Doctrine\Common\IsolatedClassLoader
=> /path/to/project/lib/vendor/Doctrine/Common/IsolatedClassLoader.php
\Symfony\Core\Request
=> /path/to/project/lib/vendor/Symfony/Core/Request.php
\Zend\Acl
=> /path/to/project/lib/vendor/Zend/Acl.php
\Zend\Mail\Message
=> /path/to/project/lib/vendor/Zend/Mail/Message.php
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/php-fig/-/4WEnJT6aaCkJ.
These are the examples from the standard.
None of these can be produced in the current environment.Is that acceptable?
\Doctrine\Common\IsolatedClassLoader
=>/path/to/project/lib/vendor/Doctrine/Common/IsolatedClassLoader.php
\Symfony\Core\Request
=>/path/to/project/lib/vendor/Symfony/Core/Request.php
\Zend\Acl
=>/path/to/project/lib/vendor/Zend/Acl.php
\Zend\Mail\Message
=>/path/to/project/lib/vendor/Zend/Mail/Message.php
\Doctrine\Common\IsolatedClassLoader
=> ./vendor/doctrine/common/lib/Doctrine/Common/IsolatedClassLoader.php
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
Terribly sorry for hopping into this now, but I have, after reading all of it, not found the technical aspect of this. If it's pure esthetics, we can discuss that till the end of time + 1 millisecond. But where is the technical aspect of it?
If I want to find a classes content I can either, in pretty much any useable IDE today click the class with an operating key pressed and it jumps into it, no matter where it is nested. If I'm interested in more or don't want to stress my IDE of choice too much with that, I look up the github repo and look in there. Both are very valid and don't stop me from going to dig into the underbelly of the vendor directory.
The way composer handles it, with the package and vendors names actually helps, because in many cases whenever I need to look at the content of the vendor directory, I usually have just looked at the composer file, which then reflects the package in question. It also splits things apart, like Doctrine and Symfony pieces, that would otherwise be mushed into one large blob.
I see no significant overhead here in the extra directories. I see no problems with executing the code therein.
I can get more information (tests, documentation, ressources, examples, etc) with this structure which also has saved me so far at least a month of work already and I'm only using this setup for half a year now.
To give you another wonderful example, I bugged William Durand in the first steps with composer, on how can I get one of the custom bundles I created for my company to be put into the src folder of symfony, you know, for autoloading and easier editing... His answer was "Why would you want to?" The lightbulb has been shining ever since and saved the company I work for huge headaches.
So it comes down to that question, why would you want to?
Greetings,
Christian Riesen
On Monday, February 11, 2013 8:10:20 PM UTC+1, Amy Stephen wrote:A number of times, I have tried to make the point that there is a problem implementing the standard, given the examples, given the implications of the current environment.
What I hope for is clarity for those who work to implement this standard.
This discussion has been helpful, even though it has been challenging, and I have been reminded of the importance of being clear and to the point. My approach created confusion as many responses were then to cursory points rather than the central theme.
That is my fault and I apologize for that.
I happen to believe that this namespacing standard and the work on Interfaces are going to change the PHP community in a very positive way. That's why I care about the clarity. I want all PHP developers to know how this works and to get involved.
Given the assistance of those of you who have participated, I wrote a little FAQ, of sorts, that helps clarify how using Composer to implement the PSR-0 works. The nuts and bolts of it all. Please read and fork it to improve it and/or post in the comments. I think it could help others get involved.
https://gist.github.com/AmyStephen/4756621
Thanks for your patience and help.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/php-fig/-/oGLPiaA3azQJ.
Hi Amy,The model of PSR0 implies we need to have an absolute path relation to the class name, so once you're into ./molajo/filters/src/ then you need a further /Molajo/Filters/ in order to transform the class name. There's nothing we can do to change this.
If you were really passionate it about it
you could have a molajo general folder with sub-paths inside it which is doable within composer. Each Filters, Users and Something could be sub-packages if you wanted them to be split up into composer packages.
./vendor/molajo/src/Molajo/Filters/./vendor/molajo/src/Molajo/Users/./vendor/molajo/src/Molajo/Something/Hope this helps.
Many thanks,Paul
Hi Amy,The model of PSR0 implies we need to have an absolute path relation to the class name, so once you're into ./molajo/filters/src/ then you need a further /Molajo/Filters/ in order to transform the class name. There's nothing we can do to change this.If you were really passionate it about it you could have a molajo general folder with sub-paths inside it which is doable within composer. Each Filters, Users and Something could be sub-packages if you wanted them to be split up into composer packages../vendor/molajo/src/Molajo/Filters/./vendor/molajo/src/Molajo/Users/./vendor/molajo/src/Molajo/Something/
On Fri, Feb 15, 2013 at 3:55 PM, Paul Dragoonis <drag...@gmail.com> wrote:
Hi Amy,The model of PSR0 implies we need to have an absolute path relation to the class name, so once you're into ./molajo/filters/src/ then you need a further /Molajo/Filters/ in order to transform the class name. There's nothing we can do to change this.If you were really passionate it about it you could have a molajo general folder with sub-paths inside it which is doable within composer. Each Filters, Users and Something could be sub-packages if you wanted them to be split up into composer packages../vendor/molajo/src/Molajo/Filters/./vendor/molajo/src/Molajo/Users/./vendor/molajo/src/Molajo/Something/I think Amy's complaint is really about the packaging and installation paths including the extra directories. This is really a fundamental difference in how the packaging process works and how the installer functions.
For a PEAR-installable package, PEAR and Pyrus would install these files to:./vendor/php/Molajo/Filters/
./vendor/php/Molajo/Users/
./vendor/php/Molajo/Something/likewise:
./vendor/php/Zend/Mail/
./vendor/php/Zend/Stdlib/./vendor/php/PEAR2/HTTP/This relies on the vendor namespace prefix of the PSR-0 class to provide the unique directory structure, and not the package name.
Because there are no standards for other files, such as tests, data files, doc files etc, Pyrus DOES use the package name and channel to prefix those files:
./vendor/docs/pear2.php.net/PEAR2_HTTP_Request/examples/Like I said before, this is simply a different approach to packaging and how the installer places the files on the local filesystem.
--
Brett Bieber
Hi Amy,
I do understand the issue here now. To confirm you're pointing out that you see <package name> as unnecessary?./vendor/<package name>/Molajo/Fliters/MyClass.phpIf i'm not correct I apologise as I've jumped into this thread late and have TL;DR syndrome :-)
On Fri, Feb 15, 2013 at 4:34 PM, Paul Dragoonis <drag...@gmail.com> wrote:Hi Amy,I do understand the issue here now. To confirm you're pointing out that you see <package name> as unnecessary?./vendor/<package name>/Molajo/Fliters/MyClass.phpIf i'm not correct I apologise as I've jumped into this thread late and have TL;DR syndrome :-)
Now, tl;dr, I *totally* get, Paul. In fact, a few posts back I apologized for my first post and the approach - I should have kept it simple.
You're close - it is the two nodes: <PSR-0-Vendor-name>/<Composer-Package-name> that are duplicated in the install path.
But, as a result of this thread, I realize it's not a mistake that can be corrected like I had thought. It's just a function of what Composer requires as a key (lower case PSR-0 vendor name/and package name) and PSR-0 requiring those values in Camel-case.