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

Public Member Functions

 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)
 

Protected Member Functions

 migrateRecord (array $reference)
 
 convertFileLinks (array $reference, array $record)
 
 fetchReferencedFile ($path, array $reference)
 
 saveChanges ($modifiedText, array $reference, $file)
 
 findOldLinks ()
 
- Protected Member Functions inherited from TYPO3\CMS\Install\Updates\AbstractUpdate
 markWizardAsDone ($confValue=1)
 
 isWizardDone ()
 
 getDatabaseConnection ()
 

Protected Attributes

 $title = 'Migrate all file links of RTE-enabled fields to FAL'
 
 $fileAdminDir
 
 $storage
 
 $rteHtmlParser
 
 $convertedLinkCounter = 0
 
 $isDbalInstalled = FALSE
 
 $errors = array()
 
 $queries = array()
 
- Protected Attributes inherited from TYPO3\CMS\Install\Updates\AbstractUpdate
 $title
 
 $identifier
 

Additional Inherited Members

- Public Attributes inherited from TYPO3\CMS\Install\Updates\AbstractUpdate
 $pObj
 
 $userInput
 
 $versionNumber
 

Detailed Description

Upgrade wizard that rewrites all file links to FAL references.

The content string and the reference index (sys_refindex) are updated accordingly.

Definition at line 24 of file RteFileLinksUpdateWizard.php.

Member Function Documentation

◆ convertFileLinks()

TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard::convertFileLinks ( array  $reference,
array  $record 
)
protected

The actual transformation of the links pretty similar to TS_links_rte in RteHtmlParser

Parameters
array$referencesys_refindex information
array$recordOriginal record pointed to by the sys_refindex reference
Returns
void

Definition at line 186 of file RteFileLinksUpdateWizard.php.

References $result, TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard\fetchReferencedFile(), and TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard\saveChanges().

Referenced by TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard\migrateRecord().

◆ fetchReferencedFile()

TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard::fetchReferencedFile (   $path,
array  $reference 
)
protected

Tries to fetch the file object corresponding to the given path.

Parameters
string$pathPath to a file (starting with "fileadmin/")
array$referenceCorresponding sys_refindex entry
Returns
null|

Definition at line 223 of file RteFileLinksUpdateWizard.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard\convertFileLinks().

◆ findOldLinks()

TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard::findOldLinks ( )
protected

Use sys_refindex to find all links to "old" files in typolink tags.

This will find any RTE-enabled field.

Returns
array Entries from sys_refindex

Definition at line 307 of file RteFileLinksUpdateWizard.php.

References $GLOBALS.

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

◆ migrateRecord()

TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard::migrateRecord ( array  $reference)
protected

Processes each record and updates the database

Parameters
array$referenceReference to a record from sys_refindex
Returns
void

Definition at line 163 of file RteFileLinksUpdateWizard.php.

References $GLOBALS, and TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard\convertFileLinks().

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

◆ performUpdate()

TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard::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 125 of file RteFileLinksUpdateWizard.php.

References TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard\$queries, TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard\findOldLinks(), and TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard\migrateRecord().

◆ saveChanges()

TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard::saveChanges (   $modifiedText,
array  $reference,
  $file 
)
protected

Saves the modified content to the database and updates the sys_refindex accordingly.

Parameters
string$modifiedTextOriginal content with the file links replaced
array$referencesys_refindex record
\TYPO3\CMS\Core\Resource\AbstractFile$file
Returns
void

Definition at line 263 of file RteFileLinksUpdateWizard.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard\convertFileLinks().

Member Data Documentation

◆ $convertedLinkCounter

TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard::$convertedLinkCounter = 0
protected

Definition at line 52 of file RteFileLinksUpdateWizard.php.

◆ $errors

TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard::$errors = array()
protected

Definition at line 64 of file RteFileLinksUpdateWizard.php.

◆ $fileAdminDir

TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard::$fileAdminDir
protected

Definition at line 35 of file RteFileLinksUpdateWizard.php.

◆ $isDbalInstalled

TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard::$isDbalInstalled = FALSE
protected

Definition at line 58 of file RteFileLinksUpdateWizard.php.

◆ $queries

TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard::$queries = array()
protected

◆ $rteHtmlParser

TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard::$rteHtmlParser
protected

Definition at line 46 of file RteFileLinksUpdateWizard.php.

◆ $storage

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

Definition at line 41 of file RteFileLinksUpdateWizard.php.

◆ $title

TYPO3\CMS\Install\Updates\RteFileLinksUpdateWizard::$title = 'Migrate all file links of RTE-enabled fields to FAL'
protected

Definition at line 30 of file RteFileLinksUpdateWizard.php.