Created
September 10, 2015 08:21
-
-
Save mms-uret/0781f2e88c3ed2fdc233 to your computer and use it in GitHub Desktop.
Multiple application in EzPublishKernel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EzPublishKernel extends Kernel | |
{ | |
public function registerBundles() | |
{ | |
$bundles = array( | |
// all the bundles | |
); | |
$app = $this->getApp(); | |
if ($app == 'backend') { | |
$bundles[] = 'SRF\\BackendBundle'; | |
} | |
// environment dependendet bundles | |
return $bundles; | |
} | |
public function getCacheDir() | |
{ | |
return $this->rootDir.'/cache/'.$this->environment.'/'.$this->getApp(); | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function getLogDir() | |
{ | |
return $this->rootDir.'/logs/'.$this->getApp(); | |
} | |
/** | |
* Parsing the domain and uri and returns the app | |
* | |
* @return string | |
*/ | |
private function getApp() | |
{ | |
$app = 'frontend'; | |
if ($SERVER['HTTP_HOST'] == 'backend.srf.ch') { | |
$app = 'backend'; | |
} | |
return $app; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function getName() | |
{ | |
return $this->getApp(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment