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

This commit is contained in:
Antonin 2016-05-04 01:27:51 +02:00
parent 59f437d80e
commit b739683d96
8 changed files with 22 additions and 14 deletions

View File

@ -4,16 +4,16 @@
* is not distributed with this file, you can obtain one at * is not distributed with this file, you can obtain one at
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
* *
* Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphaël DROZ * Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Rapha<EFBFBD>l DROZ
* Authors of Framadate/OpenSondate: Framasoft (https://github.com/framasoft) * Authors of Framadate/OpenSondate: Framasoft (https://github.com/framasoft)
* *
* ============================= * =============================
* *
* Ce logiciel est régi par la licence CeCILL-B. Si une copie de cette licence * Ce logiciel est r<EFBFBD>gi par la licence CeCILL-B. Si une copie de cette licence
* ne se trouve pas avec ce fichier vous pouvez l'obtenir sur * ne se trouve pas avec ce fichier vous pouvez l'obtenir sur
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt * http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt
* *
* Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ * Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Rapha<EFBFBD>l DROZ
* Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft) * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft)
*/ */
namespace Framadate\Services; namespace Framadate\Services;
@ -62,7 +62,9 @@ class InstallService {
} }
// Write configuration to conf.php file // 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(); return $this->ok();
} }
@ -85,14 +87,14 @@ class InstallService {
$content = $smarty->fetch('admin/config.tpl'); $content = $smarty->fetch('admin/config.tpl');
$this->writeToFile($content); return $this->writeToFile($content);
} }
/** /**
* @param $content * @param $content
*/ */
function writeToFile($content) { function writeToFile($content) {
file_put_contents(CONF_FILENAME, $content); return @file_put_contents(CONF_FILENAME, $content);
} }
/** /**

View File

@ -34,9 +34,9 @@ if (ini_get('date.timezone') == '') {
define('ROOT_DIR', __DIR__ . '/../../'); define('ROOT_DIR', __DIR__ . '/../../');
define('CONF_FILENAME', ROOT_DIR . '/app/inc/config.php'); 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'; @include_once __DIR__ . '/config.php';
// Connection to database // Connection to database

View File

@ -383,7 +383,8 @@
"Password is empty": "DE_Le mot de passe est vide.", "Password is empty": "DE_Le mot de passe est vide.",
"Passwords do not match": "DE_Les mot de passes ne correspondent pas.", "Passwords do not match": "DE_Les mot de passes ne correspondent pas.",
"Poll id already used": "DE_L'identifiant est déjà utilisé", "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": { "Check": {
"Installation checking": "DE_Vérifications de l'installation", "Installation checking": "DE_Vérifications de l'installation",

View File

@ -384,7 +384,8 @@
"Password is empty": "Password is empty.", "Password is empty": "Password is empty.",
"Passwords do not match": "Passwords do not match.", "Passwords do not match": "Passwords do not match.",
"Poll id already used": "Identifier is already used", "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": { "Check": {
"Installation checking": "Installation checking", "Installation checking": "Installation checking",

View File

@ -383,7 +383,8 @@
"Password is empty": "ES_Le mot de passe est vide.", "Password is empty": "ES_Le mot de passe est vide.",
"Passwords do not match": "ES_Les mot de passes ne correspondent pas.", "Passwords do not match": "ES_Les mot de passes ne correspondent pas.",
"Poll id already used": "ES_L'identifiant est déjà utilisé", "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": { "Check": {
"Installation checking": "ES_Vérifications de l'installation", "Installation checking": "ES_Vérifications de l'installation",

View File

@ -397,7 +397,8 @@
"Password is empty": "Le mot de passe est vide.", "Password is empty": "Le mot de passe est vide.",
"Passwords do not match": "Les mots de passe ne correspondent pas.", "Passwords do not match": "Les mots de passe ne correspondent pas.",
"Poll id already used": "L'identifiant est déjà utilisé", "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": { "Check": {
"Installation checking": "Vérifications de l'installation", "Installation checking": "Vérifications de l'installation",

View File

@ -381,7 +381,8 @@
"MISSING_VALUES": "Valori mancanti", "MISSING_VALUES": "Valori mancanti",
"CANT_CONNECT_TO_DATABASE": "Impossibile connettersi al database", "CANT_CONNECT_TO_DATABASE": "Impossibile connettersi al database",
"Poll id already used": "IT_L'identifiant est déjà utilisé", "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": { "Check": {
"Installation checking": "IT_Vérifications de l'installation", "Installation checking": "IT_Vérifications de l'installation",

View File

@ -379,7 +379,8 @@
"The column already exists": "La colomna existís ja", "The column already exists": "La colomna existís ja",
"MISSING_VALUES": "Mancan de valors", "MISSING_VALUES": "Mancan de valors",
"CANT_CONNECT_TO_DATABASE": "Impossible de se connectar a la banca de donadas", "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": { "Check": {
"Installation checking": "OC_Vérifications de l'installation", "Installation checking": "OC_Vérifications de l'installation",