Make configure script compatbile with windows
This commit is contained in:
parent
bb11325716
commit
f065bd3233
@ -20,9 +20,9 @@ $configDir = realpath(dirname(__FILE__)).'/config';
|
||||
$appconfigDir = APPLICATION_PATH.'/configs';
|
||||
$hostname = exec('echo $(hostname)');
|
||||
|
||||
passthru('cp -fv '.
|
||||
$configDir.'/'.$hostname.'/application.ini' . ' ' .
|
||||
$appconfigDir.'/application.ini');
|
||||
if ( !file_exists( $appconfigDir.'/application.ini') ) {
|
||||
copy($configDir.'/'.$hostname.'/application.ini', $appconfigDir.'/application.ini');
|
||||
}
|
||||
|
||||
/** Zend_Application */
|
||||
require_once 'Zend/Application.php';
|
||||
@ -38,7 +38,6 @@ try {
|
||||
//Options
|
||||
array(
|
||||
'help|?' => "Affiche les informations d'utilisation",
|
||||
'check' => "Vérifie la configuration suivant le fichier de config installé",
|
||||
'install' => "Installe et configure",
|
||||
)
|
||||
);
|
||||
@ -55,42 +54,67 @@ if(isset($opts->help))
|
||||
exit;
|
||||
}
|
||||
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
|
||||
if(isset($opts->check))
|
||||
if(isset($opts->install))
|
||||
{
|
||||
echo "Démarrage de la configuration.\n";
|
||||
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
|
||||
}
|
||||
elseif(isset($opts->install))
|
||||
{
|
||||
//Create data directory and all his children
|
||||
mkdir(APPLICATION_PATH.'/../data');
|
||||
mkdir(APPLICATION_PATH.'/../data/cache');
|
||||
mkdir(APPLICATION_PATH.'/../data/cache/giant');
|
||||
mkdir(APPLICATION_PATH.'/../data/files');
|
||||
mkdir(APPLICATION_PATH.'/../data/infogreffe');
|
||||
mkdir(APPLICATION_PATH.'/../data/log');
|
||||
mkdir(APPLICATION_PATH.'/../data/rss');
|
||||
mkdir(APPLICATION_PATH.'/../data/sessions');
|
||||
mkdir(APPLICATION_PATH.'/../data/wsdl');
|
||||
if ( !file_exists(APPLICATION_PATH.'/../data') ) exit(1);
|
||||
|
||||
//Modification des permissions
|
||||
passthru('chown -R www-data: '.APPLICATION_PATH.'/../');
|
||||
if ( !file_exists(APPLICATION_PATH.'/../data/cache') )
|
||||
mkdir(APPLICATION_PATH.'/../data/cache');
|
||||
|
||||
//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(APPLICATION_PATH.'/../data/cache/giant') )
|
||||
mkdir(APPLICATION_PATH.'/../data/cache/giant');
|
||||
|
||||
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(APPLICATION_PATH.'/../data/files') )
|
||||
mkdir(APPLICATION_PATH.'/../data/files');
|
||||
|
||||
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(APPLICATION_PATH.'/../data/infogreffe') )
|
||||
mkdir(APPLICATION_PATH.'/../data/infogreffe');
|
||||
|
||||
if (!file_exists($c->profil->path->pages.'/fichier/logo'))
|
||||
passthru('ln -vs '.$c->profil->path->data.'/logos '.$c->profil->path->pages.'/fichier/logo');
|
||||
if ( !file_exists(APPLICATION_PATH.'/../data/log') )
|
||||
mkdir(APPLICATION_PATH.'/../data/log');
|
||||
|
||||
if ( !file_exists(APPLICATION_PATH.'/../data/rss') )
|
||||
mkdir(APPLICATION_PATH.'/../data/rss');
|
||||
|
||||
if ( !file_exists(APPLICATION_PATH.'/../data/sessions') )
|
||||
mkdir(APPLICATION_PATH.'/../data/sessions');
|
||||
|
||||
if ( !file_exists(APPLICATION_PATH.'/../data/wsdl') )
|
||||
mkdir(APPLICATION_PATH.'/../data/wsdl');
|
||||
|
||||
if ( substr(strtoupper(PHP_OS),0,3) == 'WIN' ) {
|
||||
|
||||
echo "Windows OS : Créer les liens symboliques pour l'impression. Voir script d'install.";
|
||||
echo "\n";
|
||||
|
||||
} 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');
|
||||
|
||||
//Modification des permissions
|
||||
passthru('chown -R www-data: '.APPLICATION_PATH.'/../');
|
||||
}
|
||||
|
||||
|
||||
echo "Fin de la configuration.\n";
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user