2 namespace TYPO3\CMS\Impexp\Utility;
35 public function importT3DFile($file, $pid)
37 if (!is_string($file)) {
38 throw new \InvalidArgumentException(
'Input parameter $file has to be of type string', 1377625645);
41 throw new \InvalidArgumentException(
'Input parameter $int has to be of type integer', 1377625646);
45 $import->init(0,
'import');
50 if ($file && @is_file($file)) {
51 if ($import->loadFile($file, 1)) {
53 $import->importData($pid);
55 $newPages = $import->import_mapId[
'pages'];
56 $importResponse = (int)reset($newPages);
61 $errors = $import->printErrorLog();
65 $logger->warning($errors);
67 if (!$importResponse) {
68 throw new \ErrorException(
'No page records imported', 1377625537);
71 return $importResponse;