本文整理汇总了PHP中Vtiger_Package::getTemporaryFilePath方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Package::getTemporaryFilePath方法的具体用法?PHP Vtiger_Package::getTemporaryFilePath怎么用?PHP Vtiger_Package::getTemporaryFilePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Package
的用法示例。
在下文中一共展示了Vtiger_Package::getTemporaryFilePath方法的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;
}
}