當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。