本文整理汇总了PHP中Vtiger_Package::isModuleBundle方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Package::isModuleBundle方法的具体用法?PHP Vtiger_Package::isModuleBundle怎么用?PHP Vtiger_Package::isModuleBundle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Package
的用法示例。
在下文中一共展示了Vtiger_Package::isModuleBundle方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: importUserModuleStep2
public function importUserModuleStep2(Vtiger_Request $request)
{
$viewer = $this->getViewer($request);
$uploadDir = Settings_ModuleManager_Module_Model::getUploadDirectory();
$qualifiedModuleName = $request->getModule(false);
$uploadFile = 'usermodule_' . time() . '.zip';
$uploadFileName = "{$uploadDir}/{$uploadFile}";
$error = '';
checkFileAccess($uploadDir);
if (!move_uploaded_file($_FILES['moduleZip']['tmp_name'], $uploadFileName)) {
$error = 'LBL_ERROR_MOVE_UPLOADED_FILE';
} else {
$package = new Vtiger_Package();
$importModuleName = $package->getModuleNameFromZip($uploadFileName);
$importModuleDepVtVersion = $package->getDependentVtigerVersion();
if ($importModuleName == null) {
$error = $package->_errorText;
checkFileAccessForDeletion($uploadFileName);
unlink($uploadFileName);
} else {
// We need these information to push for Update if module is detected to be present.
$moduleLicence = vtlib_purify($package->getLicense());
$viewer->assign("MODULEIMPORT_FILE", $uploadFile);
$viewer->assign("MODULEIMPORT_TYPE", $package->type());
$viewer->assign("MODULEIMPORT_NAME", $importModuleName);
$viewer->assign("MODULEIMPORT_DEP_VTVERSION", $importModuleDepVtVersion);
$viewer->assign("MODULEIMPORT_LICENSE", $moduleLicence);
if (!$package->isLanguageType() && !$package->isUpdateType() && !$package->isModuleBundle()) {
$moduleInstance = Vtiger_Module::getInstance($importModuleName);
$moduleimport_exists = $moduleInstance ? "true" : "false";
$moduleimport_dir_name = "modules/{$importModuleName}";
$moduleimport_dir_exists = is_dir($moduleimport_dir_name) ? "true" : "false";
$viewer->assign("MODULEIMPORT_EXISTS", $moduleimport_exists);
$viewer->assign("MODULEIMPORT_DIR", $moduleimport_dir_name);
$viewer->assign("MODULEIMPORT_DIR_EXISTS", $moduleimport_dir_exists);
}
}
}
$viewer->assign('MODULEIMPORT_ERROR', $error);
$viewer->view('ImportUserModuleStep2.tpl', $qualifiedModuleName);
}
示例2: updateVtlibModule
function updateVtlibModule($module, $packagepath)
{
global $log, $_installOrUpdateVtlibModule;
if (!file_exists($packagepath)) {
return;
}
if (isset($_installOrUpdateVtlibModule[$module . $packagepath])) {
return;
}
$_installOrUpdateVtlibModule[$module . $packagepath] = 'update';
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)) {
require_once 'vtlib/Vtiger/Language.php';
$languagePack = new Vtiger_Language();
$languagePack->update(null, $packagepath, true);
return;
}
if ($module == null) {
$log->fatal("Module name is invalid");
} else {
$moduleInstance = Vtiger_Module::getInstance($module);
if ($moduleInstance || $package->isModuleBundle($packagepath)) {
$log->debug("{$module} - Module instance found - Update starts here");
$package->update($moduleInstance, $packagepath);
} else {
$log->fatal("{$module} doesn't exists!");
}
}
}
示例3: updateVtlibModule
function updateVtlibModule($module, $packagepath)
{
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)) {
require_once 'vtlib/Vtiger/Language.php';
$languagePack = new Vtiger_Language();
$languagePack->update(null, $packagepath, true);
return;
}
if ($module == null) {
$log->fatal("Module name is invalid");
} else {
$moduleInstance = Vtiger_Module::getInstance($module);
if ($moduleInstance || $package->isModuleBundle($packagepath)) {
$log->debug("{$module} - Module instance found - Update starts here");
$package->update($moduleInstance, $packagepath);
} else {
$log->fatal("{$module} doesn't exists!");
}
}
}
示例4: 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;
}
}
示例5: substr
}
$newEntryName = substr($entryName, $firstSlash + 1);
if ($newEntryName !== false) {
$za->renameIndex($i, $newEntryName);
} else {
$za->deleteIndex($i);
}
}
$za->close();
$package = new Vtiger_Package();
$moduleimport_name = $package->getModuleNameFromZip($uploadfilename);
if ($moduleimport_name == null) {
$smarty->assign("MODULEIMPORT_FAILED", "true");
$smarty->assign("MODULEIMPORT_FILE_INVALID", "true");
} else {
if (!$package->isLanguageType() && !$package->isModuleBundle()) {
$moduleInstance = Vtiger_Module::getInstance($moduleimport_name);
$moduleimport_exists = $moduleInstance ? "true" : "false";
$moduleimport_dir_name = "modules/{$moduleimport_name}";
$moduleimport_dir_exists = is_dir($moduleimport_dir_name) ? "true" : "false";
$smarty->assign("MODULEIMPORT_EXISTS", $moduleimport_exists);
$smarty->assign("MODULEIMPORT_DIR", $moduleimport_dir_name);
$smarty->assign("MODULEIMPORT_DIR_EXISTS", $moduleimport_dir_exists);
}
$moduleimport_dep_vtversion = $package->getDependentVtigerVersion();
$moduleimport_license = $package->getLicense();
$smarty->assign("MODULEIMPORT_FILE", $uploadfile);
$smarty->assign("MODULEIMPORT_TYPE", $package->type());
$smarty->assign("MODULEIMPORT_NAME", $moduleimport_name);
$smarty->assign("MODULEIMPORT_DEP_VTVERSION", $moduleimport_dep_vtversion);
$smarty->assign("MODULEIMPORT_LICENSE", $moduleimport_license);