TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Impexp\ImportExport Class Reference
Inheritance diagram for TYPO3\CMS\Impexp\ImportExport:
tx_impexp

Public Member Functions

 init ($dontCompress=0, $mode='')
 
 setHeaderBasics ()
 
 setCharset ($charset)
 
 setMetaData ($title, $description, $notes, $packager_username, $packager_name, $packager_email)
 
 addThumbnail ($imgFilepath)
 
 setPageTree ($idH)
 
 unsetExcludedSections ($idH)
 
 flatInversePageTree ($idH, $a=array())
 
 flatInversePageTree_pid ($idH, $a=array(), $pid=-1)
 
 setRecordTypesIncludeFields (array $recordTypesIncludeFields)
 
 setRecordTypeIncludeFields ($table, array $fields)
 
 export_addRecord ($table, $row, $relationLevel=0)
 
 export_addDBRelations ($relationLevel=0)
 
 export_addDBRelations_registerRelation ($fI, &$addR, $tokenID='')
 
 export_addFilesFromRelations ()
 
 export_addFilesFromSysFilesRecords ()
 
 export_addSysFile (\TYPO3\CMS\Core\Resource\File $file)
 
 export_addFile ($fI, $recordRef='', $fieldname='')
 
 flatDBrels ($dbrels)
 
 flatSoftRefs ($dbrels)
 
 compileMemoryToFileContent ($type='')
 
 createXML ()
 
 doOutputCompress ()
 
 addFilePart ($data, $compress=FALSE)
 
 importData ($pid)
 
 writeRecords_pages ($pid)
 
 writeRecords_pages_order ($pid)
 
 writeRecords_records ($pid)
 
 writeRecords_records_order ($mainPid)
 
 addSingle ($table, $uid, $pid)
 
 addToMapId ($substNEWwithIDs)
 
 getNewTCE ()
 
 unlinkTempFiles ()
 
 setRelations ()
 
 setRelations_db ($itemArray, $itemConfig)
 
 import_addFileNameToBeCopied ($fI)
 
 setFlexFormRelations ()
 
 remapListedDBRecords_flexFormCallBack ($pParams, $dsConf, $dataValue, $dataValue_ext1, $dataValue_ext2, $path)
 
 processSoftReferences_flexFormCallBack ($pParams, $dsConf, $dataValue, $dataValue_ext1, $dataValue_ext2, $path)
 
 processSoftReferences_substTokens ($tokenizedContent, $softRefCfgs, $table, $uid)
 
 processSoftReferences_saveFile ($relFileName, $cfg, $table, $uid)
 
 processSoftReferences_saveFile_createRelFile ($origDirPrefix, $fileName, $fileID, $table, $uid)
 
 writeFileVerify ($fileName, $fileID, $bypassMountCheck=FALSE)
 
 checkOrCreateDir ($dirPrefix)
 
 verifyFolderAccess ($dirPrefix, $noAlternative=FALSE)
 
 loadFile ($filename, $all=0)
 
 getNextFilePart ($fd, $unserialize=0, $name='')
 
 loadContent ($filecontent)
 
 getNextContentPart ($filecontent, &$pointer, $unserialize=0, $name='')
 
 loadInit ()
 
 fixCharsets ()
 
 displayContentOverview ()
 
 traversePageTree ($pT, &$lines, $preCode='')
 
 traversePageRecords ($pT, &$lines)
 
 traverseAllRecords ($pT, &$lines)
 
 singleRecordLines ($table, $uid, &$lines, $preCode, $checkImportInPidRecord=0)
 
 addRelations ($rels, &$lines, $preCode, $recurCheck=array(), $htmlColorClass='')
 
 addFiles ($rels, &$lines, $preCode, $htmlColorClass='', $tokenID='')
 
 checkDokType ($checkTable, $doktype)
 
 renderControls ($r)
 
 softrefSelector ($cfg)
 
 isTableStatic ($table)
 
 inclRelation ($table)
 
 isExcluded ($table, $uid)
 
 includeSoftref ($tokenID)
 
 checkPID ($pid)
 
 dontIgnorePid ($table, $uid)
 
 doesRecordExist ($table, $uid, $fields='')
 
 getRecordPath ($pid)
 
 renderSelectBox ($prefix, $value, $optValues)
 
 compareRecords ($databaseRecord, $importRecord, $table, $inverseDiff=FALSE)
 
 getRTEoriginalFilename ($string)
 
 getFileProcObj ()
 
 callHook ($name, $params)
 
 error ($msg)
 
 printErrorLog ()
 

Public Attributes

 $showStaticRelations = FALSE
 
 $fileadminFolderName = ''
 
 $mode = ''
 
 $update = FALSE
 
 $doesImport = FALSE
 
 $display_import_pid_record = ''
 
 $suggestedInsertUids = array()
 
 $import_mode = array()
 
 $global_ignore_pid = FALSE
 
 $force_all_UIDS = FALSE
 
 $showDiff = FALSE
 
 $allowPHPScripts = FALSE
 
 $enableLogging = FALSE
 
 $softrefInputValues = array()
 
 $fileIDMap = array()
 
 $maxFileSize = 1000000
 
 $maxRecordSize = 1000000
 
 $maxExportSize = 10000000
 
 $relOnlyTables = array()
 
 $relStaticTables = array()
 
 $excludeMap = array()
 
 $softrefCfg = array()
 
 $extensionDependencies = array()
 
 $dontCompress = 0
 
 $includeExtFileResources = 0
 
 $extFileResourceExtensions = 'html,htm,css'
 
 $import_mapId = array()
 
 $import_newId = array()
 
 $import_newId_pids = array()
 
 $import_data = array()
 
 $errorLog = array()
 
 $cache_getRecordPath = array()
 
 $checkPID_cache = array()
 
 $compress = 0
 
 $dat = array()
 
 $fileProcObj = ''
 

Protected Member Functions

 fixFileIDsInRelations (array $relations)
 
 removeSoftrefsHavingTheSameDatabaseRelation ($relations)
 
 filterRecordFields ($table, array $row)
 
 initializeImport ()
 
 removeSysFileReferenceRecordsFromImportDataWithRelationToMissingFile ()
 
 isFallbackStorage ($storageId)
 
 fixUidLocalInSysFileReferenceRecords ($oldFileUid, $newFileUid)
 
 fetchStorageRecords ()
 
 writeTemporaryFileFromData ($fileId, $dataKey='files_fal')
 
 writeSysFileResourceForLegacyImport (&$fileName, $fileId)
 
 migrateLegacyImportRecords ()
 
 addGeneralErrorsByTable ($table)
 

Protected Attributes

 $recordTypesIncludeFields = array()
 
 $defaultRecordIncludeFields = array('uid', 'pid')
 
 $storageObjects = array()
 
 $legacyImport = FALSE
 
 $legacyImportFolder = NULL
 
 $legacyImportTargetPath = '_imported/'
 
 $legacyImportMigrationTables
 
 $legacyImportMigrationRecords = array()
 

Detailed Description

EXAMPLE for using the impexp-class for exporting stuff:

Create and initialize: $this->export = ::makeInstance('TYPO3\CMS\Impexp\ImportExport'); $this->export->init(); Set which tables relations we will allow: $this->export->relOnlyTables[]="tt_news"; // exclusively includes. See comment in the class

Adding records: $this->export->export_addRecord("pages", $this->pageinfo); $this->export->export_addRecord("pages", ::getRecord("pages", 38)); $this->export->export_addRecord("pages", ::getRecord("pages", 39)); $this->export->export_addRecord("tt_content", ::getRecord("tt_content", 12)); $this->export->export_addRecord("tt_content", ::getRecord("tt_content", 74)); $this->export->export_addRecord("sys_template", ::getRecord("sys_template", 20));

Adding all the relations (recursively in 5 levels so relations has THEIR relations registered as well) for($a=0;$a<5;$a++) { $addR = $this->export->export_addDBRelations($a); if (!count($addR)) break; }

Finally load all the files. $this->export->export_addFilesFromRelations(); // MUST be after the DBrelations are set so that file from ALL added records are included!

Write export $out = $this->export->compileMemoryToFileContent(); T3D file Import/Export library (TYPO3 Record Document)

Author
Kasper Skårhøj kaspe.nosp@m.rYYY.nosp@m.Y@typ.nosp@m.o3.c.nosp@m.om

Definition at line 56 of file ImportExport.php.

Member Function Documentation

◆ addFilePart()

TYPO3\CMS\Impexp\ImportExport::addFilePart (   $data,
  $compress = FALSE 
)

Returns a content part for a filename being build.

Parameters
array$dataData to store in part
boolean$compressCompress file?
Returns
string Content stream.
Todo:
Define visibility

Definition at line 1385 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\$compress.

Referenced by TYPO3\CMS\Impexp\ImportExport\compileMemoryToFileContent().

◆ addFiles()

TYPO3\CMS\Impexp\ImportExport::addFiles (   $rels,
$lines,
  $preCode,
  $htmlColorClass = '',
  $tokenID = '' 
)

Add file relation entries for a record's rels-array

Parameters
array$relsArray of file IDs
array$linesOutput lines array (is passed by reference and modified)
string$preCodePre-HTML code
string$htmlColorClassAlternative HTML color class to use.
string$tokenIDToken ID if this is a softreference (in which case it only makes sense with a single element in the $rels array!)
Returns
void private
See also
singleRecordLines()
Todo:
Define visibility

Definition at line 3685 of file ImportExport.php.

◆ addGeneralErrorsByTable()

TYPO3\CMS\Impexp\ImportExport::addGeneralErrorsByTable (   $table)
protected

Log general error message for a given table

Parameters
string$tabledatabase table name
Returns
void

Definition at line 3440 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\error().

Referenced by TYPO3\CMS\Impexp\ImportExport\importData(), TYPO3\CMS\Impexp\ImportExport\traverseAllRecords(), TYPO3\CMS\Impexp\ImportExport\writeRecords_pages(), and TYPO3\CMS\Impexp\ImportExport\writeRecords_records().

◆ addRelations()

TYPO3\CMS\Impexp\ImportExport::addRelations (   $rels,
$lines,
  $preCode,
  $recurCheck = array(),
  $htmlColorClass = '' 
)

Add DB relations entries for a record's rels-array

Parameters
array$relsArray of relations
array$linesOutput lines array (is passed by reference and modified)
string$preCodePre-HTML code
array$recurCheckRecursivity check stack
string$htmlColorClassAlternative HTML color class to use.
Returns
void private
See also
singleRecordLines()
Todo:
Define visibility

Definition at line 3624 of file ImportExport.php.

◆ addSingle()

TYPO3\CMS\Impexp\ImportExport::addSingle (   $table,
  $uid,
  $pid 
)

Adds a single record to the $importData array. Also copies files to tempfolder. However all File/DB-references and flexform field contents are set to blank for now! That is done with setRelations() later

Parameters
string$tableTable name (from import memory)
integer$uidRecord UID (from import memory)
integer$pidPage id
Returns
void
See also
writeRecords()
Todo:
Define visibility

Definition at line 2009 of file ImportExport.php.

References $GLOBALS, $uid, TYPO3\CMS\Impexp\ImportExport\doesRecordExist(), and TYPO3\CMS\Impexp\ImportExport\error().

Referenced by TYPO3\CMS\Impexp\ImportExport\importData(), TYPO3\CMS\Impexp\ImportExport\writeRecords_pages(), and TYPO3\CMS\Impexp\ImportExport\writeRecords_records().

◆ addThumbnail()

TYPO3\CMS\Impexp\ImportExport::addThumbnail (   $imgFilepath)

Sets a thumbnail image to the exported file

Parameters
string$imgFilepathFilename reference, gif, jpg, png. Absolute path.
Returns
void
Todo:
Define visibility

Definition at line 486 of file ImportExport.php.

References TYPO3\CMS\Core\Utility\PathUtility\basename(), and TYPO3\CMS\Core\Utility\GeneralUtility\getUrl().

◆ addToMapId()

TYPO3\CMS\Impexp\ImportExport::addToMapId (   $substNEWwithIDs)

Registers the substNEWids in memory.

Parameters
array$substNEWwithIDsFrom tcemain to be merged into internal mapping variable in this object
Returns
void
See also
writeRecords()
Todo:
Define visibility

Definition at line 2101 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\error().

Referenced by TYPO3\CMS\Impexp\ImportExport\importData(), TYPO3\CMS\Impexp\ImportExport\writeRecords_pages(), and TYPO3\CMS\Impexp\ImportExport\writeRecords_records().

◆ callHook()

◆ checkDokType()

TYPO3\CMS\Impexp\ImportExport::checkDokType (   $checkTable,
  $doktype 
)

Verifies that a table is allowed on a certain doktype of a page

Parameters
string$checkTableTable name to check
integer$doktypedoktype value.
Returns
boolean TRUE if OK
Todo:
Define visibility

Definition at line 3791 of file ImportExport.php.

◆ checkOrCreateDir()

TYPO3\CMS\Impexp\ImportExport::checkOrCreateDir (   $dirPrefix)

Returns TRUE if directory exists and if it doesn't it will create directory and return TRUE if that succeeded.

Parameters
string$dirPrefixDirectory to create. Having a trailing slash. Must be in fileadmin/. Relative to PATH_site
Returns
boolean TRUE, if directory exists (was created)
Todo:
Define visibility

Definition at line 3002 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\error(), TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName(), and TYPO3\CMS\Core\Utility\GeneralUtility\mkdir().

Referenced by TYPO3\CMS\Impexp\ImportExport\processSoftReferences_saveFile_createRelFile().

◆ checkPID()

TYPO3\CMS\Impexp\ImportExport::checkPID (   $pid)

Checking if a PID is in the webmounts of the user

Parameters
integer$pidPage ID to check
Returns
boolean TRUE if OK
Todo:
Define visibility

Definition at line 3935 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\export_addRecord().

◆ compareRecords()

TYPO3\CMS\Impexp\ImportExport::compareRecords (   $databaseRecord,
  $importRecord,
  $table,
  $inverseDiff = FALSE 
)

Compares two records, the current database record and the one from the import memory. Will return HTML code to show any differences between them!

Parameters
array$databaseRecordDatabase record, all fields (new values)
array$importRecordImport memorys record for the same table/uid, all fields (old values)
string$tableThe table name of the record
boolean$inverseDiffInverse the diff view (switch red/green, needed for pre-update difference view)
Returns
string HTML
Todo:
Define visibility

Definition at line 4017 of file ImportExport.php.

◆ compileMemoryToFileContent()

TYPO3\CMS\Impexp\ImportExport::compileMemoryToFileContent (   $type = '')

This compiles and returns the data content for an exported file

Parameters
string$typeType of output; "xml" gives xml, otherwise serialized array, possibly compressed.
Returns
string The output file stream
Todo:
Define visibility

Definition at line 1252 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\$compress, TYPO3\CMS\Impexp\ImportExport\addFilePart(), TYPO3\CMS\Impexp\ImportExport\createXML(), and TYPO3\CMS\Impexp\ImportExport\doOutputCompress().

◆ createXML()

TYPO3\CMS\Impexp\ImportExport::createXML ( )

Creates XML string from input array

Returns
string XML content
Todo:
Define visibility

Definition at line 1276 of file ImportExport.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\array2xml().

Referenced by TYPO3\CMS\Impexp\ImportExport\compileMemoryToFileContent().

◆ displayContentOverview()

TYPO3\CMS\Impexp\ImportExport::displayContentOverview ( )

◆ doesRecordExist()

TYPO3\CMS\Impexp\ImportExport::doesRecordExist (   $table,
  $uid,
  $fields = '' 
)

Checks if the record exists

Parameters
string$tableTable name
integer$uidUID of record
string$fieldsField list to select. Default is "uid,pid
Returns
array Result of ::getRecord() which means the record if found, otherwise FALSE
Todo:
Define visibility

Definition at line 3963 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\addSingle().

◆ dontIgnorePid()

TYPO3\CMS\Impexp\ImportExport::dontIgnorePid (   $table,
  $uid 
)

Checks if the position of an updated record is configured to be corrected. This can be disabled globally and changed for elements individually.

Parameters
string$tableTable name
integer$uidUid or record
Returns
boolean TRUE if the position of the record should be updated to match the one in the import structure
Todo:
Define visibility

Definition at line 3950 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\writeRecords_pages_order(), and TYPO3\CMS\Impexp\ImportExport\writeRecords_records_order().

◆ doOutputCompress()

TYPO3\CMS\Impexp\ImportExport::doOutputCompress ( )

Returns TRUE if the output should be compressed.

Returns
boolean TRUE if compression is possible AND requested.
Todo:
Define visibility

Definition at line 1373 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\$dontCompress.

Referenced by TYPO3\CMS\Impexp\ImportExport\compileMemoryToFileContent().

◆ error()

TYPO3\CMS\Impexp\ImportExport::error (   $msg)

Sets error message in the internal error log

Parameters
stringError message
Returns
void
Todo:
Define visibility

Definition at line 4121 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\addGeneralErrorsByTable(), TYPO3\CMS\Impexp\ImportExport\addSingle(), TYPO3\CMS\Impexp\ImportExport\addToMapId(), TYPO3\CMS\Impexp\ImportExport\checkOrCreateDir(), TYPO3\CMS\Impexp\ImportExport\displayContentOverview(), TYPO3\CMS\Impexp\ImportExport\export_addDBRelations(), TYPO3\CMS\Impexp\ImportExport\export_addFile(), TYPO3\CMS\Impexp\ImportExport\export_addFilesFromRelations(), TYPO3\CMS\Impexp\ImportExport\export_addRecord(), TYPO3\CMS\Impexp\ImportExport\export_addSysFile(), TYPO3\CMS\Impexp\ImportExport\fixCharsets(), TYPO3\CMS\Impexp\ImportExport\fixUidLocalInSysFileReferenceRecords(), TYPO3\CMS\Impexp\ImportExport\getNextContentPart(), TYPO3\CMS\Impexp\ImportExport\getNextFilePart(), TYPO3\CMS\Impexp\ImportExport\import_addFileNameToBeCopied(), TYPO3\CMS\Impexp\ImportExport\importData(), TYPO3\CMS\Impexp\ImportExport\loadFile(), TYPO3\CMS\Impexp\ImportExport\processSoftReferences_saveFile(), TYPO3\CMS\Impexp\ImportExport\processSoftReferences_saveFile_createRelFile(), TYPO3\CMS\Impexp\ImportExport\removeSysFileReferenceRecordsFromImportDataWithRelationToMissingFile(), TYPO3\CMS\Impexp\ImportExport\setFlexFormRelations(), TYPO3\CMS\Impexp\ImportExport\setRelations(), TYPO3\CMS\Impexp\ImportExport\setRelations_db(), TYPO3\CMS\Impexp\ImportExport\singleRecordLines(), TYPO3\CMS\Impexp\ImportExport\unlinkTempFiles(), TYPO3\CMS\Impexp\ImportExport\writeFileVerify(), TYPO3\CMS\Impexp\ImportExport\writeRecords_records(), TYPO3\CMS\Impexp\ImportExport\writeSysFileResourceForLegacyImport(), and TYPO3\CMS\Impexp\ImportExport\writeTemporaryFileFromData().

◆ export_addDBRelations()

TYPO3\CMS\Impexp\ImportExport::export_addDBRelations (   $relationLevel = 0)

This analyses the existing added records, finds all database relations to records and adds these records to the export file. This function can be called repeatedly until it returns an empty array. In principle it should not allow to infinite recursivity, but you better set a limit... Call this BEFORE the ext_addFilesFromRelations (so files from added relations are also included of course)

Parameters
integer$relationLevelRecursion level
Returns
array overview of relations found and added: Keys [table]:[uid], values array with table and id
See also
export_addFilesFromRelations()
Todo:
Define visibility

Definition at line 761 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\error(), TYPO3\CMS\Impexp\ImportExport\export_addDBRelations_registerRelation(), TYPO3\CMS\Impexp\ImportExport\export_addRecord(), and TYPO3\CMS\Impexp\ImportExport\includeSoftref().

◆ export_addDBRelations_registerRelation()

TYPO3\CMS\Impexp\ImportExport::export_addDBRelations_registerRelation (   $fI,
$addR,
  $tokenID = '' 
)

Helper function for export_addDBRelations()

Parameters
array$fIArray with table/id keys to add
array$addRAdd array, passed by reference to be modified
string$tokenIDSoftref Token ID, if applicable.
Returns
void
See also
export_addDBRelations()
Todo:
Define visibility

Definition at line 857 of file ImportExport.php.

References $GLOBALS, TYPO3\CMS\Impexp\ImportExport\inclRelation(), TYPO3\CMS\Impexp\ImportExport\includeSoftref(), TYPO3\CMS\Impexp\ImportExport\isExcluded(), and TYPO3\CMS\Impexp\ImportExport\isTableStatic().

Referenced by TYPO3\CMS\Impexp\ImportExport\export_addDBRelations().

◆ export_addFile()

TYPO3\CMS\Impexp\ImportExport::export_addFile (   $fI,
  $recordRef = '',
  $fieldname = '' 
)

Adds a files content to the export memory

Parameters
array$fIFile information with three keys: "filename" = filename without path, "ID_absFile" = absolute filepath to the file (including the filename), "ID" = md5 hash of "ID_absFile". "relFileName" is optional for files attached to records, but mandatory for soft referenced files (since the relFileName determines where such a file should be stored!)
string$recordRefIf the file is related to a record, this is the id on the form [table]:[id]. Information purposes only.
string$fieldnameIf the file is related to a record, this is the field name it was related to. Information purposes only.
Returns
void
Todo:
Define visibility

Definition at line 1034 of file ImportExport.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\PathUtility\basename(), TYPO3\CMS\Core\Utility\PathUtility\dirname(), TYPO3\CMS\Impexp\ImportExport\error(), TYPO3\CMS\Core\Utility\GeneralUtility\formatSize(), TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName(), TYPO3\CMS\Impexp\ImportExport\getRTEoriginalFilename(), TYPO3\CMS\Core\Utility\GeneralUtility\getUrl(), TYPO3\CMS\Core\Utility\GeneralUtility\inList(), TYPO3\CMS\Core\Utility\GeneralUtility\isFirstPartOfStr(), TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), TYPO3\CMS\Core\Utility\GeneralUtility\resolveBackPath(), and TYPO3\CMS\Core\Utility\PathUtility\stripPathSitePrefix().

Referenced by TYPO3\CMS\Impexp\ImportExport\export_addFilesFromRelations().

◆ export_addFilesFromRelations()

TYPO3\CMS\Impexp\ImportExport::export_addFilesFromRelations ( )

This adds all files in relations. Call this method AFTER adding all records including relations.

Returns
void
See also
export_addDBRelations()
Todo:
Define visibility

Definition at line 875 of file ImportExport.php.

References TYPO3\CMS\Core\Utility\PathUtility\basename(), TYPO3\CMS\Impexp\ImportExport\error(), TYPO3\CMS\Impexp\ImportExport\export_addFile(), TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName(), and TYPO3\CMS\Impexp\ImportExport\includeSoftref().

◆ export_addFilesFromSysFilesRecords()

TYPO3\CMS\Impexp\ImportExport::export_addFilesFromSysFilesRecords ( )

This adds all files from sys_file records

Returns
void

Definition at line 964 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\export_addSysFile(), and TYPO3\CMS\Core\Resource\ResourceFactory\getInstance().

◆ export_addRecord()

TYPO3\CMS\Impexp\ImportExport::export_addRecord (   $table,
  $row,
  $relationLevel = 0 
)

◆ export_addSysFile()

TYPO3\CMS\Impexp\ImportExport::export_addSysFile ( \TYPO3\CMS\Core\Resource\File  $file)

Adds a files content from a sys file record to the export memory

Parameters
\TYPO3\CMS\Core\Resource\File$file
Returns
void

Definition at line 981 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\$maxFileSize, TYPO3\CMS\Impexp\ImportExport\error(), and TYPO3\CMS\Core\Utility\GeneralUtility\formatSize().

Referenced by TYPO3\CMS\Impexp\ImportExport\export_addFilesFromSysFilesRecords().

◆ fetchStorageRecords()

TYPO3\CMS\Impexp\ImportExport::fetchStorageRecords ( )
protected

Fetched fresh storage records from database because the new imported ones are not in cached data of the StorageRepository

Returns
bool|array

Definition at line 1742 of file ImportExport.php.

References $GLOBALS, TYPO3\CMS\Backend\Utility\BackendUtility\BEenableFields(), and TYPO3\CMS\Backend\Utility\BackendUtility\deleteClause().

Referenced by TYPO3\CMS\Impexp\ImportExport\importData().

◆ filterRecordFields()

TYPO3\CMS\Impexp\ImportExport::filterRecordFields (   $table,
array  $row 
)
protected

If include fields for a specific record type are set, the data are filtered out with fields are not included in the fields.

Parameters
string$tableThe record type to be filtered
array$rowThe data to be filtered
Returns
array The filtered record row

Definition at line 1222 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\export_addRecord().

◆ fixCharsets()

TYPO3\CMS\Impexp\ImportExport::fixCharsets ( )

Fix charset of import memory if different from system charset

Returns
void
See also
loadInit()
Todo:
Define visibility

Definition at line 3235 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\error().

Referenced by TYPO3\CMS\Impexp\ImportExport\loadInit().

◆ fixFileIDsInRelations()

TYPO3\CMS\Impexp\ImportExport::fixFileIDsInRelations ( array  $relations)
protected

This changes the file reference ID from a hash based on the absolute file path (coming from ReferenceIndex) to a hash based on the relative file path.

Parameters
array$relations
Returns
array

Definition at line 683 of file ImportExport.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\isFirstPartOfStr(), and TYPO3\CMS\Core\Utility\PathUtility\stripPathSitePrefix().

Referenced by TYPO3\CMS\Impexp\ImportExport\export_addRecord().

◆ fixUidLocalInSysFileReferenceRecords()

TYPO3\CMS\Impexp\ImportExport::fixUidLocalInSysFileReferenceRecords (   $oldFileUid,
  $newFileUid 
)
protected

Normally the importer works like the following: Step 1: import the records with cleared field values of relation fields (see addSingle()) Step 2: update the records with the right relation ids (see setRelations())

In step 2 the saving fields of type "relation to sys_file_reference" checks the related sys_file_reference record (created in step 1) with the FileExtensionFilter for matching file extensions of the related file. To make this work correct, the uid_local of sys_file_reference records has to be not empty AND has to relate to the correct (imported) sys_file record uid!!!

This is fixed here.

Parameters
int$oldFileUid
int$newFileUid
Returns
void

Definition at line 1699 of file ImportExport.php.

References $GLOBALS, and TYPO3\CMS\Impexp\ImportExport\error().

Referenced by TYPO3\CMS\Impexp\ImportExport\importData().

◆ flatDBrels()

TYPO3\CMS\Impexp\ImportExport::flatDBrels (   $dbrels)

DB relations flattend to 1-dim array. The list will be unique, no table/uid combination will appear twice.

Parameters
array$dbrels2-dim Array of database relations organized by table key
Returns
array 1-dim array where entries are table:uid and keys are array with table/id
Todo:
Define visibility

Definition at line 1151 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\$dat.

Referenced by TYPO3\CMS\Impexp\ImportExport\export_addRecord().

◆ flatInversePageTree()

TYPO3\CMS\Impexp\ImportExport::flatInversePageTree (   $idH,
  $a = array() 
)

Recursively flattening the idH array (for setPageTree() function)

Parameters
array$idHPage uid hierarchy
array$aAccumulation array of pages (internal, don't set from outside)
Returns
array Array with uid-uid pairs for all pages in the page tree.
See also
flatInversePageTree_pid()
Todo:
Define visibility

Definition at line 549 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\setPageTree(), TYPO3\CMS\Impexp\ImportExport\writeRecords_pages(), and TYPO3\CMS\Impexp\ImportExport\writeRecords_records_order().

◆ flatInversePageTree_pid()

TYPO3\CMS\Impexp\ImportExport::flatInversePageTree_pid (   $idH,
  $a = array(),
  $pid = -1 
)

Recursively flattening the idH array (for setPageTree() function), setting PIDs as values

Parameters
array$idHPage uid hierarchy
array$aAccumulation array of pages (internal, don't set from outside)
integer$pidPID value (internal)
Returns
array Array with uid-pid pairs for all pages in the page tree.
See also
flatInversePageTree()
Todo:
Define visibility

Definition at line 572 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\writeRecords_pages_order().

◆ flatSoftRefs()

TYPO3\CMS\Impexp\ImportExport::flatSoftRefs (   $dbrels)

Soft References flattend to 1-dim array.

Parameters
array$dbrels2-dim Array of database relations organized by table key
Returns
array 1-dim array where entries are arrays with properties of the soft link found and keys are a unique combination of field, spKey, structure path if applicable and token ID
Todo:
Define visibility

Definition at line 1177 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\$dat.

Referenced by TYPO3\CMS\Impexp\ImportExport\export_addRecord().

◆ getFileProcObj()

TYPO3\CMS\Impexp\ImportExport::getFileProcObj ( )

◆ getNewTCE()

◆ getNextContentPart()

TYPO3\CMS\Impexp\ImportExport::getNextContentPart (   $filecontent,
$pointer,
  $unserialize = 0,
  $name = '' 
)

Returns the next content part from the $filecontent

Parameters
string$filecontentFile content string
integer$pointerFile pointer (where to read from)
boolean$unserializeIf set, the returned content is unserialized into an array, otherwise you get the raw string
string$nameFor error messages this indicates the section of the problem.
Returns
string Data string
Todo:
Define visibility

Definition at line 3184 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\error().

Referenced by TYPO3\CMS\Impexp\ImportExport\loadContent().

◆ getNextFilePart()

TYPO3\CMS\Impexp\ImportExport::getNextFilePart (   $fd,
  $unserialize = 0,
  $name = '' 
)

Returns the next content part form the fileresource (t3d), $fd

Parameters
pointer$fdFile pointer
boolean$unserializeIf set, the returned content is unserialized into an array, otherwise you get the raw string
string$nameFor error messages this indicates the section of the problem.
Returns
string|NULL Data string or NULL in case of an error private
See also
loadFile()
Todo:
Define visibility

Definition at line 3125 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\error().

Referenced by TYPO3\CMS\Impexp\ImportExport\loadFile().

◆ getRecordPath()

TYPO3\CMS\Impexp\ImportExport::getRecordPath (   $pid)

Returns the page title path of a PID value. Results are cached internally

Parameters
integer$pidRecord PID to check
Returns
string The path for the input PID
Todo:
Define visibility

Definition at line 3974 of file ImportExport.php.

◆ getRTEoriginalFilename()

TYPO3\CMS\Impexp\ImportExport::getRTEoriginalFilename (   $string)

Creates the original file name for a copy-RTE image (magic type)

Parameters
string$stringRTE copy filename, eg. "RTEmagicC_user_pm_icon_01.gif.gif @return string RTE original filename, eg. "RTEmagicP_user_pm_icon_01.gif". IF the input filename was NOT prefixed RTEmagicC_ as RTE images would be, nothing is returned!
Todo:
Define visibility

Definition at line 4069 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\export_addFile(), and TYPO3\CMS\Impexp\ImportExport\processSoftReferences_saveFile().

◆ import_addFileNameToBeCopied()

TYPO3\CMS\Impexp\ImportExport::import_addFileNameToBeCopied (   $fI)

Writes the file from import array to temp dir and returns the filename of it.

Parameters
array$fIFile information with three keys: "filename" = filename without path, "ID_absFile" = absolute filepath to the file (including the filename), "ID" = md5 hash of "ID_absFile
Returns
string Absolute filename of the temporary filename of the file. In ->alternativeFileName the original name is set.
Todo:
Define visibility

Definition at line 2342 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\error(), TYPO3\CMS\Core\Utility\GeneralUtility\tempnam(), and TYPO3\CMS\Core\Utility\GeneralUtility\writeFile().

Referenced by TYPO3\CMS\Impexp\ImportExport\remapListedDBRecords_flexFormCallBack(), and TYPO3\CMS\Impexp\ImportExport\setRelations().

◆ importData()

◆ inclRelation()

TYPO3\CMS\Impexp\ImportExport::inclRelation (   $table)

Returns TRUE if the input table name is to be included as relation

Parameters
string$tableTable name
Returns
boolean TRUE, if table is marked static
Todo:
Define visibility

Definition at line 3899 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\export_addDBRelations_registerRelation().

◆ includeSoftref()

TYPO3\CMS\Impexp\ImportExport::includeSoftref (   $tokenID)

Returns TRUE if soft reference should be included in exported file.

Parameters
string$tokenIDToken ID for soft reference
Returns
boolean TRUE if softreference media should be included
Todo:
Define visibility

Definition at line 3924 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\export_addDBRelations(), TYPO3\CMS\Impexp\ImportExport\export_addDBRelations_registerRelation(), and TYPO3\CMS\Impexp\ImportExport\export_addFilesFromRelations().

◆ init()

TYPO3\CMS\Impexp\ImportExport::init (   $dontCompress = 0,
  $mode = '' 
)

Init the object, both import and export

Parameters
boolean$dontCompressIf set, compression in t3d files is disabled
string$modeMode of usage, either "import" or "export
Returns
void
Todo:
Define visibility

Definition at line 402 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\$dontCompress, $GLOBALS, and TYPO3\CMS\Impexp\ImportExport\$mode.

◆ initializeImport()

TYPO3\CMS\Impexp\ImportExport::initializeImport ( )
protected

Initialize all settings for the import

Returns
void

Definition at line 1401 of file ImportExport.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Impexp\ImportExport\importData().

◆ isExcluded()

TYPO3\CMS\Impexp\ImportExport::isExcluded (   $table,
  $uid 
)

Returns TRUE if the element should be excluded as static record.

Parameters
string$tableTable name
integer$uidUID value
Returns
boolean TRUE, if table is marked static
Todo:
Define visibility

Definition at line 3913 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\export_addDBRelations_registerRelation(), and TYPO3\CMS\Impexp\ImportExport\setRelations_db().

◆ isFallbackStorage()

TYPO3\CMS\Impexp\ImportExport::isFallbackStorage (   $storageId)
protected

Checks if the $storageId is the id of the fallback storage

Parameters
int | string$storageId
Returns
bool

Definition at line 1679 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\importData().

◆ isTableStatic()

TYPO3\CMS\Impexp\ImportExport::isTableStatic (   $table)

Returns TRUE if the input table name is to be regarded as a static relation (that is, not exported etc).

Parameters
string$tableTable name
Returns
boolean TRUE, if table is marked static
Todo:
Define visibility

Definition at line 3886 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\export_addDBRelations_registerRelation(), and TYPO3\CMS\Impexp\ImportExport\setRelations_db().

◆ loadContent()

TYPO3\CMS\Impexp\ImportExport::loadContent (   $filecontent)

Loads T3D file content into the $this->dat array (This function can be used to test the output strings from ->compileMemoryToFileContent())

Parameters
string$filecontentFile content
Returns
void
Todo:
Define visibility

Definition at line 3166 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\getNextContentPart(), and TYPO3\CMS\Impexp\ImportExport\loadInit().

◆ loadFile()

TYPO3\CMS\Impexp\ImportExport::loadFile (   $filename,
  $all = 0 
)

Loads the header section/all of the $filename into memory

Parameters
string$filenameFilename, absolute
boolean$allIf set, all information is loaded (header, records and files). Otherwise the default is to read only the header information
Returns
boolean TRUE if the operation went well
Todo:
Define visibility

Definition at line 3071 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\error(), TYPO3\CMS\Impexp\ImportExport\getNextFilePart(), TYPO3\CMS\Core\Utility\GeneralUtility\getUrl(), TYPO3\CMS\Impexp\ImportExport\loadInit(), and TYPO3\CMS\Core\Utility\GeneralUtility\xml2array().

◆ loadInit()

TYPO3\CMS\Impexp\ImportExport::loadInit ( )

Setting up the object based on the recently loaded ->dat array

Returns
void
Todo:
Define visibility

Definition at line 3216 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\fixCharsets().

Referenced by TYPO3\CMS\Impexp\ImportExport\loadContent(), and TYPO3\CMS\Impexp\ImportExport\loadFile().

◆ migrateLegacyImportRecords()

TYPO3\CMS\Impexp\ImportExport::migrateLegacyImportRecords ( )
protected

Migrate legacy import records

Returns
void

Definition at line 2924 of file ImportExport.php.

References $uid, and TYPO3\CMS\Impexp\ImportExport\getNewTCE().

Referenced by TYPO3\CMS\Impexp\ImportExport\importData().

◆ printErrorLog()

TYPO3\CMS\Impexp\ImportExport::printErrorLog ( )

Returns a table with the error-messages.

Returns
string HTML print of error log
Todo:
Define visibility

Definition at line 4131 of file ImportExport.php.

◆ processSoftReferences_flexFormCallBack()

TYPO3\CMS\Impexp\ImportExport::processSoftReferences_flexFormCallBack (   $pParams,
  $dsConf,
  $dataValue,
  $dataValue_ext1,
  $dataValue_ext2,
  $path 
)

Callback function for traversing the FlexForm structure in relation to remapping softreference relations

Parameters
array$pParamsSet of parameters in numeric array: table, uid, field
array$dsConfTCA config for field (from Data Structure of course)
string$dataValueField value (from FlexForm XML)
string$dataValue_ext1Not used
string$dataValue_ext2Not used
string$pathPath of where the data structure where the element is found
Returns
array Array where the "value" key carries the value.
See also
setFlexFormRelations()
Todo:
Define visibility

Definition at line 2557 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\processSoftReferences_substTokens().

◆ processSoftReferences_saveFile()

TYPO3\CMS\Impexp\ImportExport::processSoftReferences_saveFile (   $relFileName,
  $cfg,
  $table,
  $uid 
)

◆ processSoftReferences_saveFile_createRelFile()

TYPO3\CMS\Impexp\ImportExport::processSoftReferences_saveFile_createRelFile (   $origDirPrefix,
  $fileName,
  $fileID,
  $table,
  $uid 
)

◆ processSoftReferences_substTokens()

TYPO3\CMS\Impexp\ImportExport::processSoftReferences_substTokens (   $tokenizedContent,
  $softRefCfgs,
  $table,
  $uid 
)

Substition of softreference tokens

Parameters
string$tokenizedContentContent of field with soft reference tokens in.
array$softRefCfgsSoft reference configurations
string$tableTable for which the processing occurs
string$uidUID of record from table
Returns
string The input content with tokens substituted according to entries in softRefCfgs
Todo:
Define visibility

Definition at line 2591 of file ImportExport.php.

References $uid, TYPO3\CMS\Impexp\ImportExport\processSoftReferences_saveFile(), and TYPO3\CMS\Backend\Utility\BackendUtility\wsMapId().

Referenced by TYPO3\CMS\Impexp\ImportExport\processSoftReferences_flexFormCallBack(), and TYPO3\CMS\Impexp\ImportExport\remapListedDBRecords_flexFormCallBack().

◆ remapListedDBRecords_flexFormCallBack()

TYPO3\CMS\Impexp\ImportExport::remapListedDBRecords_flexFormCallBack (   $pParams,
  $dsConf,
  $dataValue,
  $dataValue_ext1,
  $dataValue_ext2,
  $path 
)

Callback function for traversing the FlexForm structure in relation to remapping database relations

Parameters
array$pParamsSet of parameters in numeric array: table, uid, field
array$dsConfTCA config for field (from Data Structure of course)
string$dataValueField value (from FlexForm XML)
string$dataValue_ext1Not used
string$dataValue_ext2Not used
string$pathPath of where the data structure of the element is found
Returns
array Array where the "value" key carries the value.
See also
setFlexFormRelations()
Todo:
Define visibility

Definition at line 2446 of file ImportExport.php.

References $GLOBALS, $uid, TYPO3\CMS\Impexp\ImportExport\callHook(), TYPO3\CMS\Backend\Utility\BackendUtility\getFlexFormDS(), TYPO3\CMS\Impexp\ImportExport\getNewTCE(), TYPO3\CMS\Impexp\ImportExport\import_addFileNameToBeCopied(), TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), TYPO3\CMS\Impexp\ImportExport\processSoftReferences_substTokens(), TYPO3\CMS\Impexp\ImportExport\setRelations_db(), TYPO3\CMS\Backend\Utility\BackendUtility\wsMapId(), and TYPO3\CMS\Core\Utility\GeneralUtility\xml2array().

◆ removeSoftrefsHavingTheSameDatabaseRelation()

TYPO3\CMS\Impexp\ImportExport::removeSoftrefsHavingTheSameDatabaseRelation (   $relations)
protected

Relations could contain db relations to sys_file records. Some configuration combinations of TCA and SoftReferenceIndex create also softref relation entries for the identical file. This results in double included files, one in array "files" and one in array "file_fal". This function checks the relations for this double inclusions and removes the redundant softref relation.

Parameters
array$relations
Returns
array

Definition at line 720 of file ImportExport.php.

References TYPO3\CMS\Core\Resource\ResourceFactory\getInstance().

Referenced by TYPO3\CMS\Impexp\ImportExport\export_addRecord().

◆ removeSysFileReferenceRecordsFromImportDataWithRelationToMissingFile()

TYPO3\CMS\Impexp\ImportExport::removeSysFileReferenceRecordsFromImportDataWithRelationToMissingFile ( )
protected

Removes all sys_file_reference records from the import data array that are pointing to sys_file records which are missing not in the import data to prevent exceptions on checking the related file started by the Datahandler.

Returns
void

Definition at line 1654 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\error().

Referenced by TYPO3\CMS\Impexp\ImportExport\importData().

◆ renderControls()

TYPO3\CMS\Impexp\ImportExport::renderControls (   $r)

Render input controls for import or export

Parameters
array$rConfiguration for element
Returns
string HTML
Todo:
Define visibility

Definition at line 3808 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\displayContentOverview().

◆ renderSelectBox()

TYPO3\CMS\Impexp\ImportExport::renderSelectBox (   $prefix,
  $value,
  $optValues 
)

Makes a selector-box from optValues

Parameters
string$prefixForm element name
string$valueCurrent value
array$optValuesOptions to display (key/value pairs)
Returns
string HTML select element
Todo:
Define visibility

Definition at line 3991 of file ImportExport.php.

◆ setCharset()

TYPO3\CMS\Impexp\ImportExport::setCharset (   $charset)

Set charset

Parameters
string$charsetCharset for the content in the export. During import the character set will be converted if the target system uses another charset.
Returns
void
Todo:
Define visibility

Definition at line 450 of file ImportExport.php.

◆ setFlexFormRelations()

TYPO3\CMS\Impexp\ImportExport::setFlexFormRelations ( )

After all DB relations has been set in the end of the import (see setRelations()) then it is time to correct all relations inside of FlexForm fields. The reason for doing this after is that the setting of relations may affect (quite often!) which data structure is used for the flexforms field!

Returns
void
See also
setRelations()
Todo:
Define visibility

Definition at line 2372 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\$dat, $GLOBALS, $uid, TYPO3\CMS\Impexp\ImportExport\callHook(), TYPO3\CMS\Impexp\ImportExport\error(), TYPO3\CMS\Backend\Utility\BackendUtility\getFlexFormDS(), TYPO3\CMS\Impexp\ImportExport\getNewTCE(), TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), TYPO3\CMS\Backend\Utility\BackendUtility\wsMapId(), and TYPO3\CMS\Core\Utility\GeneralUtility\xml2array().

Referenced by TYPO3\CMS\Impexp\ImportExport\importData().

◆ setHeaderBasics()

TYPO3\CMS\Impexp\ImportExport::setHeaderBasics ( )

◆ setMetaData()

TYPO3\CMS\Impexp\ImportExport::setMetaData (   $title,
  $description,
  $notes,
  $packager_username,
  $packager_name,
  $packager_email 
)

Sets meta data

Parameters
string$titleTitle of the export
string$descriptionDescription of the export
string$notesNotes about the contents
string$packager_usernameBackend Username of the packager (the guy making the export)
string$packager_nameReal name of the packager
string$packager_emailEmail of the packager
Returns
void
Todo:
Define visibility

Definition at line 466 of file ImportExport.php.

References $GLOBALS.

◆ setPageTree()

TYPO3\CMS\Impexp\ImportExport::setPageTree (   $idH)

Sets the page-tree array in the export header and returns the array in a flattened version

Parameters
array$idHHierarchy of ids, the page tree: array([uid] => array("uid" => [uid], "subrow" => array(.....)), [uid] => ....)
Returns
array The hierarchical page tree converted to a one-dimensional list of pages
Todo:
Define visibility

Definition at line 513 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\flatInversePageTree(), and TYPO3\CMS\Impexp\ImportExport\unsetExcludedSections().

◆ setRecordTypeIncludeFields()

TYPO3\CMS\Impexp\ImportExport::setRecordTypeIncludeFields (   $table,
array  $fields 
)

Sets the fields of a record type to be included in the export

Parameters
string$tableThe record type
array$fieldsThe fields to be included
Returns
void

Definition at line 612 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\setRecordTypesIncludeFields().

◆ setRecordTypesIncludeFields()

TYPO3\CMS\Impexp\ImportExport::setRecordTypesIncludeFields ( array  $recordTypesIncludeFields)

Sets the fields of record types to be included in the export

Parameters
array$recordTypesIncludeFieldsKeys are [recordname], values are an array of fields to be included in the export
Exceptions

Definition at line 596 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\setRecordTypeIncludeFields().

◆ setRelations()

TYPO3\CMS\Impexp\ImportExport::setRelations ( )

At the end of the import process all file and DB relations should be set properly (that is relations to imported records are all re-created so imported records are correctly related again) Relations in flexform fields are processed in setFlexFormRelations() after this function

Returns
void
See also
setFlexFormRelations()
Todo:
Define visibility

Definition at line 2171 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\$dat, $GLOBALS, $uid, TYPO3\CMS\Impexp\ImportExport\callHook(), TYPO3\CMS\Impexp\ImportExport\error(), TYPO3\CMS\Impexp\ImportExport\getNewTCE(), TYPO3\CMS\Impexp\ImportExport\import_addFileNameToBeCopied(), TYPO3\CMS\Impexp\ImportExport\setRelations_db(), and TYPO3\CMS\Backend\Utility\BackendUtility\wsMapId().

Referenced by TYPO3\CMS\Impexp\ImportExport\importData().

◆ setRelations_db()

TYPO3\CMS\Impexp\ImportExport::setRelations_db (   $itemArray,
  $itemConfig 
)

Maps relations for database

Parameters
array$itemArrayArray of item sets (table/uid) from a dbAnalysis object
array$itemConfigArray of TCA config of the field the relation to be set on
Returns
array Array with values [table]_[uid] or [uid] for field of type group / internal_type file_reference. These values have the regular tcemain-input group/select type which means they will automatically be processed into a uid-list or MM relations.
Todo:
Define visibility

Definition at line 2301 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\error(), TYPO3\CMS\Core\Resource\ResourceFactory\getInstance(), TYPO3\CMS\Impexp\ImportExport\isExcluded(), and TYPO3\CMS\Impexp\ImportExport\isTableStatic().

Referenced by TYPO3\CMS\Impexp\ImportExport\remapListedDBRecords_flexFormCallBack(), and TYPO3\CMS\Impexp\ImportExport\setRelations().

◆ singleRecordLines()

TYPO3\CMS\Impexp\ImportExport::singleRecordLines (   $table,
  $uid,
$lines,
  $preCode,
  $checkImportInPidRecord = 0 
)

Add entries for a single record

Parameters
string$tableTable name
integer$uidRecord uid
array$linesOutput lines array (is passed by reference and modified)
string$preCodePre-HTML code
boolean$checkImportInPidRecordIf you want import validation, you can set this so it checks if the import can take place on the specified page.
Returns
void
Todo:
Define visibility

Definition at line 3460 of file ImportExport.php.

References $GLOBALS, $uid, and TYPO3\CMS\Impexp\ImportExport\error().

Referenced by TYPO3\CMS\Impexp\ImportExport\traverseAllRecords(), TYPO3\CMS\Impexp\ImportExport\traversePageRecords(), and TYPO3\CMS\Impexp\ImportExport\traversePageTree().

◆ softrefSelector()

TYPO3\CMS\Impexp\ImportExport::softrefSelector (   $cfg)

Selectorbox with export options for soft references

Parameters
array$cfgSoftref configuration array. An export box is shown only if a substitution scheme is found for the soft reference.
Returns
string Selector box HTML
Todo:
Define visibility

Definition at line 3833 of file ImportExport.php.

◆ traverseAllRecords()

TYPO3\CMS\Impexp\ImportExport::traverseAllRecords (   $pT,
$lines 
)

Go through ALL records (if the pages are displayed first, those will not be amoung these!)

Parameters
array$pTPage tree array with uid/subrow (from ->dat[header][pagetree]
array$linesOutput lines array (is passed by reference and modified)
Returns
void
Todo:
Define visibility

Definition at line 3422 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\addGeneralErrorsByTable(), and TYPO3\CMS\Impexp\ImportExport\singleRecordLines().

Referenced by TYPO3\CMS\Impexp\ImportExport\displayContentOverview().

◆ traversePageRecords()

TYPO3\CMS\Impexp\ImportExport::traversePageRecords (   $pT,
$lines 
)

Go through remaining pages (not in tree)

Parameters
array$pTPage tree array with uid/subrow (from ->dat[header][pagetree]
array$linesOutput lines array (is passed by reference and modified)
Returns
void
Todo:
Define visibility

Definition at line 3397 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\singleRecordLines().

Referenced by TYPO3\CMS\Impexp\ImportExport\displayContentOverview().

◆ traversePageTree()

TYPO3\CMS\Impexp\ImportExport::traversePageTree (   $pT,
$lines,
  $preCode = '' 
)

Go through page tree for display

Parameters
array$pTPage tree array with uid/subrow (from ->dat[header][pagetree]
array$linesOutput lines array (is passed by reference and modified)
string$preCodePre-HTML code
Returns
void
Todo:
Define visibility

Definition at line 3367 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\singleRecordLines().

Referenced by TYPO3\CMS\Impexp\ImportExport\displayContentOverview().

◆ unlinkTempFiles()

TYPO3\CMS\Impexp\ImportExport::unlinkTempFiles ( )

Cleaning up all the temporary files stored in typo3temp/ folder

Returns
void
Todo:
Define visibility

Definition at line 2143 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\error(), TYPO3\CMS\Core\Utility\GeneralUtility\isFirstPartOfStr(), and TYPO3\CMS\Core\Utility\GeneralUtility\unlink_tempfile().

Referenced by TYPO3\CMS\Impexp\ImportExport\importData().

◆ unsetExcludedSections()

TYPO3\CMS\Impexp\ImportExport::unsetExcludedSections (   $idH)

Removes entries in the page tree which are found in ->excludeMap[]

Parameters
array$idHPage uid hierarchy
Returns
array Modified input array private
See also
setPageTree()
Todo:
Define visibility

Definition at line 527 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\setPageTree().

◆ verifyFolderAccess()

TYPO3\CMS\Impexp\ImportExport::verifyFolderAccess (   $dirPrefix,
  $noAlternative = FALSE 
)

Verifies that the input path (relative to PATH_site) is found in the backend users filemounts. If it doesn't it will try to find another relative filemount for the user and return an alternative path prefix for the file.

Parameters
string$dirPrefixPath relative to PATH_site
boolean$noAlternativeIf set, Do not look for alternative path! Just return FALSE
Returns
string If a path is available that will be returned, otherwise FALSE.
Todo:
Define visibility

Definition at line 3035 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\$fileProcObj, $result, TYPO3\CMS\Impexp\ImportExport\getFileProcObj(), and TYPO3\CMS\Core\Utility\GeneralUtility\isFirstPartOfStr().

Referenced by TYPO3\CMS\Impexp\ImportExport\processSoftReferences_saveFile_createRelFile().

◆ writeFileVerify()

TYPO3\CMS\Impexp\ImportExport::writeFileVerify (   $fileName,
  $fileID,
  $bypassMountCheck = FALSE 
)

Writes a file from the import memory having $fileID to file name $fileName which must be an absolute path inside PATH_site

Parameters
string$fileNameAbsolute filename inside PATH_site to write to
string$fileIDFile ID from import memory
boolean$bypassMountCheckBypasses the checking against filemounts - only for RTE files!
Returns
boolean Returns TRUE if it went well. Notice that the content of the file is read again, and md5 from import memory is validated.
Todo:
Define visibility

Definition at line 2816 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\$fileProcObj, $GLOBALS, TYPO3\CMS\Impexp\ImportExport\error(), TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName(), TYPO3\CMS\Impexp\ImportExport\getFileProcObj(), TYPO3\CMS\Core\Utility\GeneralUtility\getUrl(), TYPO3\CMS\Core\Utility\GeneralUtility\split_fileref(), and TYPO3\CMS\Core\Utility\GeneralUtility\writeFile().

Referenced by TYPO3\CMS\Impexp\ImportExport\processSoftReferences_saveFile(), and TYPO3\CMS\Impexp\ImportExport\processSoftReferences_saveFile_createRelFile().

◆ writeRecords_pages()

TYPO3\CMS\Impexp\ImportExport::writeRecords_pages (   $pid)

Writing pagetree/pages to database:

Parameters
integer$pidPID in which to import. If the operation is an update operation, the root of the page tree inside will be moved to this PID unless it is the same as the root page from the import
Returns
void
See also
writeRecords_records()
Todo:
Define visibility

Definition at line 1796 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\$suggestedInsertUids, $uid, TYPO3\CMS\Impexp\ImportExport\addGeneralErrorsByTable(), TYPO3\CMS\Impexp\ImportExport\addSingle(), TYPO3\CMS\Impexp\ImportExport\addToMapId(), TYPO3\CMS\Impexp\ImportExport\callHook(), TYPO3\CMS\Impexp\ImportExport\flatInversePageTree(), TYPO3\CMS\Impexp\ImportExport\getNewTCE(), and TYPO3\CMS\Impexp\ImportExport\writeRecords_pages_order().

Referenced by TYPO3\CMS\Impexp\ImportExport\importData().

◆ writeRecords_pages_order()

TYPO3\CMS\Impexp\ImportExport::writeRecords_pages_order (   $pid)

Organize all updated pages in page tree so they are related like in the import file Only used for updates and when $this->dat['header']['pagetree'] is an array.

Parameters
integer$pidPage id in which to import
Returns
void private
See also
writeRecords_pages(), writeRecords_records_order()
Todo:
Define visibility

Definition at line 1853 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\callHook(), TYPO3\CMS\Impexp\ImportExport\dontIgnorePid(), TYPO3\CMS\Impexp\ImportExport\flatInversePageTree_pid(), and TYPO3\CMS\Impexp\ImportExport\getNewTCE().

Referenced by TYPO3\CMS\Impexp\ImportExport\writeRecords_pages().

◆ writeRecords_records()

◆ writeRecords_records_order()

TYPO3\CMS\Impexp\ImportExport::writeRecords_records_order (   $mainPid)

Organize all updated record to their new positions. Only used for updates

Parameters
integer$mainPidMain PID into which we import.
Returns
void private
See also
writeRecords_records(), writeRecords_pages_order()
Todo:
Define visibility

Definition at line 1955 of file ImportExport.php.

References $uid, TYPO3\CMS\Impexp\ImportExport\callHook(), TYPO3\CMS\Impexp\ImportExport\dontIgnorePid(), TYPO3\CMS\Impexp\ImportExport\flatInversePageTree(), and TYPO3\CMS\Impexp\ImportExport\getNewTCE().

Referenced by TYPO3\CMS\Impexp\ImportExport\writeRecords_records().

◆ writeSysFileResourceForLegacyImport()

TYPO3\CMS\Impexp\ImportExport::writeSysFileResourceForLegacyImport ( $fileName,
  $fileId 
)
protected

Writes the file with the is $fileId to the legacy import folder. The file name will used from argument $fileName and the file was successfully created or an identical file was already found, $fileName will held the uid of the new created file record.

Parameters
$fileNameThe file name for the new file. Value would be changed to the uid of the new created file record.
$fileIDThe id of the file in data array
Returns
bool

Definition at line 2859 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\$legacyImportFolder, TYPO3\CMS\Core\Utility\PathUtility\dirname(), TYPO3\CMS\Impexp\ImportExport\error(), and TYPO3\CMS\Impexp\ImportExport\writeTemporaryFileFromData().

Referenced by TYPO3\CMS\Impexp\ImportExport\processSoftReferences_saveFile(), and TYPO3\CMS\Impexp\ImportExport\processSoftReferences_saveFile_createRelFile().

◆ writeTemporaryFileFromData()

TYPO3\CMS\Impexp\ImportExport::writeTemporaryFileFromData (   $fileId,
  $dataKey = 'files_fal' 
)
protected

Writes the file from import array to temp dir and returns the filename of it.

Parameters
string$fileId
string$dataKey
Returns
string Absolute filename of the temporary filename of the file

Definition at line 1766 of file ImportExport.php.

References TYPO3\CMS\Impexp\ImportExport\error(), TYPO3\CMS\Core\Utility\GeneralUtility\tempnam(), and TYPO3\CMS\Core\Utility\GeneralUtility\writeFile().

Referenced by TYPO3\CMS\Impexp\ImportExport\importData(), and TYPO3\CMS\Impexp\ImportExport\writeSysFileResourceForLegacyImport().

Member Data Documentation

◆ $allowPHPScripts

TYPO3\CMS\Impexp\ImportExport::$allowPHPScripts = FALSE

If set, and if the user is admin, allow the writing of PHP scripts to fileadmin/ area.

Todo:
Define visibility

Definition at line 142 of file ImportExport.php.

◆ $cache_getRecordPath

TYPO3\CMS\Impexp\ImportExport::$cache_getRecordPath = array()

Cache for record paths

Todo:
Define visibility

Definition at line 283 of file ImportExport.php.

◆ $checkPID_cache

TYPO3\CMS\Impexp\ImportExport::$checkPID_cache = array()

Cache of checkPID values.

Todo:
Define visibility

Definition at line 290 of file ImportExport.php.

◆ $compress

TYPO3\CMS\Impexp\ImportExport::$compress = 0

Set internally if the gzcompress function exists

Todo:
Define visibility

Definition at line 297 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\addFilePart(), and TYPO3\CMS\Impexp\ImportExport\compileMemoryToFileContent().

◆ $dat

TYPO3\CMS\Impexp\ImportExport::$dat = array()

◆ $defaultRecordIncludeFields

TYPO3\CMS\Impexp\ImportExport::$defaultRecordIncludeFields = array('uid', 'pid')
protected

Definition at line 327 of file ImportExport.php.

◆ $display_import_pid_record

TYPO3\CMS\Impexp\ImportExport::$display_import_pid_record = ''

If set to a page-record, then the preview display of the content will expect this page-record to be the target for the import and accordingly display validation information. This triggers the visual view of the import/export memory to validate if import is possible

Todo:
Define visibility

Definition at line 100 of file ImportExport.php.

◆ $doesImport

TYPO3\CMS\Impexp\ImportExport::$doesImport = FALSE

Is set by importData() when an import has been done.

Todo:
Define visibility

Definition at line 91 of file ImportExport.php.

◆ $dontCompress

TYPO3\CMS\Impexp\ImportExport::$dontCompress = 0

Set by user: If set, compression in t3d files is disabled

Todo:
Define visibility

Definition at line 226 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\doOutputCompress(), and TYPO3\CMS\Impexp\ImportExport\init().

◆ $enableLogging

TYPO3\CMS\Impexp\ImportExport::$enableLogging = FALSE

Disable logging when importing

Todo:
Define visibility

Definition at line 149 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\getNewTCE().

◆ $errorLog

TYPO3\CMS\Impexp\ImportExport::$errorLog = array()

Error log.

Todo:
Define visibility

Definition at line 276 of file ImportExport.php.

◆ $excludeMap

TYPO3\CMS\Impexp\ImportExport::$excludeMap = array()

Exclude map. Keys are table:uid pairs and if set, records are not added to the export.

Todo:
Define visibility

Definition at line 205 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\setHeaderBasics().

◆ $extensionDependencies

TYPO3\CMS\Impexp\ImportExport::$extensionDependencies = array()

Listing extension dependencies.

Todo:
Define visibility

Definition at line 219 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\setHeaderBasics().

◆ $extFileResourceExtensions

TYPO3\CMS\Impexp\ImportExport::$extFileResourceExtensions = 'html,htm,css'

Files with external media (HTML/css style references inside)

Todo:
Define visibility

Definition at line 240 of file ImportExport.php.

◆ $fileadminFolderName

TYPO3\CMS\Impexp\ImportExport::$fileadminFolderName = ''

Name of the "fileadmin" folder where files for export/import should be located

Todo:
Define visibility

Definition at line 70 of file ImportExport.php.

◆ $fileIDMap

TYPO3\CMS\Impexp\ImportExport::$fileIDMap = array()

Mapping between the fileID from import memory and the final filenames they are written to.

Todo:
Define visibility

Definition at line 163 of file ImportExport.php.

◆ $fileProcObj

◆ $force_all_UIDS

TYPO3\CMS\Impexp\ImportExport::$force_all_UIDS = FALSE

If set, all UID values are forced! (update or import)

Todo:
Define visibility

Definition at line 128 of file ImportExport.php.

◆ $global_ignore_pid

TYPO3\CMS\Impexp\ImportExport::$global_ignore_pid = FALSE

If set, PID correct is ignored globally

Todo:
Define visibility

Definition at line 121 of file ImportExport.php.

◆ $import_data

TYPO3\CMS\Impexp\ImportExport::$import_data = array()

Internal data accumulation for writing records during import

Todo:
Define visibility

Definition at line 269 of file ImportExport.php.

◆ $import_mapId

TYPO3\CMS\Impexp\ImportExport::$import_mapId = array()

After records are written this array is filled with [table][original_uid] = [new_uid]

Todo:
Define visibility

Definition at line 247 of file ImportExport.php.

◆ $import_mode

TYPO3\CMS\Impexp\ImportExport::$import_mode = array()

Setting import modes during update state: as_new, exclude, force_uid

Todo:
Define visibility

Definition at line 114 of file ImportExport.php.

◆ $import_newId

TYPO3\CMS\Impexp\ImportExport::$import_newId = array()

Keys are [tablename]:[new NEWxxx ids (or when updating it is uids)] while values are arrays with table/uid of the original record it is based on. By the array keys the new ids can be looked up inside tcemain

Todo:
Define visibility

Definition at line 255 of file ImportExport.php.

◆ $import_newId_pids

TYPO3\CMS\Impexp\ImportExport::$import_newId_pids = array()

Page id map for page tree (import)

Todo:
Define visibility

Definition at line 262 of file ImportExport.php.

◆ $includeExtFileResources

TYPO3\CMS\Impexp\ImportExport::$includeExtFileResources = 0

Boolean, if set, HTML file resources are included.

Todo:
Define visibility

Definition at line 233 of file ImportExport.php.

◆ $legacyImport

TYPO3\CMS\Impexp\ImportExport::$legacyImport = FALSE
protected

Definition at line 341 of file ImportExport.php.

◆ $legacyImportFolder

TYPO3\CMS\Impexp\ImportExport::$legacyImportFolder = NULL
protected

◆ $legacyImportMigrationRecords

TYPO3\CMS\Impexp\ImportExport::$legacyImportMigrationRecords = array()
protected

Definition at line 387 of file ImportExport.php.

◆ $legacyImportMigrationTables

TYPO3\CMS\Impexp\ImportExport::$legacyImportMigrationTables
protected
Initial value:
= array(
'tt_content' => array(
'image' => array(
'titleTexts' => 'titleText',
'description' => 'imagecaption',
'links' => 'image_link',
'alternativeTexts' => 'altText'
),
'media' => array(
'description' => 'imagecaption',
)
),
'pages' => array(
'media' => array()
),
'pages_language_overlay' => array(
'media' => array()
)
)

Definition at line 360 of file ImportExport.php.

◆ $legacyImportTargetPath

TYPO3\CMS\Impexp\ImportExport::$legacyImportTargetPath = '_imported/'
protected

Definition at line 353 of file ImportExport.php.

◆ $maxExportSize

TYPO3\CMS\Impexp\ImportExport::$maxExportSize = 10000000

10MB max export size

Todo:
Define visibility

Definition at line 184 of file ImportExport.php.

◆ $maxFileSize

TYPO3\CMS\Impexp\ImportExport::$maxFileSize = 1000000

1MB max file size

Todo:
Define visibility

Definition at line 170 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\export_addSysFile().

◆ $maxRecordSize

TYPO3\CMS\Impexp\ImportExport::$maxRecordSize = 1000000

1MB max record size

Todo:
Define visibility

Definition at line 177 of file ImportExport.php.

◆ $mode

TYPO3\CMS\Impexp\ImportExport::$mode = ''

Whether "import" or "export" mode of object. Set through init() function

Todo:
Define visibility

Definition at line 77 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\init().

◆ $recordTypesIncludeFields

TYPO3\CMS\Impexp\ImportExport::$recordTypesIncludeFields = array()
protected

Definition at line 320 of file ImportExport.php.

◆ $relOnlyTables

TYPO3\CMS\Impexp\ImportExport::$relOnlyTables = array()

Add table names here which are THE ONLY ones which will be included into export if found as relations. '_ALL' will allow all tables.

Todo:
Define visibility

Definition at line 191 of file ImportExport.php.

◆ $relStaticTables

TYPO3\CMS\Impexp\ImportExport::$relStaticTables = array()

Add tables names here which should not be exported with the file. (Where relations should be mapped to same UIDs in target system).

Todo:
Define visibility

Definition at line 198 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\setHeaderBasics().

◆ $showDiff

TYPO3\CMS\Impexp\ImportExport::$showDiff = FALSE

If set, a diff-view column is added to the overview.

Todo:
Define visibility

Definition at line 135 of file ImportExport.php.

◆ $showStaticRelations

TYPO3\CMS\Impexp\ImportExport::$showStaticRelations = FALSE

If set, static relations (not exported) will be shown in overview as well

Todo:
Define visibility

Definition at line 63 of file ImportExport.php.

◆ $softrefCfg

TYPO3\CMS\Impexp\ImportExport::$softrefCfg = array()

Soft Reference Token ID modes.

Todo:
Define visibility

Definition at line 212 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\setHeaderBasics().

◆ $softrefInputValues

TYPO3\CMS\Impexp\ImportExport::$softrefInputValues = array()

Array of values to substitute in editable softreferences.

Todo:
Define visibility

Definition at line 156 of file ImportExport.php.

◆ $storageObjects

TYPO3\CMS\Impexp\ImportExport::$storageObjects = array()
protected

Definition at line 334 of file ImportExport.php.

◆ $suggestedInsertUids

TYPO3\CMS\Impexp\ImportExport::$suggestedInsertUids = array()

Used to register the forged UID values for imported records that we want to create with the same UIDs as in the import file. Admin-only feature.

Todo:
Define visibility

Definition at line 107 of file ImportExport.php.

Referenced by TYPO3\CMS\Impexp\ImportExport\writeRecords_pages(), and TYPO3\CMS\Impexp\ImportExport\writeRecords_records().

◆ $update

TYPO3\CMS\Impexp\ImportExport::$update = FALSE

Updates all records that has same UID instead of creating new!

Todo:
Define visibility

Definition at line 84 of file ImportExport.php.