‪TYPO3CMS  ‪main
TYPO3\CMS\Impexp\Import Class Reference
Inheritance diagram for TYPO3\CMS\Impexp\Import:
TYPO3\CMS\Impexp\ImportExport

Public Member Functions

 __construct ()
 
 loadFile (string $fileName)
 
 getMetaData ()
 
 checkImportPrerequisites ()
 
 importData ()
 
array remapRelationsOfFlexFormCallBack (array $pParams, array $dsConf, string $dataValue, $dataValue_ext1, string $path)
 
array processSoftReferencesFlexFormCallBack (array $pParams, array $dsConf, string $dataValue, $dataValue_ext1, string $path)
 
 isEnableLogging ()
 
 setEnableLogging (bool $enableLogging)
 
 isDecompressionAvailable ()
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Impexp\ImportExport
array renderPreview ()
 
 addFiles (array $relations, array &$lines, int $indent, string $tokenID='')
 
 getOrCreateTemporaryFolderName ()
 
 removeTemporaryFolderName ()
 
 getOrCreateDefaultImportExportFolder ()
 
 removeDefaultImportExportFolder ()
 
 hasErrors ()
 
 getPid ()
 
 setPid (int $pid)
 
 setExcludeDisabledRecords (bool $excludeDisabledRecords)
 
 isExcludeDisabledRecords ()
 
 getExcludeMap ()
 
 setExcludeMap (array $excludeMap)
 
 getSoftrefCfg ()
 
 setSoftrefCfg (array $softrefCfg)
 
 getExtensionDependencies ()
 
 setExtensionDependencies (array $extensionDependencies)
 
 isShowStaticRelations ()
 
 setShowStaticRelations (bool $showStaticRelations)
 
 getRelStaticTables ()
 
 setRelStaticTables (array $relStaticTables)
 
 getErrorLog ()
 
 setErrorLog (array $errorLog)
 
 isUpdate ()
 
 setUpdate (bool $update)
 
 getImportMode ()
 
 setImportMode (array $importMode)
 
 isGlobalIgnorePid ()
 
 setGlobalIgnorePid (bool $globalIgnorePid)
 
 isForceAllUids ()
 
 setForceAllUids (bool $forceAllUids)
 
 isShowDiff ()
 
 setShowDiff (bool $showDiff)
 
 getSoftrefInputValues ()
 
 setSoftrefInputValues (array $softrefInputValues)
 
 getMode ()
 
 setMode (string $mode)
 
 getImportMapId ()
 
 setImportMapId (array $importMapId)
 
 getDat ()
 

Public Attributes

const IMPORT_MODE_FORCE_UID = 'force_uid'
 
const IMPORT_MODE_AS_NEW = 'as_new'
 
const IMPORT_MODE_EXCLUDE = 'exclude'
 
const IMPORT_MODE_IGNORE_PID = 'ignore_pid'
 
const IMPORT_MODE_RESPECT_PID = 'respect_pid'
 
const SOFTREF_IMPORT_MODE_EXCLUDE = 'exclude'
 
const SOFTREF_IMPORT_MODE_EDITABLE = 'editable'
 

Protected Member Functions

 fetchStorages ()
 
array null getNextFilePart ($fd, string $name)
 
 loadInit ()
 
 initializeImport ()
 
 writeSysFileStorageRecords ()
 
bool isEquivalentStorage (ResourceStorage $storageObject, array &$storageRecord)
 
 writeSysFileRecords ()
 
 fixUidLocalInSysFileReferenceRecords (int $oldFileUid, int $newFileUid)
 
 removeSysFileReferenceRecordsWithRelationToMissingFile ()
 
 writePages ()
 
 writePagesOrder ()
 
bool doRespectPid (string $table, int $uid)
 
 writeRecords ()
 
 writeRecordsOrder ()
 
 addSingle (array &$importData, string $table, int $uid, $pid)
 
 getReferenceDefaultValue (array $configuration)
 
 getSysFileMetaDataFromDatabase (int $file, int $sysLanguageUid)
 
 addToMapId (array $importData, array $substNEWwithIDs)
 
 createDataHandler ()
 
 setRelations ()
 
array remapRelationsOfField (array $fieldRelations, array $fieldConfig, string $field='')
 
 setFlexFormRelations ()
 
 processSoftReferences ()
 
string processSoftReferencesSubstTokens (string $tokenizedContent, array $softrefs, string $table, string $uid)
 
string processSoftReferencesSaveFile (string $relFileName, array $softref, string $table, string $uid)
 
string null processSoftReferencesSaveFileCreateRelFile (string $origDirPrefix, string $fileName, string $fileID, string $table, string $uid)
 
bool writeFileVerify (string $fileName, string $fileID)
 
bool checkOrCreateDir (string $dirPrefix)
 
 getFileadminFolderName ()
 
 callHook (string $name, array $params)
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Impexp\ImportExport
 traversePageTree (array $pageTree, array &$lines, int $indent=0)
 
bool isRecordDisabled (string $table, int $uid)
 
 excludePageAndRecords (int $pageUid, array $page)
 
 traversePageRecords (array $pageTree, array &$lines)
 
 traverseAllRecords (array $pageTree, array &$lines)
 
 addGeneralErrorsByTable (string $table)
 
 addRecord (string $table, int $uid, array &$lines, int $indent, bool $checkImportInPidRecord=false)
 
 addRelations (array $relations, array &$lines, int $indent, array $recursionCheck=[])
 
 addSoftRefs (array $softrefs, array &$lines, int $indent)
 
 renderIndent (int $indent)
 
bool checkDokType (string $table, int $dokType)
 
string renderControls (array $line)
 
string renderRecordExcludeCheckbox (string $recordRef)
 
string renderSoftRefImportTextField (array $softref)
 
string renderSoftRefExportSelector (array $softref)
 
string renderImportModeSelector (string $table, int $uid, bool $doesRecordExist)
 
string renderSelectBox (string $name, string $value, array $options)
 
 createTemporaryFolderName ()
 
 createDefaultImportExportFolder ()
 
 getDefaultUploadTemporaryFolder ()
 
string null resolveStoragePath (string $dirPrefix, bool $checkAlternatives=true)
 
 flatInversePageTree (array $pageTree, array &$list, int $pid=-1)
 
bool isTableStatic (string $table)
 
bool isRecordExcluded (string $table, int $uid)
 
bool isSoftRefIncluded (string $tokenID)
 
array null getRecordFromDatabase (string $table, int $uid, string $fields='uid, pid')
 
string getRecordPath (int $pid)
 
string compareRecords (array $databaseRecord, array $importRecord, string $table, bool $inverse=false)
 
DiffUtility getDiffUtility ()
 
ExtendedFileUtility getFileProcObj ()
 
 addError (string $message)
 
 getBackendUser ()
 
 getLanguageService ()
 
 getPidRecord ()
 

Protected Attributes

string $mode = 'import'
 
array $suggestedInsertUids = []
 
bool $enableLogging = false
 
array $importNewId = []
 
array $importNewIdPids = []
 
bool $decompressionAvailable = false
 
bool $isFilesSavedOutsideImportFile = false
 
array $storages = []
 
array $storagesAvailableForImport = []
 
ResourceStorage $defaultStorage = null
 
StorageRepository $storageRepository
 
string $fileadminFolderName = ''
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Impexp\ImportExport
string $mode = ''
 
string $permsClause
 
int $pid = -1
 
array $pidRecord = null
 
bool $showStaticRelations = false
 
bool $update = false
 
bool $doesImport = false
 
array $importMode = []
 
bool $globalIgnorePid = false
 
bool $forceAllUids = false
 
bool $showDiff = false
 
array $softrefInputValues = []
 
array $fileIdMap = []
 
array $relStaticTables = []
 
array $excludeMap = []
 
array $softrefCfg = []
 
array $extensionDependencies = []
 
array $importMapId = []
 
array $errorLog = []
 
array $cacheGetRecordPath = []
 
array $dat = []
 
ExtendedFileUtility $fileProcObj = null
 
DiffUtility $diffUtility = null
 
array $remainHeader = []
 
LanguageService $lang
 
IconFactory $iconFactory
 
string $temporaryFolderName = null
 
Folder $defaultImportExportFolder = null
 
bool $excludeDisabledRecords = false
 

Private Attributes

array $supportedFileExtensions
 

Detailed Description

T3D file Import library (TYPO3 Record Document)

This class is not considered part of the public TYPO3 API.

Definition at line 50 of file Import.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Impexp\Import::__construct ( )

Reimplemented from TYPO3\CMS\Impexp\ImportExport.

Definition at line 118 of file Import.php.

References TYPO3\CMS\Impexp\Import\fetchStorages().

Member Function Documentation

◆ addSingle()

TYPO3\CMS\Impexp\Import::addSingle ( array &  $importData,
string  $table,
int  $uid,
  $pid 
)
protected

Adds a single record to the $importData array. Also copies files to the temporary folder. However all file and database references and flexform fields are set to blank for now! That is processed with setRelations() later.

Parameters
array$importData‪Data to be modified or inserted in the database during import
string$table‪Table name
int$uid‪Record UID
int | string$pid‪Page id or NEW-id, e.g. "NEW5fb3c2641281c885267727"
See also
setRelations()

Definition at line 967 of file Import.php.

References $GLOBALS, TYPO3\CMS\Impexp\ImportExport\$pid, TYPO3\CMS\Webhooks\Message\$record, TYPO3\CMS\Webhooks\Message\$uid, TYPO3\CMS\Impexp\ImportExport\addError(), TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), TYPO3\CMS\Impexp\ImportExport\getBackendUser(), TYPO3\CMS\Impexp\ImportExport\getRecordFromDatabase(), TYPO3\CMS\Impexp\Import\getReferenceDefaultValue(), TYPO3\CMS\Impexp\Import\getSysFileMetaDataFromDatabase(), and TYPO3\CMS\Core\Utility\StringUtility\getUniqueId().

Referenced by TYPO3\CMS\Impexp\Import\writePages(), TYPO3\CMS\Impexp\Import\writeRecords(), and TYPO3\CMS\Impexp\Import\writeSysFileStorageRecords().

◆ addToMapId()

TYPO3\CMS\Impexp\Import::addToMapId ( array  $importData,
array  $substNEWwithIDs 
)
protected

Store the mapping between the import file record UIDs and the final record UIDs in the database after import.

Parameters
array$importData‪Data to be modified or inserted in the database during import
array$substNEWwithIDs‪A map between the "NEW..." string IDs and the eventual record UID in database
See also
writeRecords()

Definition at line 1136 of file Import.php.

References TYPO3\CMS\Webhooks\Message\$uid, and TYPO3\CMS\Impexp\ImportExport\addError().

Referenced by TYPO3\CMS\Impexp\Import\writePages(), TYPO3\CMS\Impexp\Import\writeRecords(), and TYPO3\CMS\Impexp\Import\writeSysFileStorageRecords().

◆ callHook()

TYPO3\CMS\Impexp\Import::callHook ( string  $name,
array  $params 
)
protected

◆ checkImportPrerequisites()

TYPO3\CMS\Impexp\Import::checkImportPrerequisites ( )

Checks all requirements that must be met before import.

Exceptions
PrerequisitesNotMetException

Definition at line 326 of file Import.php.

References TYPO3\CMS\Impexp\ImportExport\addError(), TYPO3\CMS\Impexp\ImportExport\hasErrors(), TYPO3\CMS\Impexp\Import\isEquivalentStorage(), and TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isLoaded().

◆ checkOrCreateDir()

bool TYPO3\CMS\Impexp\Import::checkOrCreateDir ( string  $dirPrefix)
protected

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

Parameters
string$dirPrefix‪Directory to create. Having a trailing slash. Must be in fileadmin/. Relative to public web path
Returns
‪bool TRUE, if directory exists (was created)

Definition at line 1732 of file Import.php.

References TYPO3\CMS\Impexp\ImportExport\addError(), TYPO3\CMS\Impexp\Import\getFileadminFolderName(), TYPO3\CMS\Core\Core\Environment\getPublicPath(), and TYPO3\CMS\Core\Utility\GeneralUtility\mkdir().

Referenced by TYPO3\CMS\Impexp\Import\processSoftReferencesSaveFileCreateRelFile().

◆ createDataHandler()

◆ doRespectPid()

bool TYPO3\CMS\Impexp\Import::doRespectPid ( string  $table,
int  $uid 
)
protected

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

Parameters
string$table‪Table name
int$uid‪Record UID
Returns
‪bool TRUE if the position of the record should be updated to match the one in the import structure

Definition at line 834 of file Import.php.

References TYPO3\CMS\Webhooks\Message\$uid.

Referenced by TYPO3\CMS\Impexp\Import\writePagesOrder(), and TYPO3\CMS\Impexp\Import\writeRecordsOrder().

◆ fetchStorages()

TYPO3\CMS\Impexp\Import::fetchStorages ( )
protected

Fetch all available file storages and index by storage UID

Note: It also creates a default storage record if the database table sys_file_storage is empty, e.g. during tests.

Definition at line 132 of file Import.php.

References TYPO3\CMS\Impexp\Import\$storages.

Referenced by TYPO3\CMS\Impexp\Import\__construct(), and TYPO3\CMS\Impexp\Import\writeSysFileStorageRecords().

◆ fixUidLocalInSysFileReferenceRecords()

TYPO3\CMS\Impexp\Import::fixUidLocalInSysFileReferenceRecords ( int  $oldFileUid,
int  $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

Definition at line 686 of file Import.php.

Referenced by TYPO3\CMS\Impexp\Import\writeSysFileRecords().

◆ getFileadminFolderName()

◆ getMetaData()

TYPO3\CMS\Impexp\Import::getMetaData ( )

Definition at line 312 of file Import.php.

◆ getNextFilePart()

array null TYPO3\CMS\Impexp\Import::getNextFilePart (   $fd,
string  $name 
)
protected

Extracts the next content part of the T3D file

Parameters
resource$fdImport file pointer
string$name‪For error messages this indicates the section of the problem.
Returns
‪array|null Data array or NULL in case of an error
See also
loadFile()

Definition at line 262 of file Import.php.

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

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

◆ getReferenceDefaultValue()

TYPO3\CMS\Impexp\Import::getReferenceDefaultValue ( array  $configuration)
protected

Get the default value for a reference field.

Parameters
array$configuration‪The TCA configuration of the accordant field

Definition at line 1092 of file Import.php.

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

◆ getSysFileMetaDataFromDatabase()

TYPO3\CMS\Impexp\Import::getSysFileMetaDataFromDatabase ( int  $file,
int  $sysLanguageUid 
)
protected

Selects sys_file_metadata database record.

Definition at line 1106 of file Import.php.

References TYPO3\CMS\Core\Database\Connection\PARAM_INT.

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

◆ importData()

◆ initializeImport()

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

Initialize all settings for the import

Definition at line 430 of file Import.php.

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

◆ isDecompressionAvailable()

TYPO3\CMS\Impexp\Import::isDecompressionAvailable ( )

Definition at line 1793 of file Import.php.

References TYPO3\CMS\Impexp\Import\$decompressionAvailable.

◆ isEnableLogging()

TYPO3\CMS\Impexp\Import::isEnableLogging ( )

Definition at line 1783 of file Import.php.

References TYPO3\CMS\Impexp\Import\$enableLogging.

◆ isEquivalentStorage()

bool TYPO3\CMS\Impexp\Import::isEquivalentStorage ( ResourceStorage  $storageObject,
array &  $storageRecord 
)
protected

Determines whether the passed storage object and the storage record (sys_file_storage) can be considered equivalent during the import.

Parameters
ResourceStorage$storageObject‪The storage object which should get compared
array$storageRecord‪The storage record which should get compared
Returns
‪bool Returns TRUE if both storage representations can be considered equal

Definition at line 509 of file Import.php.

References TYPO3\CMS\Core\Resource\ResourceStorage\getConfiguration(), TYPO3\CMS\Core\Resource\ResourceStorage\getDriverType(), TYPO3\CMS\Core\Resource\ResourceStorage\isOnline(), and TYPO3\CMS\Core\Resource\ResourceStorage\isWritable().

Referenced by TYPO3\CMS\Impexp\Import\checkImportPrerequisites(), and TYPO3\CMS\Impexp\Import\writeSysFileStorageRecords().

◆ loadFile()

◆ loadInit()

TYPO3\CMS\Impexp\Import::loadInit ( )
protected

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

Definition at line 305 of file Import.php.

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

◆ processSoftReferences()

◆ processSoftReferencesFlexFormCallBack()

array TYPO3\CMS\Impexp\Import::processSoftReferencesFlexFormCallBack ( array  $pParams,
array  $dsConf,
string  $dataValue,
  $dataValue_ext1,
string  $path 
)

Callback function to traverse the FlexForm structure and remap its soft reference relations.

Parameters
array$pParams‪Set of parameters in numeric array: table, uid, field, soft references
array$dsConf‪TCA config for field (from Data Structure of course)
string$dataValue‪Field value (from FlexForm XML)
string$dataValue_ext1‪Not used
string$path‪Path of where the data structure where the element is found
Returns
‪array Array where the "value" key carries the value.
See also
setFlexFormRelations()

Definition at line 1491 of file Import.php.

References TYPO3\CMS\Impexp\Import\processSoftReferencesSubstTokens().

◆ processSoftReferencesSaveFile()

string TYPO3\CMS\Impexp\Import::processSoftReferencesSaveFile ( string  $relFileName,
array  $softref,
string  $table,
string  $uid 
)
protected

Process a soft reference file

Parameters
string$relFileName‪Old Relative filename
array$softref‪Soft reference
string$table‪Table for which the processing occurs
string$uid‪UID of record from table
Returns
‪string New relative filename (value to insert instead of the softref token)

Definition at line 1573 of file Import.php.

References TYPO3\CMS\Webhooks\Message\$uid, TYPO3\CMS\Impexp\ImportExport\addError(), TYPO3\CMS\Core\Utility\PathUtility\basename(), TYPO3\CMS\Core\Utility\PathUtility\dirname(), TYPO3\CMS\Impexp\Import\getFileadminFolderName(), and TYPO3\CMS\Impexp\Import\processSoftReferencesSaveFileCreateRelFile().

Referenced by TYPO3\CMS\Impexp\Import\processSoftReferencesSubstTokens().

◆ processSoftReferencesSaveFileCreateRelFile()

string null TYPO3\CMS\Impexp\Import::processSoftReferencesSaveFileCreateRelFile ( string  $origDirPrefix,
string  $fileName,
string  $fileID,
string  $table,
string  $uid 
)
protected

◆ processSoftReferencesSubstTokens()

string TYPO3\CMS\Impexp\Import::processSoftReferencesSubstTokens ( string  $tokenizedContent,
array  $softrefs,
string  $table,
string  $uid 
)
protected

Substitution of soft reference tokens

Parameters
string$tokenizedContent‪Content of field with soft reference tokens in.
array$softrefs‪Soft references
string$table‪Table of record for which the processing occurs
string$uid‪UID of record from table
Returns
‪string The input content with tokens substituted according to entries in $softrefs

Definition at line 1522 of file Import.php.

References TYPO3\CMS\Webhooks\Message\$uid, TYPO3\CMS\Impexp\Import\processSoftReferencesSaveFile(), TYPO3\CMS\Impexp\Import\SOFTREF_IMPORT_MODE_EDITABLE, and TYPO3\CMS\Impexp\Import\SOFTREF_IMPORT_MODE_EXCLUDE.

Referenced by TYPO3\CMS\Impexp\Import\processSoftReferences(), and TYPO3\CMS\Impexp\Import\processSoftReferencesFlexFormCallBack().

◆ remapRelationsOfField()

array TYPO3\CMS\Impexp\Import::remapRelationsOfField ( array  $fieldRelations,
array  $fieldConfig,
string  $field = '' 
)
protected

Maps the original record UIDs of the relations to the actual UIDs of the imported records and returns relations as strings of type [table]_[uid] - or file:[uid] or [public url] for field of type "group" and internal_type "file_reference". These strings have the regular DataHandler input group/select type format which means they will automatically be processed into a list of UIDs or MM relations.

Parameters
array$fieldRelations‪Relations with original record UIDs
array$fieldConfig‪TCA configuration of the record field the relations belong to
string$field‪The TCA fieldname of the relation operated on
Returns
‪array Array of relation strings with actual record UIDs

Definition at line 1244 of file Import.php.

References $GLOBALS, TYPO3\CMS\Impexp\ImportExport\addError(), TYPO3\CMS\Impexp\ImportExport\isRecordExcluded(), and TYPO3\CMS\Impexp\ImportExport\isTableStatic().

Referenced by TYPO3\CMS\Impexp\Import\remapRelationsOfFlexFormCallBack(), and TYPO3\CMS\Impexp\Import\setRelations().

◆ remapRelationsOfFlexFormCallBack()

array TYPO3\CMS\Impexp\Import::remapRelationsOfFlexFormCallBack ( array  $pParams,
array  $dsConf,
string  $dataValue,
  $dataValue_ext1,
string  $path 
)

Callback function to remap relations in FlexForm data

Parameters
array$pParams‪Set of parameters passed through by calling method setFlexFormRelations()
array$dsConf‪TCA config for field (from Data Structure of course)
string$dataValue‪Field value (from FlexForm XML)
string$dataValue_ext1‪Not used
string$path‪Path of where the data structure of the element is found
Returns
‪array Array where the "value" key carries the mapped relation string.
See also
setFlexFormRelations()

Definition at line 1376 of file Import.php.

References TYPO3\CMS\Impexp\Import\remapRelationsOfField().

◆ removeSysFileReferenceRecordsWithRelationToMissingFile()

TYPO3\CMS\Impexp\Import::removeSysFileReferenceRecordsWithRelationToMissingFile ( )
protected

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

Definition at line 706 of file Import.php.

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

Referenced by TYPO3\CMS\Impexp\Import\writeSysFileRecords().

◆ setEnableLogging()

TYPO3\CMS\Impexp\Import::setEnableLogging ( bool  $enableLogging)

Definition at line 1788 of file Import.php.

References TYPO3\CMS\Impexp\Import\$enableLogging.

◆ setFlexFormRelations()

TYPO3\CMS\Impexp\Import::setFlexFormRelations ( )
protected

After all database relations have 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 FlexForm field!

See also
setRelations()

Definition at line 1286 of file Import.php.

References $GLOBALS, TYPO3\CMS\Webhooks\Message\$uid, TYPO3\CMS\Impexp\ImportExport\addError(), TYPO3\CMS\Core\Serializer\Typo3XmlSerializerOptions\ALLOW_UNDEFINED_NAMESPACES, TYPO3\CMS\Impexp\Import\callHook(), and TYPO3\CMS\Impexp\Import\createDataHandler().

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

◆ setRelations()

TYPO3\CMS\Impexp\Import::setRelations ( )
protected

At the end of the import process all file and database relations should be set properly. This means that the relations to imported records are all recreated so that the imported records are correctly related again. Relations in flexform fields are processed in setFlexFormRelations() after this function.

See also
setFlexFormRelations()

Definition at line 1184 of file Import.php.

References $GLOBALS, TYPO3\CMS\Webhooks\Message\$uid, TYPO3\CMS\Impexp\ImportExport\addError(), TYPO3\CMS\Impexp\Import\callHook(), TYPO3\CMS\Impexp\Import\createDataHandler(), and TYPO3\CMS\Impexp\Import\remapRelationsOfField().

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

◆ writeFileVerify()

bool TYPO3\CMS\Impexp\Import::writeFileVerify ( string  $fileName,
string  $fileID 
)
protected

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

Parameters
string$fileName‪Absolute filename inside public web path to write to
string$fileID‪File ID from import memory
Returns
‪bool Returns TRUE if it went well. Notice that the content of the file is read again, and md5 from import memory is validated.

Definition at line 1690 of file Import.php.

References TYPO3\CMS\Impexp\ImportExport\$fileProcObj, TYPO3\CMS\Impexp\ImportExport\addError(), TYPO3\CMS\Core\Utility\PathUtility\dirname(), TYPO3\CMS\Impexp\ImportExport\getFileProcObj(), and TYPO3\CMS\Core\Utility\GeneralUtility\writeFile().

Referenced by TYPO3\CMS\Impexp\Import\processSoftReferencesSaveFileCreateRelFile().

◆ writePages()

TYPO3\CMS\Impexp\Import::writePages ( )
protected

Writing page tree / pages to database: 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.

See also
writeRecords()

Definition at line 734 of file Import.php.

References TYPO3\CMS\Impexp\ImportExport\$pid, TYPO3\CMS\Impexp\Import\$suggestedInsertUids, TYPO3\CMS\Impexp\Import\addSingle(), TYPO3\CMS\Impexp\Import\addToMapId(), TYPO3\CMS\Impexp\Import\callHook(), TYPO3\CMS\Impexp\Import\createDataHandler(), TYPO3\CMS\Impexp\ImportExport\flatInversePageTree(), and TYPO3\CMS\Impexp\Import\writePagesOrder().

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

◆ writePagesOrder()

TYPO3\CMS\Impexp\Import::writePagesOrder ( )
protected

◆ writeRecords()

◆ writeRecordsOrder()

◆ writeSysFileRecords()

◆ writeSysFileStorageRecords()

TYPO3\CMS\Impexp\Import::writeSysFileStorageRecords ( )
protected

Member Data Documentation

◆ $decompressionAvailable

bool TYPO3\CMS\Impexp\Import::$decompressionAvailable = false
protected

Definition at line 86 of file Import.php.

Referenced by TYPO3\CMS\Impexp\Import\isDecompressionAvailable().

◆ $defaultStorage

ResourceStorage TYPO3\CMS\Impexp\Import::$defaultStorage = null
protected

Currently registered default storage object

Definition at line 110 of file Import.php.

Referenced by TYPO3\CMS\Impexp\Import\writeSysFileRecords().

◆ $enableLogging

bool TYPO3\CMS\Impexp\Import::$enableLogging = false
protected

◆ $fileadminFolderName

string TYPO3\CMS\Impexp\Import::$fileadminFolderName = ''
protected

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

Definition at line 116 of file Import.php.

Referenced by TYPO3\CMS\Impexp\Import\getFileadminFolderName().

◆ $importNewId

array TYPO3\CMS\Impexp\Import::$importNewId = []
protected

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. With the array keys the new ids can be looked up inside DataHandler

Definition at line 79 of file Import.php.

◆ $importNewIdPids

array TYPO3\CMS\Impexp\Import::$importNewIdPids = []
protected

Page id map for page tree (import)

Definition at line 84 of file Import.php.

◆ $isFilesSavedOutsideImportFile

bool TYPO3\CMS\Impexp\Import::$isFilesSavedOutsideImportFile = false
protected

Definition at line 91 of file Import.php.

◆ $mode

string TYPO3\CMS\Impexp\Import::$mode = 'import'
protected

Definition at line 61 of file Import.php.

◆ $storageRepository

StorageRepository TYPO3\CMS\Impexp\Import::$storageRepository
protected

Definition at line 111 of file Import.php.

◆ $storages

array TYPO3\CMS\Impexp\Import::$storages = []
protected

Definition at line 98 of file Import.php.

Referenced by TYPO3\CMS\Impexp\Import\fetchStorages().

◆ $storagesAvailableForImport

array TYPO3\CMS\Impexp\Import::$storagesAvailableForImport = []
protected

Definition at line 105 of file Import.php.

◆ $suggestedInsertUids

array TYPO3\CMS\Impexp\Import::$suggestedInsertUids = []
protected

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

Definition at line 67 of file Import.php.

Referenced by TYPO3\CMS\Impexp\Import\writePages(), and TYPO3\CMS\Impexp\Import\writeRecords().

◆ $supportedFileExtensions

array TYPO3\CMS\Impexp\Import::$supportedFileExtensions
private
Initial value:
= [
'xml',
't3d',
]

Definition at line 87 of file Import.php.

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

◆ IMPORT_MODE_AS_NEW

◆ IMPORT_MODE_EXCLUDE

◆ IMPORT_MODE_FORCE_UID

◆ IMPORT_MODE_IGNORE_PID

const TYPO3\CMS\Impexp\Import::IMPORT_MODE_IGNORE_PID = 'ignore_pid'

◆ IMPORT_MODE_RESPECT_PID

const TYPO3\CMS\Impexp\Import::IMPORT_MODE_RESPECT_PID = 'respect_pid'

◆ SOFTREF_IMPORT_MODE_EDITABLE

◆ SOFTREF_IMPORT_MODE_EXCLUDE