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