TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility Class Reference

Public Member Functions

 executeUpdateIfNeeded ($extensionKey)
 
 checkUpdateScriptExists ($extensionKey)
 

Protected Member Functions

 requireUpdateScript ($extensionKey)
 
 determineUpdateClassName ($extensionKey)
 

Detailed Description

Utility to find and execute class.ext_update.php scripts of extensions

Definition at line 23 of file UpdateScriptUtility.php.

Member Function Documentation

◆ checkUpdateScriptExists()

TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility::checkUpdateScriptExists (   $extensionKey)

Checks if an update class file exists.

Does not check if some update is needed.

Parameters
string$extensionKeyExtension key
Returns
bool TRUE, if there is some update script and it needs to be executed

Definition at line 78 of file UpdateScriptUtility.php.

References TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility\determineUpdateClassName(), and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ determineUpdateClassName()

TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility::determineUpdateClassName (   $extensionKey)
protected

Determine the real class name to use

Parameters
string$extensionKey
Returns
string Returns the final class name if an update script is present, otherwise empty string
Exceptions
ExtensionManagerExceptionIf an update script is present but no ext_update class can be loaded

Definition at line 95 of file UpdateScriptUtility.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName(), TYPO3\CMS\Core\Utility\GeneralUtility\getUrl(), and TYPO3\CMS\Core\Utility\GeneralUtility\writeFileToTypo3tempDir().

Referenced by TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility\checkUpdateScriptExists(), and TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility\requireUpdateScript().

◆ executeUpdateIfNeeded()

TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility::executeUpdateIfNeeded (   $extensionKey)

Returns true, if ext_update class says it wants to run.

Parameters
string$extensionKeyextension key
Returns
mixed NULL, if update is not available, else update script return

Definition at line 31 of file UpdateScriptUtility.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), and TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility\requireUpdateScript().

◆ requireUpdateScript()

TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility::requireUpdateScript (   $extensionKey)
protected

Require update script. Throws exception if update script does not exist, so checkUpdateScriptExists() should be called before

Parameters
string$extensionKey
Returns
string Class name of update script
Exceptions
ExtensionManagerException

Definition at line 51 of file UpdateScriptUtility.php.

References TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility\determineUpdateClassName().

Referenced by TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility\executeUpdateIfNeeded().