Hi,
I agree this structure makes much more sense. And you're right, it's
the last chance to do it and since everybody knew that things were
gonna change, I don't think they find this as a big deal. One thing is
that I'm not a Bundle developer, but I am a Symfony player and I don't
see any problem on migrating code.
Let's bring one more scenario, let's suppose you build a huge
application and then you want to separate the code, by services for
example; ending up with something like:
Application/
WebappBundle/
CmsappBundle/
...
And imagine that we want to share some code between both (say domain
logic), how would we address this situation, by creating a separated
bundle under vendor/ ?... I don't know whether this scenario makes
sense or not for you, I'm just new in the project and I'm thinking
that having a way to centralize and reuse domain logic will help a
lot, and I'm not sure how to do it with the current structure.
Regards!
On Jan 16, 3: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