#18445087 : make easy install install db and do update, too

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6966 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
haneul 2009-11-24 10:12:02 +00:00
parent fd82efce3f
commit ddcbf01c84

View file

@ -40,11 +40,37 @@
FileHandler::writeFile($this->download_file, $buff);
}
function installModule()
{
$path_array = explode("/", $this->package->path);
$target_name = array_pop($path_array);
$type = substr(array_pop($path_array), 0, -1);
if($type == "module")
{
$oModuleModel = &getModel('module');
$oInstallController = &getController('install');
$module_path = ModuleHandler::getModulePath($target_name);
if($oModuleModel->checkNeedInstall($target_name))
{
$oInstallController->installModule($target_name, $module_path);
}
if($oModuleModel->checkNeedUpdate($target_name))
{
$oModule = &getModule($target_name, 'class');
if(method_exists($oModule, 'moduleUpdate'))
{
$oModule->moduleUpdate();
}
}
}
}
function install()
{
$this->_download();
$file_list = $this->_unPack();
$this->_copyDir($file_list);
$this->installModule();
FileHandler::removeDir($this->temp_dir);
return;