[HttpKernel] Multi base/root dir support or not? :|

Showing 1-5 of 5 messages
[HttpKernel] Multi base/root dir support or not? :| Roland Franssen 5/13/13 10:07 AM
Hi,

I would like to start a discussion on multiple base/root dir support in the HttpKernel\KernelInterface.

The basic idea is that an application can have multiple "app" folders for different layers of configuration, resources etc. In a nutshell; global resources (e.g. app/config/parameters.yml, app/Resources/views).

This should also come with a standardized bootstrap component, e.g.;
<?php
// web/index.php
$bootstrap = new Symfony\Component\Bootstrap\HttpBootstrap('global_path/:my_path/:../app'); 
$bootstrap->init();
$bootstrap->setup();
$bootstrap->run(); 
$bootstrap->getKernel()->getRootDir(); // ../app 
$bootstrap->getKernel()->getBasePaths(); // array('global_path/', 'my_path/', '../app');

 However this seems to be a drastic architecture change as %kernel.root_dir% is pretty much used in each bundle out there. On the other hand... symfony2 is already flexible enough to handle this.

I personally favor this kind of setup over symlink terror. Any thoughts on this? Is it desired? Should I stop all development immediately? (I'm currently working on a proof of concept for the framework bundle).

Roland,
Re: [symfony-devs] [HttpKernel] Multi base/root dir support or not? :| Sebastian Krebs 5/13/13 2:41 PM



2013/5/13 Roland Franssen <fransse...@gmail.com>

Hi,

I would like to start a discussion on multiple base/root dir support in the HttpKernel\KernelInterface.

The basic idea is that an application can have multiple "app" folders for different layers of configuration, resources etc. In a nutshell; global resources (e.g. app/config/parameters.yml, app/Resources/views).

Hi,

My first thought here: "app/" contains the application-stuff. When you split it even further, what does the other folders contain? If it contains things, that you share between applications, maybe it should be a bundle instead?

I wouldn't share configurations between applications, because I would always fear to change a setting in one app to avoid breaking the other one.

Regards,
Sebastian
 

This should also come with a standardized bootstrap component, e.g.;
<?php
// web/index.php
$bootstrap = new Symfony\Component\Bootstrap\HttpBootstrap('global_path/:my_path/:../app'); 
$bootstrap->init();
$bootstrap->setup();
$bootstrap->run(); 
$bootstrap->getKernel()->getRootDir(); // ../app 
$bootstrap->getKernel()->getBasePaths(); // array('global_path/', 'my_path/', '../app');

 However this seems to be a drastic architecture change as %kernel.root_dir% is pretty much used in each bundle out there. On the other hand... symfony2 is already flexible enough to handle this.

I personally favor this kind of setup over symlink terror. Any thoughts on this? Is it desired? Should I stop all development immediately? (I'm currently working on a proof of concept for the framework bundle).

Roland,

--
--
If you want to report a vulnerability issue on Symfony, please read the procedure on http://symfony.com/security
 
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfon...@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
---
You received this message because you are subscribed to the Google Groups "Symfony developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony-devs...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
github.com/KingCrunch
Re: [HttpKernel] Multi base/root dir support or not? :| Roland Franssen 5/14/13 4:41 AM
It's about maintainable environments for multiple symfony projects (based on a globale core, e.g. a product).

I think it should be more maintainable for non-automated environments. In automated environments (e.g. capifony) symlinking is not a big deal as there's a single point of entrance for maintenance. However with manual environments there's currently not a single point of entrance and then symlinking becomes less maintainable, imho.

On the other hand symlinking could be (nicely) automated using a composer script handler =/

> "I wouldn't share configurations between applications, because I would always fear to change a setting in one app to avoid breaking the other one."
We want to manage +-100 symfony projects, these projects should share global configuration. Yes, changing a global config affects +- 100 projects. This is desired for us...

I guess automated symlinks is the way to go here. However i still believe multiple base dirs is a nice enhancement for a more flexible system.

Op maandag 13 mei 2013 19:07:43 UTC+2 schreef Roland Franssen het volgende:
Re: [symfony-devs] Re: [HttpKernel] Multi base/root dir support or not? :| Sebastian Krebs 5/14/13 7:49 AM



2013/5/14 Roland Franssen <fransse...@gmail.com>

It's about maintainable environments for multiple symfony projects (based on a globale core, e.g. a product).

Thats exactly why I'm asking: "Core" sounds like "CoreBundle" to me :)
 

I think it should be more maintainable for non-automated environments. In automated environments (e.g. capifony) symlinking is not a big deal as there's a single point of entrance for maintenance. However with manual environments there's currently not a single point of entrance and then symlinking becomes less maintainable, imho.

On the other hand symlinking could be (nicely) automated using a composer script handler =/

> "I wouldn't share configurations between applications, because I would always fear to change a setting in one app to avoid breaking the other one."
We want to manage +-100 symfony projects, these projects should share global configuration. Yes, changing a global config affects +- 100 projects. This is desired for us...

OK, interesting :D When it's only about the config, why not simply import it like in

# app/config/config.yml
imports:
    - { resource: parameters.yml }
    - { resource: ../company.yml } # <--- :)
    - { resource: security.yml }
 

I guess automated symlinks is the way to go here. However i still believe multiple base dirs is a nice enhancement for a more flexible system.

Must say I still don't know exactly what you are concrete talking about. You say "configuration", but at the end, there is exactly _one_ configuration, that imports everything else.

for everything below app/Resources you should really consider a bundle
 

Op maandag 13 mei 2013 19:07:43 UTC+2 schreef Roland Franssen het volgende:
Hi,

I would like to start a discussion on multiple base/root dir support in the HttpKernel\KernelInterface.

The basic idea is that an application can have multiple "app" folders for different layers of configuration, resources etc. In a nutshell; global resources (e.g. app/config/parameters.yml, app/Resources/views).

This should also come with a standardized bootstrap component, e.g.;
<?php
// web/index.php
$bootstrap = new Symfony\Component\Bootstrap\HttpBootstrap('global_path/:my_path/:../app'); 
$bootstrap->init();
$bootstrap->setup();
$bootstrap->run(); 
$bootstrap->getKernel()->getRootDir(); // ../app 
$bootstrap->getKernel()->getBasePaths(); // array('global_path/', 'my_path/', '../app');

 However this seems to be a drastic architecture change as %kernel.root_dir% is pretty much used in each bundle out there. On the other hand... symfony2 is already flexible enough to handle this.

I personally favor this kind of setup over symlink terror. Any thoughts on this? Is it desired? Should I stop all development immediately? (I'm currently working on a proof of concept for the framework bundle).

Roland,

--
--
If you want to report a vulnerability issue on Symfony, please read the procedure on http://symfony.com/security
 
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfon...@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
---
You received this message because you are subscribed to the Google Groups "Symfony developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony-devs...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
github.com/KingCrunch
Re: [symfony-devs] Re: [HttpKernel] Multi base/root dir support or not? :| Roland Franssen 5/14/13 11:03 AM

It's about maintainable environments for multiple symfony projects (based on a globale core, e.g. a product).

Thats exactly why I'm asking: "Core" sounds like "CoreBundle" to me :)

I should probably say: "a core configured with global configs"


OK, interesting :D When it's only about the config, why not simply import it like in

# app/config/config.yml
imports:
    - { resource: parameters.yml }
    - { resource: ../company.yml } # <--- :)
    - { resource: security.yml }


There should be 1 company.yml, not a 100 =) now it should be symlinked (which is probably OK with composer script handlers).

However each project still imports company.yml hardcoded in the project config, which can become a pain in the ass maintenance-wise.


Must say I still don't know exactly what you are concrete talking about. You say "configuration", but at the end, there is exactly _one_ configuration, that imports everything else.
 
Well.. therefor the discussion ;) what if symfony supports _multiple_ configurations out-of-the box... consider the following architecture;

/global/app/config.yml

The concept here is that the site config inherits from the global config out-of-the-box. Simply because /global/app en /sites/.../app are used as base paths (FYI: Config/FileLocator already supports multiple paths to look for resources).


for everything below app/Resources you should really consider a bundle

The beauty of the app folder is I can overwrite resources from all bundles project-specificly. As far as I know 1 bundle cannot overwrite resources from many other bundles... right?