本文整理汇总了PHP中Vtiger_Package::getShortDescriptionFromZip方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Package::getShortDescriptionFromZip方法的具体用法?PHP Vtiger_Package::getShortDescriptionFromZip怎么用?PHP Vtiger_Package::getShortDescriptionFromZip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Package
的用法示例。
在下文中一共展示了Vtiger_Package::getShortDescriptionFromZip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstallableModulesFromPackages
public static function getInstallableModulesFromPackages()
{
global $optionalModuleStrings;
require_once 'vtlib/Vtiger/Package.php';
require_once 'vtlib/Vtiger/Module.php';
require_once 'vtlib/Vtiger/Version.php';
$packageDir = cbPackageDirectory . 'optional/';
$handle = opendir($packageDir);
$optionalModules = array();
while (false !== ($file = readdir($handle))) {
$packageNameParts = explode(".", $file);
if ($packageNameParts[count($packageNameParts) - 1] != 'zip') {
continue;
}
array_pop($packageNameParts);
$packageName = implode("", $packageNameParts);
if (!empty($packageName)) {
$packagepath = "{$packageDir}/{$file}";
$package = new Vtiger_Package();
$moduleName = $package->getModuleNameFromZip($packagepath);
$desc = $package->getShortDescriptionFromZip($packagepath);
if ($package->isModuleBundle()) {
$bundleOptionalModule = array();
$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();
$subModule->getModuleNameFromZip($packagepath);
$bundleOptionalModule = self::getOptionalModuleDetails($subModule, $bundleOptionalModule);
}
$moduleDetails = array();
$moduleDetails['description'] = empty($desc) ? $optionalModuleStrings[$moduleName . '_description'] : $desc;
$moduleDetails['selected'] = true;
$moduleDetails['enabled'] = true;
$migrationAction = 'install';
if (isset($bundleOptionalModule['update']) && count($bundleOptionalModule['update']) > 0) {
$moduleDetails['enabled'] = false;
$migrationAction = 'update';
}
$optionalModules[$migrationAction]['module'][$moduleName] = $moduleDetails;
} else {
if ($package->isLanguageType()) {
$package = new Vtiger_Language();
$package->getModuleNameFromZip($packagepath);
}
$optionalModules = self::getOptionalModuleDetails($package, $optionalModules);
}
}
}
if (is_array($optionalModules['install']['language']) && is_array($optionalModules['install']['module'])) {
$optionalModules['install'] = array_merge($optionalModules['install']['module'], $optionalModules['install']['language']);
} elseif (is_array($optionalModules['install']['language']) && !is_array($optionalModules['install']['module'])) {
$optionalModules['install'] = $optionalModules['install']['language'];
} else {
$optionalModules['install'] = $optionalModules['install']['module'];
}
if (isset($optionalModules['update']['language']) or isset($optionalModules['update']['module'])) {
if (is_array($optionalModules['update']['language']) && is_array($optionalModules['update']['module'])) {
$optionalModules['update'] = array_merge($optionalModules['update']['module'], $optionalModules['update']['language']);
} elseif (is_array($optionalModules['update']['language']) && !is_array($optionalModules['update']['module'])) {
$optionalModules['update'] = $optionalModules['update']['language'];
} else {
$optionalModules['update'] = $optionalModules['update']['module'];
}
}
return $optionalModules;
}