+1 for moving the vendor directory. Having the src/ directory
containing only your application code makes perfect sense to me.
+1 for namespace changes if only for interoperability reasons, I
guess.

For those of us who use more humble code-editors rather than IDEs, if
there can be any shortening of namespaces or directory paths, that's a
good thing too (where sensible).

In terms of namespaces and interoperability, I imagine the structure
become something like this, is this correct?

app/
src/
    Sensio/
        Application/
            HelloBundle/
                ...
Bundle/
vendor/

Also, I find it a bit confusing that some directories have initial
caps (Bundle) and other don't (app, src, vendor). This is also the
case inside the application bundle: Controller, Resources, Tests vs.
config and views. I appreciate that the initial capital letter is used
where the directory structure is mirroring the namespace and the other
(regular) directories are kept as all lower-case, but I still find
myself double-checking which it is.

I'm not saying that this should be changed, just that ALL efforts to
standardise on these things (and document them) are going to help less
experienced developers like myself to learn Symfony2 more quickly.


On Jan 16, 9:04 am, 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

Reply via email to