Commit b739683d authored by Antonin's avatar Antonin
Browse files

Install : check that the config.php file is written.

parent 59f437d8
......@@ -4,16 +4,16 @@
* is not distributed with this file, you can obtain one at
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
*
* Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphal DROZ
* Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphal DROZ
* Authors of Framadate/OpenSondate: Framasoft (https://github.com/framasoft)
*
* =============================
*
* Ce logiciel est rgi par la licence CeCILL-B. Si une copie de cette licence
* Ce logiciel est rgi par la licence CeCILL-B. Si une copie de cette licence
* ne se trouve pas avec ce fichier vous pouvez l'obtenir sur
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt
*
* Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphal DROZ
* Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphal DROZ
* Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft)
*/
namespace Framadate\Services;
......@@ -62,7 +62,9 @@ class InstallService {
}
// Write configuration to conf.php file
$this->writeConfiguration($smarty);
if ($this->writeConfiguration($smarty) === false) {
return $this->error(__f('Error', "Can't create the config.php file in '%s'.", CONF_FILENAME));
}
return $this->ok();
}
......@@ -85,14 +87,14 @@ class InstallService {
$content = $smarty->fetch('admin/config.tpl');
$this->writeToFile($content);
return $this->writeToFile($content);
}
/**
* @param $content
*/
function writeToFile($content) {
file_put_contents(CONF_FILENAME, $content);
return @file_put_contents(CONF_FILENAME, $content);
}
/**
......
......@@ -34,9 +34,9 @@ if (ini_get('date.timezone') == '') {
define('ROOT_DIR', __DIR__ . '/../../');
define('CONF_FILENAME', ROOT_DIR . '/app/inc/config.php');
if (is_file(CONF_FILENAME)) {
require_once __DIR__ . '/constants.php';
require_once __DIR__ . '/constants.php';
if (is_file(CONF_FILENAME)) {
@include_once __DIR__ . '/config.php';
// Connection to database
......
......@@ -383,7 +383,8 @@
"Password is empty": "DE_Le mot de passe est vide.",
"Passwords do not match": "DE_Les mot de passes ne correspondent pas.",
"Poll id already used": "DE_L'identifiant est déjà utilisé",
"You can't select more than %d dates": "DE_Vous ne pouvez pas choisir plus de %d dates"
"You can't select more than %d dates": "DE_Vous ne pouvez pas choisir plus de %d dates",
"Can't create the config.php file in '%s'.": "DE_Impossible de créer le fichier config.php dans '%s'."
},
"Check": {
"Installation checking": "DE_Vérifications de l'installation",
......
......@@ -384,7 +384,8 @@
"Password is empty": "Password is empty.",
"Passwords do not match": "Passwords do not match.",
"Poll id already used": "Identifier is already used",
"You can't select more than %d dates": "You can't select more than %d dates"
"You can't select more than %d dates": "You can't select more than %d dates",
"Can't create the config.php file in '%s'.": "Can't create the config.php file in '%s'."
},
"Check": {
"Installation checking": "Installation checking",
......
......@@ -383,7 +383,8 @@
"Password is empty": "ES_Le mot de passe est vide.",
"Passwords do not match": "ES_Les mot de passes ne correspondent pas.",
"Poll id already used": "ES_L'identifiant est déjà utilisé",
"You can't select more than %d dates": "ES_Vous ne pouvez pas choisir plus de %d dates"
"You can't select more than %d dates": "ES_Vous ne pouvez pas choisir plus de %d dates",
"Can't create the config.php file in '%s'.": "ES_Impossible de créer le fichier config.php dans '%s'."
},
"Check": {
"Installation checking": "ES_Vérifications de l'installation",
......
......@@ -397,7 +397,8 @@
"Password is empty": "Le mot de passe est vide.",
"Passwords do not match": "Les mots de passe ne correspondent pas.",
"Poll id already used": "L'identifiant est déjà utilisé",
"You can't select more than %d dates": "Vous ne pouvez pas choisir plus de %d dates"
"You can't select more than %d dates": "Vous ne pouvez pas choisir plus de %d dates",
"Can't create the config.php file in '%s'.": "Impossible de créer le fichier config.php dans '%s'."
},
"Check": {
"Installation checking": "Vérifications de l'installation",
......
......@@ -381,7 +381,8 @@
"MISSING_VALUES": "Valori mancanti",
"CANT_CONNECT_TO_DATABASE": "Impossibile connettersi al database",
"Poll id already used": "IT_L'identifiant est déjà utilisé",
"You can't select more than %d dates": "IT_Vous ne pouvez pas choisir plus de %d dates"
"You can't select more than %d dates": "IT_Vous ne pouvez pas choisir plus de %d dates",
"Can't create the config.php file in '%s'.": "IT_Impossible de créer le fichier config.php dans '%s'."
},
"Check": {
"Installation checking": "IT_Vérifications de l'installation",
......
......@@ -379,7 +379,8 @@
"The column already exists": "La colomna existís ja",
"MISSING_VALUES": "Mancan de valors",
"CANT_CONNECT_TO_DATABASE": "Impossible de se connectar a la banca de donadas",
"You can't select more than %d dates": "OC_Vous ne pouvez pas choisir plus de %d dates"
"You can't select more than %d dates": "OC_Vous ne pouvez pas choisir plus de %d dates",
"Can't create the config.php file in '%s'.": "OC_Impossible de créer le fichier config.php dans '%s'."
},
"Check": {
"Installation checking": "OC_Vérifications de l'installation",
......
Supports Markdown
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