‪TYPO3CMS  10.4
TYPO3\CMS\Extensionmanager\Utility\UpdateScriptUtility Class Reference

Public Member Functions

mixed executeUpdateIfNeeded ($extensionKey)
 
bool checkUpdateScriptExists ($extensionKey)
 

Protected Member Functions

string requireUpdateScript ($extensionKey)
 
string determineUpdateClassName ($extensionKey)
 

Detailed Description

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

This class is a specific ExtensionManager implementation and is not part of the Public TYPO3 API.

Definition at line 26 of file UpdateScriptUtility.php.

Member Function Documentation

◆ checkUpdateScriptExists()

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

Checks if an update class file exists.

Does not check if some update is needed.

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

Definition at line 81 of file UpdateScriptUtility.php.

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

◆ determineUpdateClassName()

string 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
ExtensionManagerException‪If an update script is present but no ext_update class can be loaded

Definition at line 98 of file UpdateScriptUtility.php.

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

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

◆ executeUpdateIfNeeded()

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

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

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

Definition at line 34 of file UpdateScriptUtility.php.

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

◆ requireUpdateScript()

string 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 54 of file UpdateScriptUtility.php.

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

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