vbardales / multipleappkernelbundle Goto Github PK
View Code? Open in Web Editor NEWAllow Symfony2 app to host multiple applications
Allow Symfony2 app to host multiple applications
Hi looks like there wasn't change for this repository for a long time. Is this repo deprecated?
Hi @vbardales !
First of all, thank you for your bundle it works great!
I noticed a case which can be problematic in KernelBundle/Routing/Generator.php
To generate the var $cache_dir
the following code is used :
// Load the route generator for app
$cache_dir = str_replace($this->container->getParameter('kernel.name'), $appName, $this->container->getParameter('kernel.cache_dir'));
We encountered a problem in production since we have one of our app which is called tv
and in our path we have /vhosts/mysite.tv/www/...
so the .tv
got replaced by this line !
We figured out a quick fix, here it is :
// Load the route generator for app
$kernelName = '/'.$this->container->getParameter('kernel.name').'/';
$appName = '/'.$appName.'/';
$cache_dir = str_replace($kernelName, $appName, $this->container->getParameter('kernel.cache_dir'));
We just added slashes before and after appName to avoid replacing it by mistake in the full path.
This is not the most elegant solution but if fixes the problem for now and prevents our visitors to get an error 500.
I am opening a pull request with my fix but if you have another idea to fix this, suggestions are welcomed !
How do you structure your 'web' folder please?
I struggle to separate the logic for specific sites there...
Your help is much appreciated!!
PS. Do you possibly have a 'sandbox' project?
Thanks
Paul
Found an incompatibility with this bundle and Symfony 2.1.9-dev installed via composer.
The cache path for the routing file was changed, from
appprodUrlGenerator.php -> appProdUrlGenerator.php
I had to change the following in Routing/Generator.php
ย ```
--- a/Routing/Generator.php
+++ b/Routing/Generator.php
@@ -56,7 +56,8 @@ class Generator
{
// Load the route generator for app
$cache_dir = str_replace($this->container->getParameter('kernel.name'), $appName, $this->container->getParameter('kernel.cache_dir'));
$generatorClassName = $appName.$this->container->getParameter('kernel.environment').'UrlGenerator';
$generatorClassName = $appName.ucfirst($this->container->getParameter('kernel.environment')).'UrlGenerator';
This is the comit that I think brakes it:
https://github.com/symfony/FrameworkBundle/commit/38602e18e219631e556fe1c700dca022a3f2cbd2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.