17 include_once (
"FDL/import_tar.php");
18 include_once (
'FDL/Class.XMLSplitter.php');
28 $opt[
"analyze"] = (substr(strtolower(
getHttpVars(
"analyze",
"N")) , 0, 1) ==
"y");
37 if (isset($_FILES[
"file"])) {
39 $xmlfiles = $_FILES[
"file"][
'tmp_name'];
41 rename($xmlfiles, $xmlfiles .
".$ext");
51 $iXml = new \Dcp\Core\importXml();
52 $iXml->setPolicy($opt[
"policy"]);
53 $iXml->setImportDirectory($opt[
"dirid"]);
54 $iXml->analyzeOnly($opt[
"analyze"]);
55 return $iXml->importSingleXmlFile($xmlfiles);
66 $opt[
"analyze"] = (substr(strtolower(
getHttpVars(
"analyze",
"Y")) , 0, 1) ==
"y");
73 if (isset($_FILES[
"file"])) {
75 $zipfiles = $_FILES[
"file"][
'tmp_name'];
77 rename($zipfiles, $zipfiles .
".$ext");
87 $iXml = new \Dcp\Core\importXml();
88 $iXml->setPolicy($opt[
"policy"]);
89 $iXml->setImportDirectory($opt[
"dirid"]);
90 $iXml->analyzeOnly($opt[
"analyze"]);
92 $log = $iXml->importZipFile($zipfiles);
104 $iXml = new \Dcp\Core\importXml();
105 $iXml->setPolicy($opt[
"policy"]);
106 $iXml->setImportDirectory($opt[
"dirid"]);
107 $iXml->analyzeOnly($opt[
"analyze"]);
108 return $iXml->importXmlDirectory($splitdir);
121 catch(Exception $e) {
122 return $e->getMessage();
138 catch(Exception $e) {
139 return $e->getMessage();
153 $iXml = new \Dcp\Core\importXml();
154 $iXml->setPolicy($opt[
"policy"]);
155 $iXml->setImportDirectory($opt[
"dirid"]);
156 $iXml->analyzeOnly($opt[
"analyze"]);
157 return $iXml->importXmlFileDocument($xmlfile,
$log);
168 $zipfiles = realpath($zipfiles);
169 $ll = exec(sprintf(
"cd %s && unzip %s", $splitdir, $zipfiles) ,
$out, $retval);
170 if ($retval != 0)
$err = sprintf(_(
"export Xml : cannot unzip %s : %s") , $zipfiles, $ll);
184 catch(\Exception $e) {
185 return $e->getMessage();
extractFilesFromXmlDirectory($splitdir)
static extractFileFromXmlDocument($file)
freedom_import_xmlzip(Action &$action, $filename="")
importXmlDirectory($dbaccess, $splitdir, $opt)
importXmlDocument($dbaccess, $xmlfile, &$log, $opt)
splitXmlDocument($xmlfiles, $splitdir)
base64_decodefile($filename)
static extractFilesFromXmlDirectory($splitdir)
freedom_import_xml(Action &$action, $filename="")
getHttpVars($name, $def="", $scope="all")
extractFileFromXmlDocument($file)
static base64Decodefile($filename)
splitZipXmlDocument($zipfiles, $splitdir)
setMaxExecutionTimeTo($limit)
if($file) if($subject==""&&$file) if($subject=="") $err
static splitXmlDocument($xmlfiles, $splitdir)