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


PHP Vtiger_Package::update方法代碼示例

本文整理匯總了PHP中Vtiger_Package::update方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vtiger_Package::update方法的具體用法?PHP Vtiger_Package::update怎麽用?PHP Vtiger_Package::update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Vtiger_Package的用法示例。


在下文中一共展示了Vtiger_Package::update方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: updateUserModuleStep3

 public function updateUserModuleStep3(Vtiger_Request $request)
 {
     $importModuleName = $request->get('module_import_name');
     $uploadFile = $request->get('module_import_file');
     $uploadDir = Settings_ModuleManager_Module_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);
     $result = array('success' => true, 'importModuleName' => $importModuleName);
     $response = new Vtiger_Response();
     $response->setResult($result);
     $response->emit();
 }
開發者ID:rcrrich,項目名稱:YetiForceCRM,代碼行數:25,代碼來源:Basic.php

示例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!");
        }
    }
}
開發者ID:yunter,項目名稱:crm,代碼行數:32,代碼來源:utils.php

示例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!");
        }
    }
}
開發者ID:jgjermeni,項目名稱:corebos,代碼行數:25,代碼來源:utils.php

示例4: 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

示例5: installCurrentVersion

 public function installCurrentVersion()
 {
     $this->connect();
     $updateURL = $this->getUpdateUrl();
     $filename = sys_get_temp_dir() . "/autoupdater." . md5($updateURL) . ".zip";
     global $root_directory;
     if (!is_writeable(sys_get_temp_dir()) && is_writeable($root_directory . "/test/")) {
         $filename = $root_directory . "/test/autoupdater.zip";
     }
     if (!is_writeable(sys_get_temp_dir()) && !is_writeable($root_directory . "/test/")) {
         echo "<strong style='color:red;'>ERROR</strong> - You need to make the <b>test</b> directory inside vtiger root writable for webserver user!";
         return;
     }
     $data = $this->_client->call("downloadVersion", array(base64_encode($updateURL), sha1(base64_encode($updateURL) . "ASD,.2#*")));
     if (!empty($_REQUEST["stefanDebug"])) {
         /* ONLY DEBUG*/
         echo "<pre>";
         var_dump($this->_client->debug_str);
     }
     $data = base64_decode($data);
     file_put_contents($filename, $data);
     $package = new \Vtiger_Package();
     $package->update(\Vtiger_Module::getInstance($this->_extension), $filename);
 }
開發者ID:Neodracir,項目名稱:VtigerCRM-Tools,代碼行數:24,代碼來源:AutoUpdate.php

示例6: handle

	public function handle() {
		if ($this->interactive) {
			echo "------------------------------------ >>> UPDATE 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 not found!\n";
			} else {
				echo "Updating ...";
				$package->update($moduleInstance, $path);
				echo "DONE.\n";
			}			
			
		} else {
			throw new Exception("Package file $path not found.");
		}
		
		echo "----------------------------------\n\n";
	}
開發者ID:Wasage,項目名稱:werpa,代碼行數:33,代碼來源:console.php


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