当前位置: 首页>>代码示例>>PHP>>正文


PHP Vtiger_Package::import方法代码示例

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


在下文中一共展示了Vtiger_Package::import方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: updateUserModuleStep3

 public function updateUserModuleStep3(Vtiger_Request $request)
 {
     $importModuleName = $request->get('module_import_name');
     $uploadFile = $request->get('module_import_file');
     $uploadDir = Settings_ModuleManager_Extension_Model::getUploadDirectory();
     $uploadFileName = "{$uploadDir}/{$uploadFile}";
     checkFileAccess($uploadFileName);
     $importType = $request->get('module_import_type');
     if (strtolower($importType) == 'language') {
         $package = new Vtiger_Language();
     } else {
         if (strtolower($importType) == 'layout') {
             $package = new Vtiger_Layout();
         } else {
             $package = new Vtiger_Package();
         }
     }
     if (strtolower($importType) == 'language' || strtolower($importType) == 'layout') {
         $package->import($uploadFileName);
     } else {
         $package->update(Vtiger_Module::getInstance($importModuleName), $uploadFileName);
     }
     checkFileAccessForDeletion($uploadFileName);
     unlink($uploadFileName);
     $result = array('success' => true, 'importModuleName' => $importModuleName);
     $response = new Vtiger_Response();
     $response->setResult($result);
     $response->emit();
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:29,代码来源:Basic.php

示例2: installVtlibModule

function installVtlibModule($packagename, $packagepath, $customized = false)
{
    global $log;
    require_once 'vtlib/Vtiger/Package.php';
    require_once 'vtlib/Vtiger/Module.php';
    $Vtiger_Utils_Log = true;
    $package = new Vtiger_Package();
    $module = $package->getModuleNameFromZip($packagepath);
    $module_exists = false;
    $module_dir_exists = false;
    if ($module == null) {
        $log->fatal("{$packagename} Module zipfile is not valid!");
    } else {
        if (Vtiger_Module::getInstance($module)) {
            $log->fatal("{$module} already exists!");
            $module_exists = true;
        }
    }
    if ($module_exists == false) {
        $log->debug("{$module} - Installation starts here");
        $package->import($packagepath, true);
        $moduleInstance = Vtiger_Module::getInstance($module);
        if (empty($moduleInstance)) {
            $log->fatal("{$module} module installation failed!");
        }
    }
}
开发者ID:vtiger-jp,项目名称:vtigercrm-5.1.x-ja,代码行数:27,代码来源:utils.php

示例3: updateUserModuleStep3

 public function updateUserModuleStep3(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $qualifiedModuleName = $request->getModule(false);
     $importModuleName = $request->get('module_import_name');
     $uploadFile = $request->get('module_import_file');
     $uploadDir = Settings_ModuleManager_Extension_Model::getUploadDirectory();
     $uploadFileName = "{$uploadDir}/{$uploadFile}";
     checkFileAccess($uploadFileName);
     $importType = $request->get('module_import_type');
     if (strtolower($importType) == 'language') {
         $package = new Vtiger_Language();
     } else {
         $package = new Vtiger_Package();
     }
     if (strtolower($importType) == 'language') {
         $package->import($uploadFileName);
     } else {
         $package->update(Vtiger_Module::getInstance($importModuleName), $uploadFileName);
     }
     checkFileAccessForDeletion($uploadFileName);
     unlink($uploadFileName);
     $viewer->assign("UPDATE_MODULE_NAME", $importModuleName);
     $viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
     $viewer->view('UpdateUserModuleStep3.tpl', $qualifiedModuleName);
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:26,代码来源:ModuleImport.php

示例4: handle

	public function handle() {
		if ($this->interactive) {
			echo "------------------------------------ >>> IMPORT MODULE <<< ---\n";
			do {
				$path = $this->prompt("Enter package path: ", self::PROMPT_PATH);
				if (file_exists($path)) {
					break;
				}
				echo "ERROR: " . $path . " - file not found, try another.\n";
			} while (true);
		} else {
			$path = array_shift($this->arguments);
		}
		
		if (file_exists($path)) {
			$package = new Vtiger_Package();
			$module  = $package->getModuleNameFromZip($path);
			
			$moduleInstance = Vtiger_Module::getInstance($module);
			if ($moduleInstance) {
				echo "ERROR: Module $module already exists!\n";
			} else {
				echo "Importing ...";
				$package->import($path);
				echo "DONE.\n";
			}			
			
		} else {
			throw new Exception("Package file $path not found.");
		}
		
		echo "----------------------------------\n\n";
	}
开发者ID:Wasage,项目名称:werpa,代码行数:33,代码来源:console.php


注:本文中的Vtiger_Package::import方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。