TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Install\Updates\TceformsUpdateWizard Class Reference
Inheritance diagram for TYPO3\CMS\Install\Updates\TceformsUpdateWizard:
TYPO3\CMS\Install\Updates\AbstractUpdate Tx_Install_Updates_File_TceformsUpdateWizard

Public Member Functions

 checkForUpdate (&$description)
 
 performUpdate (array &$dbQueries, &$customMessages)
 
- Public Member Functions inherited from TYPO3\CMS\Install\Updates\AbstractUpdate
 getTitle ()
 
 setTitle ($title)
 
 getIdentifier ()
 
 setIdentifier ($identifier)
 
 shouldRenderWizard ()
 
 shouldRenderNextButton ()
 
 checkIfTableExists ($table)
 
 checkForUpdate (&$description)
 
 performUpdate (array &$dbQueries, &$customMessages)
 

Public Attributes

const RECORDS_PER_QUERY = 1000
 
- Public Attributes inherited from TYPO3\CMS\Install\Updates\AbstractUpdate
 $pObj
 
 $userInput
 
 $versionNumber
 

Protected Member Functions

 getFinishedFields ()
 
 getRecordsFromTable ($table, $fieldToMigrate, $relationFields, $limit)
 
- Protected Member Functions inherited from TYPO3\CMS\Install\Updates\AbstractUpdate
 markWizardAsDone ($confValue=1)
 
 isWizardDone ()
 
 getDatabaseConnection ()
 

Protected Attributes

 $title = 'Migrate all file relations from tt_content.image and pages.media'
 
 $storage
 
 $logger
 
 $database
 
 $tables
 
 $registry
 
 $registryNamespace = 'TceformsUpdateWizard'
 
 $recordOffset = array()
 
- Protected Attributes inherited from TYPO3\CMS\Install\Updates\AbstractUpdate
 $title
 
 $identifier
 

Detailed Description

Upgrade wizard which goes through all files referenced in the tt_content.image filed and creates sys_file records as well as sys_file_reference records for the individual usages.

Author
Ingmar Schlecht ingma.nosp@m.r@ty.nosp@m.po3.o.nosp@m.rg

Definition at line 27 of file TceformsUpdateWizard.php.

Member Function Documentation

◆ checkForUpdate()

TYPO3\CMS\Install\Updates\TceformsUpdateWizard::checkForUpdate ( $description)

Checks if an update is needed

Parameters
string&$descriptionThe description for the update
Returns
boolean TRUE if an update is needed, FALSE otherwise

Definition at line 130 of file TceformsUpdateWizard.php.

References TYPO3\CMS\Install\Updates\TceformsUpdateWizard\getFinishedFields().

◆ getFinishedFields()

TYPO3\CMS\Install\Updates\TceformsUpdateWizard::getFinishedFields ( )
protected

We write down the fields that were migrated. Like this: tt_content:media so you can check whether a field was already migrated

Returns
array

Definition at line 230 of file TceformsUpdateWizard.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Install\Updates\TceformsUpdateWizard\checkForUpdate(), and TYPO3\CMS\Install\Updates\TceformsUpdateWizard\performUpdate().

◆ getRecordsFromTable()

TYPO3\CMS\Install\Updates\TceformsUpdateWizard::getRecordsFromTable (   $table,
  $fieldToMigrate,
  $relationFields,
  $limit 
)
protected

Get records from table where the field to migrate is not empty (NOT NULL and != '') and also not numeric (which means that it is migrated)

Parameters
string$table
string$fieldToMigrate
array$relationFields
int$limitMaximum number records to select
Exceptions

Definition at line 248 of file TceformsUpdateWizard.php.

References $GLOBALS, $result, TYPO3\CMS\Core\Utility\GeneralUtility\mkdir_deep(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Install\Updates\TceformsUpdateWizard\performUpdate().

◆ performUpdate()

TYPO3\CMS\Install\Updates\TceformsUpdateWizard::performUpdate ( array &  $dbQueries,
$customMessages 
)

Performs the database update.

Parameters
array&$dbQueriesQueries done in this update
mixed&$customMessagesCustom messages
Returns
boolean TRUE on success, FALSE on error

Definition at line 167 of file TceformsUpdateWizard.php.

References TYPO3\CMS\Install\Updates\TceformsUpdateWizard\getFinishedFields(), TYPO3\CMS\Install\Updates\TceformsUpdateWizard\getRecordsFromTable(), and TYPO3\CMS\Install\Updates\AbstractUpdate\markWizardAsDone().

Member Data Documentation

◆ $database

TYPO3\CMS\Install\Updates\TceformsUpdateWizard::$database
protected

Definition at line 53 of file TceformsUpdateWizard.php.

◆ $logger

TYPO3\CMS\Install\Updates\TceformsUpdateWizard::$logger
protected

Definition at line 48 of file TceformsUpdateWizard.php.

◆ $recordOffset

TYPO3\CMS\Install\Updates\TceformsUpdateWizard::$recordOffset = array()
protected

Definition at line 100 of file TceformsUpdateWizard.php.

◆ $registry

TYPO3\CMS\Install\Updates\TceformsUpdateWizard::$registry
protected

Definition at line 90 of file TceformsUpdateWizard.php.

◆ $registryNamespace

TYPO3\CMS\Install\Updates\TceformsUpdateWizard::$registryNamespace = 'TceformsUpdateWizard'
protected

Definition at line 95 of file TceformsUpdateWizard.php.

◆ $storage

TYPO3\CMS\Install\Updates\TceformsUpdateWizard::$storage
protected

Definition at line 43 of file TceformsUpdateWizard.php.

◆ $tables

TYPO3\CMS\Install\Updates\TceformsUpdateWizard::$tables
protected
Initial value:
= array(
'tt_content' => array(
'image' => array(
'sourcePath' => 'uploads/pics/',
'targetPath' => '_migrated/pics/',
'titleTexts' => 'titleText',
'captions' => 'imagecaption',
'links' => 'image_link',
'alternativeTexts' => 'altText'
)
),
'pages' => array(
'media' => array(
'sourcePath' => 'uploads/media/',
'targetPath' => '_migrated/media/'
)
),
'pages_language_overlay' => array(
'media' => array(
'sourcePath' => 'uploads/media/',
'targetPath' => '_migrated/media/'
)
)
)

Definition at line 59 of file TceformsUpdateWizard.php.

◆ $title

TYPO3\CMS\Install\Updates\TceformsUpdateWizard::$title = 'Migrate all file relations from tt_content.image and pages.media'
protected

Definition at line 38 of file TceformsUpdateWizard.php.

◆ RECORDS_PER_QUERY

const TYPO3\CMS\Install\Updates\TceformsUpdateWizard::RECORDS_PER_QUERY = 1000

Number of records fetched per database query Used to prevent memory overflows for huge databases

Definition at line 33 of file TceformsUpdateWizard.php.