Commit b09d285d authored by dj3c1t's avatar dj3c1t

installManager: setInstallInfos

parent 005578fc
......@@ -41,6 +41,7 @@ class InstallController extends Controller {
$im->connectToDatabase();
$im->installDatabase();
$im->setSiteTitle();
$im->setInstallInfos();
$im->createAdminUser();
$im->saveParameters();
$im->clearAppCache();
......
......@@ -193,6 +193,30 @@ class InstallManager {
}
}
public function setInstallInfos() {
$em = $this->container->get('doctrine')->getManager();
$configurationRepo = $em->getRepository("Dj3c1tAppBundle:Configuration");
if(!($request = $this->container->get('request_stack')->getCurrentRequest())) {
throw new \Exception("Impossible de trouver le domaine d'installation");
}
$domainConfiguration = $configurationRepo->setConfiguration(
'install_domain',
$request->getHttpHost()
);
$em->persist($domainConfiguration);
$rootDirConfiguration = $configurationRepo->setConfiguration(
'install_host_root_dir',
$_SERVER['DOCUMENT_ROOT']
);
$em->persist($rootDirConfiguration);
try {
$em->flush();
}
catch(\Exception $e) {
throw new \Exception("Impossible d'enregistrer le domaine d'installation");
}
}
public function createAdminUser() {
$em = $this->container->get('doctrine')->getManager();
$roleRepo = $em->getRepository("Dj3c1tAppBundle:Role");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment