function installVtlibModule($packagename, $packagepath, $customized = false) { global $log, $Vtiger_Utils_Log, $_installOrUpdateVtlibModule; if (!file_exists($packagepath)) { return; } if (isset($_installOrUpdateVtlibModule[$packagename . $packagepath])) { return; } $_installOrUpdateVtlibModule[$packagename . $packagepath] = 'install'; require_once 'vtlib/Vtiger/Package.php'; require_once 'vtlib/Vtiger/Module.php'; $Vtiger_Utils_Log = defined('INSTALLATION_MODE_DEBUG') ? INSTALLATION_MODE_DEBUG : true; $package = new Vtiger_Package(); if ($package->isLanguageType($packagepath)) { $package = new Vtiger_Language(); $package->import($packagepath, true); return; } $module = $package->getModuleNameFromZip($packagepath); // Customization if ($package->isLanguageType()) { require_once 'vtlib/Vtiger/Language.php'; $languagePack = new Vtiger_Language(); @$languagePack->import($packagepath, true); return; } // END $module_exists = false; $module_dir_exists = false; if ($module == null) { $log->fatal("{$packagename} Module zipfile is not valid!"); } else { if (Vtiger_Module::getInstance($module)) { $log->fatal("{$module} already exists!"); $module_exists = true; } } if ($module_exists == false) { $log->debug("{$module} - Installation starts here"); $package->import($packagepath, true); $moduleInstance = Vtiger_Module::getInstance($module); if (empty($moduleInstance)) { $log->fatal("{$module} module installation failed!"); } } }
function installVtlibModule($packagename, $packagepath, $customized = false) { global $log; require_once 'vtlib/Vtiger/Package.php'; require_once 'vtlib/Vtiger/Module.php'; $Vtiger_Utils_Log = true; $package = new Vtiger_Package(); if ($package->isLanguageType($packagepath)) { $package = new Vtiger_Language(); $package->import($packagepath, true); return; } $module = $package->getModuleNameFromZip($packagepath); $module_exists = false; $module_dir_exists = false; if ($module == null) { $log->fatal("{$packagename} Module zipfile is not valid!"); } else { if (Vtiger_Module::getInstance($module)) { $log->fatal("{$module} already exists!"); $module_exists = true; } } if ($module_exists == false) { $log->debug("{$module} - Installation starts here"); $package->import($packagepath, true); $moduleInstance = Vtiger_Module::getInstance($module); if (empty($moduleInstance)) { $log->fatal("{$module} module installation failed!"); } } }