The first suggestion I hesitated with a little as I quite liked the
simple top-level structure of app/, src/ and web/, and introducing
vendor/ pollutes that a bit (even if just from a purely aesthetic
POV!). However I think the meanings of src/ versus new src/ and
vendor/ are equally cohesive, and having a separate top-level
directory called vendor/ for third-party code is a pretty common
pattern (Rails does it). In of itself I'd be pretty ambivalent about
the change.
I think the second suggestion (adopting /vendor/<Vendor_Name>/
(<Namespace>/)* etc for third-party vendor directory structure in line
with PSR-0) makes perfect sense.
My question is what the best structure would be for the src/
directory. Should the first directory be a vendor name directory too,
even if that's just a localised 'vendor' called "Application" (or
"App", for consistency) by default?
So:
/src
/App
/Bundle
Or is there still a need for a top(pish)-level non-third-party
directory for bundles?
So:
/src
/apps
/(<Application_Name>)+
/bundles
/<Vendor_Name>
/<Bundle_Namespace>
etc?
Douglas
On Jan 16, 2:04 pm, Fabien Potencier <fabien.potenc...@symfony-
project.com> wrote:
> Hi all,
>
> As of now, the default directory structure of a typical Symfony2
> application reads as follows:
>
> app/
> src/
> Application/
> Bundle/
> vendor/
> web/
>
> src/ contains all the PHP code: the code you write for your application
> and the code you need from external sources (under the vendor/
> sub-directory but also under Bundle/).
>
> The first question is: What about moving ALL code that does not belong
> to the application to the vendor/ directory, outside the src/ one:
>
> app/
> src/
> vendor/
> web/
>
> That way, src/ only contains the code for your specific application:
>
> src/
> Application/
> ...
>
> And vendor/ contains all your dependencies:
>
> vendor/
> Bundle/
> Sensio/
> CasBundle/
> ...
> doctrine/
> symfony/
> ...
>
> I think this structure makes more sense than the current one. It also
> eases the separation between your app code and everything else, which I
> think is a good thing.
>
> Not really related to that, but nonetheless interesting, I have another
> question. The bundles are stored by default under two main namespaces:
> Application/ and Bundle/. This has been decided a long time ago, but it
> breaks the interoperability standard, as the first part of a namespace
> should be the vendor name.
>
> So, instead of:
>
> Bundle\Sensio\CasBundle
>
> We should probably have:
>
> Sensio\Symfony\Bundle\CasBundle
>
> This has many advantages like:
>
> * It follows the interoperability standard;
> * If allows to easily package your "plain PHP" code (think Model here)
> and your Symfony bundles under the same namespace:
>
> Sensio\Symfony\Bundle\...
> Sensio\Doctrine\Extension\...
> Sensio\Design\...
>
> The only drawback I can see is the fact that the namespace is much
> longer than before.
>
> I know that it virtually breaks everything out there, but this is our
> last chance to get it right.
>
> Any thoughts?
>
> Fabien
>
> --
> Fabien Potencier
> Sensio CEO - symfony lead developer
> sensiolabs.com | symfony-project.org | fabien.potencier.org
> Tél: +33 1 40 99 80 80
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en