When i have multiple aplications i solve the problem just like that:
// app.php
use Symfony\Component\HttpFoundation\Request;
if (@$_SERVER['HTTP_HOST'] == 'admin.midomain.com') {
$kernel = new AppKernel('admin', true);
} else {
$kernel = new AppKernel('frontend', false);
}
$kernel->loadClassCache();
$kernel->handle(Request::createFromGlobals())->send();
On 11 July 2012 07:42, Lukas Kahwe Smith <[email protected]> wrote:
>
> On Jul 11, 2012, at 3:03 AM, Joshua Nankin wrote:
>
>> By the way, you do have to do some AppKernel tweaking to get it to
>> understand the concept of an 'application', but really its just about
>> changing the contructor to accept an application name, and then changing
>> registerContainerConfiguration to load the correct configuration file.
>>
>> On Tuesday, July 10, 2012 6:54:24 PM UTC-5, Joshua Nankin wrote:
>> I have the same problem, where I want multiple different "applications",
>> that act differently and look differently, but really all have the same
>> underlying business logic and require access to the same data stores. Each
>> application comes in on a different subdomain or domain name. Here's how
>> I'm solving it:
>> ∙ use .htaccess rules or webserver configuration to point domain names
>> to specific front controllers (app1/app.php, app2/app.php)
>> ∙ create application specific configuration directories in app/config
>> (app/config/app1/config.yml, app/config/app1/config_dev.yml)
>> ∙ At this point, you can override routing rules for each specific
>> application by specifying a tailored routing.yml
>> Although people are saying they miss the Symfony1 application structure,
>> this actually is a step up, as you can actually change routing and
>> parameters much easier with the current setup, where as before you only
>> really had one routing table you could work with.
>>
>> On Wednesday, March 14, 2012 5:31:34 PM UTC-5, Константин wrote:
>> Thank you for advie.
>> It Looks like good sollution, but there are some problems on integration
>> https://github.com/opensky/OpenSkyRuntimeConfigBundle/issues/6
>>
>>
>> вторник, 14 февраля 2012 г. 18:16:36 UTC+2 пользователь weaverryan написал:
>> Hi there!
>>
>> Another alternative is to have a service that figures out what your current
>> "domain" is. You can then use a little trick created by OpenSky to make any
>> parameter dynamic, which could be controlled by that service
>> (https://github.com/opensky/OpenSkyRuntimeConfigBundle). The approach seems
>> a little strange, but having runtime configs gives you the flexibility you
>> need and seems less dramatic than multiple applications or cache directories.
>>
>> There might be a better way, but just some thoughts!
>>
>> Cheers!
>>
>> Ryan Weaver
>> US Office Head & Trainer - KnpLabs - Nashville, TN
>> http://www.knplabs.com
>> http://www.thatsquality.com
>> Twitter: @weaverryan
>>
>>
>> 2012/2/14 Константин <[email protected]>
>> For example we have one site with multiple domains.
>>
>> site.com // en
>> site.ru // ru
>>
>> There is some hostname-related configuration (session domain cookie,
>> security remember me cookie, session dfault locale) wich different in
>> hostnames. And when container compiles it contains embedded/resolved
>> parameters for only one hostname. So there is 2 possible sollutions:
>>
>> 1. use multiple apps
>> 2. override some methods like getCacheDir in Kernel and resolve cache path
>
> indeed .. we are using multiple kernels per application in many apps to be
> able to deploy parts of the application (like the
> main/mobile/admin/dbmigrations etc) to independent VM's
>
> this is described in detail in our old debian generation tool chain
> https://github.com/liip/sf2debpkg#application-structure
>
> regards,
> Lukas Kahwe Smith
> [email protected]
>
> PS: If you are interested in the new debian + RPM toolchain check out
> https://github.com/liip/packaging
>
> --
> 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
--
-------------------------------------------------------------------------------------
Daniel González Cerviño
Open Source Developer http://desarrolla2.com
Tel (+34) 653 96 50 48
Mail [email protected]
Twiter: http://twitter.com/desarrolla2
Linkedin: http://es.linkedin.com/in/danielgonzalezcervino
-------------------------------------------------------------------------------------
--
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