Refactor Configuration

This commit is contained in:
Romain Neutron
2012-02-22 18:05:35 +01:00
parent ecc8feb143
commit aa9d5171b0
12 changed files with 170 additions and 350 deletions

View File

@@ -70,21 +70,9 @@ class setup
public static function is_installed()
{
$appConf = new \Alchemy\Phrasea\Core\Configuration\Application();
$installed = false;
try
{
$appConf->getConfigurationFile();
$appConf->getConnexionFile();
$appConf->getServiceFile();
$installed = true;
}
catch (\Exception $e)
{
$appConf = new \Alchemy\Phrasea\Core\Configuration\ApplicationSpecification();
}
return $installed;
return $appConf->isSetup();
}
public static function needUpgradeConfigurationFile()
@@ -817,38 +805,10 @@ class setup
}
}
$appConf = new \Alchemy\Phrasea\Core\Configuration\Application();
try
{
$configFile = $appConf->getConfigurationFile();
unlink($configFile->getPathname());
}
catch (\Exception $e)
{
}
try
{
$serviceFile = $appConf->getServiceFile();
unlink($serviceFile->getPathname());
}
catch (\Exception $e)
{
}
try
{
$connexionfFile = $appConf->getConnexionFile();
unlink($connexionfFile->getPathname());
}
catch (\Exception $e)
{
}
$appConf = new \Alchemy\Phrasea\Core\Configuration\ApplicationSpecification();
$appConf->delete();
return;
}