Toujours ecrasé la configuration

This commit is contained in:
Michael RICOIS 2015-09-25 08:41:30 +00:00
parent 3f0c5ff9cc
commit 629738175e

View File

@ -61,22 +61,23 @@ if(isset($opts->install))
{
echo date('Y-m-d H:i:s')." - Démarrage de la configuration.\n";
//Copy configuration
// --- Copy configuration
$configDir = realpath(dirname(__FILE__)).'/profil';
$appconfigDir = APPLICATION_PATH.'/configs';
$profil = $opts->install;
$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);
if ($profil == 'local') {
echo date('Y-m-d H:i:s')." - Local dev, copie scripts/build/profil/local/application.ini to application/configs/.\n";
} else {
$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
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
// --- 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
@ -89,7 +90,6 @@ if(isset($opts->install))
APPLICATION_PATH.'/../data/log',
APPLICATION_PATH.'/../data/rss',
APPLICATION_PATH.'/../data/sessions',
APPLICATION_PATH.'/../data/wsdl',
APPLICATION_PATH.'/../data/sessions',
APPLICATION_PATH.'/../data/wsdl',
);
@ -107,20 +107,10 @@ if(isset($opts->install))
} else {
//Création des liens symboliques pour l'impression
if ( ! file_exists($c->profil->path->pages.'/themes/default/images') )
passthru('ln -vs '.APPLICATION_PATH.'/../public/themes/default/images '.
$c->profil->path->pages.'/themes/default/images');
if ( ! file_exists($c->profil->path->pages.'/themes/default/scripts') )
passthru('ln -vs '.APPLICATION_PATH.'/../public/themes/default/scripts '.
$c->profil->path->pages.'/themes/default/scripts');
if ( ! file_exists($c->profil->path->pages.'/fichier/imgcache') )
passthru('ln -vs '.APPLICATION_PATH.'/../data/pages/imgcache'.' '.
$c->profil->path->pages.'/fichier/imgcache');
if ( ! file_exists($c->profil->path->pages.'/fichier/logo') )
passthru('ln -vs '.$c->profil->path->data.'/logos '.$c->profil->path->pages.'/fichier/logo');
passthru('ln -vsf '.APPLICATION_PATH.'/../public/themes/default/images '.$c->profil->path->pages.'/themes/default/images');
passthru('ln -vsf '.APPLICATION_PATH.'/../public/themes/default/scripts '.$c->profil->path->pages.'/themes/default/scripts');
passthru('ln -vsf '.APPLICATION_PATH.'/../data/pages/imgcache'.' '.$c->profil->path->pages.'/fichier/imgcache');
passthru('ln -vsf '.$c->profil->path->data.'/logos '.$c->profil->path->pages.'/fichier/logo');
//Modification des permissions
passthru('chown -R www-data: '.APPLICATION_PATH.'/../');