本文整理汇总了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();
}
示例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!");
}
}
}
示例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);
}
示例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";
}