Always config
This commit is contained in:
parent
711efe226c
commit
a738f80c86
@ -52,7 +52,7 @@ try {
|
||||
exit;
|
||||
}
|
||||
|
||||
//Usage
|
||||
// --- Usage
|
||||
if (isset($opts->help))
|
||||
{
|
||||
echo $opts->getUsageMessage();
|
||||
@ -64,30 +64,26 @@ if ($opts->install)
|
||||
{
|
||||
echo date('Y-m-d H:i:s')." - Démarrage de la configuration.\n";
|
||||
|
||||
//Copy configuration
|
||||
// --- Configuration
|
||||
$configDir = realpath(dirname(__FILE__)).'/profil';
|
||||
$appconfigDir = APPLICATION_PATH.'/configs';
|
||||
$profil = $opts->install;
|
||||
|
||||
if ( ! file_exists($appconfigDir.'/application.ini') ) {
|
||||
$result = copy($configDir.'/'.$profil.'/application.ini', $appconfigDir.'/application.ini');
|
||||
if ($result !== true) {
|
||||
echo date('Y-m-d H:i:s')." - Impossible de copier la configuration.\n";
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
echo date('Y-m-d H:i:s')." - Le profil de configuration existe déja.\n";
|
||||
// --- Copy configuration file always
|
||||
$result = copy($configDir.'/'.$profil.'/application.ini', $appconfigDir.'/application.ini');
|
||||
if ($result !== true) {
|
||||
echo date('Y-m-d H:i:s')." - Impossible de copier la configuration.\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Create application, bootstrap, and run
|
||||
|
||||
// --- Create application, bootstrap, and run
|
||||
$application = new Zend_Application(
|
||||
APPLICATION_ENV,
|
||||
APPLICATION_PATH . '/configs/application.ini'
|
||||
);
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
|
||||
//Create data directory and all his children
|
||||
// --- Create data directory and all his children
|
||||
$dirToCreate = array(
|
||||
APPLICATION_PATH.'/../data',
|
||||
APPLICATION_PATH.'/../data/sessions',
|
||||
@ -99,7 +95,7 @@ if ($opts->install)
|
||||
}
|
||||
|
||||
if ( substr(strtoupper(PHP_OS),0,3) != 'WIN' ) {
|
||||
//Modification des permissions
|
||||
// --- Modification des permissions
|
||||
passthru('chown -R www-data: '.APPLICATION_PATH.'/../');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user