本文整理匯總了PHP中Vtiger_Package::getAvailableModuleInfoFromModuleBundle方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vtiger_Package::getAvailableModuleInfoFromModuleBundle方法的具體用法?PHP Vtiger_Package::getAvailableModuleInfoFromModuleBundle怎麽用?PHP Vtiger_Package::getAvailableModuleInfoFromModuleBundle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vtiger_Package
的用法示例。
在下文中一共展示了Vtiger_Package::getAvailableModuleInfoFromModuleBundle方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: installSelectedOptionalModules
public static function installSelectedOptionalModules($selected_modules, $source_directory = '', $destination_directory = '')
{
require_once 'vtlib/Vtiger/Package.php';
require_once 'vtlib/Vtiger/Module.php';
require_once 'include/utils/utils.php';
$selected_modules = explode(":", $selected_modules);
$languagePacks = array();
if ($handle = opendir('packages/vtiger/optional')) {
while (false !== ($file = readdir($handle))) {
$filename_arr = explode(".", $file);
if ($filename_arr[count($filename_arr) - 1] != 'zip') {
continue;
}
$packagename = $filename_arr[0];
$packagepath = "packages/vtiger/optional/{$file}";
$package = new Vtiger_Package();
$module = $package->getModuleNameFromZip($packagepath);
if (!empty($packagename) && in_array($module, $selected_modules)) {
if ($package->isLanguageType($packagepath)) {
$languagePacks[$module] = $packagepath;
continue;
}
if ($module != null) {
if ($package->isModuleBundle()) {
$unzip = new Vtiger_Unzip($packagepath);
$unzip->unzipAllEx($package->getTemporaryFilePath());
$moduleInfoList = $package->getAvailableModuleInfoFromModuleBundle();
foreach ($moduleInfoList as $moduleInfo) {
$moduleInfo = (array) $moduleInfo;
$packagepath = $package->getTemporaryFilePath($moduleInfo['filepath']);
$subModule = new Vtiger_Package();
$subModuleName = $subModule->getModuleNameFromZip($packagepath);
$moduleInstance = Vtiger_Module::getInstance($subModuleName);
if ($moduleInstance) {
updateVtlibModule($subModuleName, $packagepath);
} else {
installVtlibModule($subModuleName, $packagepath);
}
}
} else {
$moduleInstance = Vtiger_Module::getInstance($module);
if ($moduleInstance) {
updateVtlibModule($module, $packagepath);
} else {
installVtlibModule($module, $packagepath);
}
}
}
}
}
closedir($handle);
}
foreach ($languagePacks as $module => $packagepath) {
installVtlibModule($module, $packagepath);
continue;
}
}