當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Vtiger_Package::getShortDescriptionFromZip方法代碼示例

本文整理匯總了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;
 }
開發者ID:kduqi,項目名稱:corebos,代碼行數:70,代碼來源:utils.php


注:本文中的Vtiger_Package::getShortDescriptionFromZip方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。