示例#1
0
         }
     }
     if ($installError) {
         report('Error during installation process :');
         report($installError, true);
     } else {
         report('-> Patch installation done without error.');
     }
 } elseif ($exportFile->exists()) {
     //Module datas to import
     $importDatas = $exportFile->getContent();
     if (!$importDatas) {
         report('Error: no content to import or invalid content...', true);
     }
     $import = new CMS_module_import();
     if (!$import->import($importDatas, 'xml', $cms_language, $importLog)) {
         report('Error during datas importation...');
     }
     if (isset($importLog) && $importLog) {
         verbose('Import log: ');
         verbose($importLog);
     }
 } else {
     report('Error : File ' . PATH_TMP_FS . '/patch does not exists ... This file is not a valid Automne patch.', true);
 }
 //remove temporary files
 report('Start cleaning temporary files...');
 if (!CMS_file::deltree(PATH_TMP_FS)) {
     report('Error during temporary folder cleaning...');
 } else {
     verbose('-> Cleaning done.');
示例#2
0
                //try to eval PHP Array
                try {
                    $importDatas = eval('return ' . $importDatas . ';');
                } catch (Exception $e) {
                }
            }
        } else {
            $cms_message .= $cms_language->getMessage(MESSAGE_PAGE_MODULE_ERROR_NO_IMPORT_DATA) . "\n";
            break;
        }
        if (!$importDatas) {
            $cms_message .= $cms_language->getMessage(MESSAGE_PAGE_MODULE_ERROR_NO_IMPORT_DATA) . "\n";
            break;
        }
        //import datas
        if (!$import->import($importDatas, $format, $cms_language, $importLog)) {
            $cms_message .= $cms_language->getMessage(MESSAGE_PAGE_MODULE_IMPORT_ERROR) . "\n";
        } else {
            $cms_message .= $cms_language->getMessage(MESSAGE_PAGE_MODULE_IMPORT_DONE) . "\n";
        }
        if (!CMS_file::deltree(PATH_TMP_FS)) {
            $cms_message .= $cms_language->getMessage(MESSAGE_PAGE_MODULE_ERROR_CLEANING_DIR) . "\n";
        }
        break;
}
if ($cms_message) {
    $dialog->setActionMessage($cms_message);
}
if (isset($importLog) && $importLog) {
    $content = '
	<fieldset>