TYPO3  7.6
Public Member Functions | Protected Member Functions | List of all members
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 (   $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 UpdateScriptUtility\determineUpdateClassName(), and GeneralUtility\makeInstance().

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 GeneralUtility\getFileAbsFileName(), GeneralUtility\getUrl(), and GeneralUtility\writeFileToTypo3tempDir().

Referenced by UpdateScriptUtility\checkUpdateScriptExists(), and UpdateScriptUtility\requireUpdateScript().

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 GeneralUtility\makeInstance(), and UpdateScriptUtility\requireUpdateScript().

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 UpdateScriptUtility\determineUpdateClassName().

Referenced by UpdateScriptUtility\executeUpdateIfNeeded().