UpdatesService

Type
Class
Namespace
Craft
Inherits
Craft\UpdatesService » Craft\BaseApplicationComponent » CApplicationComponent » CComponent
Implements
IApplicationComponent
Since
1.0

Class UpdatesService

See also http://craftcms.com

View source

Public Properties

PropertyDescription
$behaviorsarray – The behaviors that should be attached to this component.

Public Methods

MethodDescription
__call()Calls the named method which is not a class method.
__get()Returns a property value, an event handler list or a behavior based on its name.
__isset()Checks if a property value is null.
__set()Sets value of a component property.
__unset()Sets a component property to be null.
asa()Returns the named behavior object.
attachBehavior()Attaches a behavior to this component.
attachBehaviors()Attaches a list of behaviors to the component.
attachEventHandler()Attaches an event handler to an event.
backupDatabase()
backupFiles()
canGetProperty()Determines whether a property can be read.
canSetProperty()Determines whether a property can be set.
check()
checkPluginReleaseFeeds()Check plugins’ release feeds and include any pending updates in the given UpdateModel
criticalCraftUpdateAvailable()
criticalPluginUpdateAvailable()
detachBehavior()Detaches a behavior from the component.
detachBehaviors()Detaches all behaviors from the component.
detachEventHandler()Detaches an existing event handler.
disableBehavior()Disables an attached behavior.
disableBehaviors()Disables all behaviors attached to this component.
enableBehavior()Enables an attached behavior.
enableBehaviors()Enables all behaviors attached to this component.
evaluateExpression()Evaluates a PHP expression or callback under the context of this component.
flushUpdateInfoFromCache()
getEventHandlers()Returns the list of attached event handlers for an event.
getIsInitialized()Checks if this application component has been initialized.
getPluginsThatNeedDbUpdate()Returns a list of plugins that are in need of a database update.
getTotalAvailableUpdates()
getUnwritableFolders()Checks to see if Craft can write to a defined set of folders/files that are needed for auto-update to work.
getUpdates()
hasCraftVersionChanged()Returns whether a different Craft version has been uploaded.
hasEvent()Determines whether an event is defined.
hasEventHandler()Checks whether the named event has attached handlers.
hasProperty()Determines whether a property is defined.
init()Initializes the application component.
isBreakpointUpdateNeeded()Returns true if the version stored in craft_info is less than the minimum required version on the file system. This effectively makes sure that a user cannot manually update past a manual breakpoint.
isCraftDbMigrationNeeded()Returns whether Craft needs to run any database migrations.
isCriticalUpdateAvailable()
isInitialized()Checks if this application component has been initialized yet, or not.
isManualUpdateRequired()
isPluginDbUpdateNeeded()Returns if a plugin needs to run a database update or not.
isSchemaVersionCompatible()Returns whether the uploaded DB schema is equal to or greater than the installed schema
isUpdateInfoCached()
onBeginUpdate()Fires an 'onBeginUpdate' event.
onEndUpdate()Fires an 'onEndUpdate' event.
prepareUpdate()
processUpdateDownload()
raiseEvent()Raises an event.
rollbackUpdate()
setNewPluginInfo()
updateCleanUp()
updateCraftVersionInfo()Updates the Craft version info in the craft_info table.
updateDatabase()
updateFiles()

backupDatabase()

Signature

public array backupDatabase ( )

backupFiles()

View source

Arguments

Returns

array

Signature

public array backupFiles ( $uid, $handle )

check()

Signature

public Craft\UpdateModel check ( )

checkPluginReleaseFeeds()

Check plugins’ release feeds and include any pending updates in the given UpdateModel

View source

Arguments

Signature

public void checkPluginReleaseFeeds ( Craft\UpdateModel $updateModel )

criticalCraftUpdateAvailable()

View source

Arguments

  • $craftReleases

Returns

boolean

Signature

public boolean criticalCraftUpdateAvailable ( $craftReleases )

criticalPluginUpdateAvailable()

View source

Arguments

  • $plugins

Returns

boolean

Signature

public boolean criticalPluginUpdateAvailable ( $plugins )

flushUpdateInfoFromCache()

Signature

public boolean flushUpdateInfoFromCache ( )

getPluginsThatNeedDbUpdate()

Returns a list of plugins that are in need of a database update.

View source

Returns

array, null

Signature

public array, null getPluginsThatNeedDbUpdate ( )

getTotalAvailableUpdates()

Signature

public integer getTotalAvailableUpdates ( )

getUnwritableFolders()

Checks to see if Craft can write to a defined set of folders/files that are needed for auto-update to work.

View source

Returns

array, null

Signature

public array, null getUnwritableFolders ( )

getUpdates()

View source

Arguments

Returns

Craft\UpdateModel, false

Signature

public Craft\UpdateModel, false getUpdates ( $forceRefresh = false )

hasCraftVersionChanged()

Returns whether a different Craft version has been uploaded.

View source

Returns

boolean

Signature

public boolean hasCraftVersionChanged ( )

isBreakpointUpdateNeeded()

Returns true if the version stored in craft_info is less than the minimum required version on the file system. This effectively makes sure that a user cannot manually update past a manual breakpoint.

View source

Returns

boolean

Signature

public boolean isBreakpointUpdateNeeded ( )

isCraftDbMigrationNeeded()

Returns whether Craft needs to run any database migrations.

View source

Returns

boolean

Signature

public boolean isCraftDbMigrationNeeded ( )

isCriticalUpdateAvailable()

View source

Returns

mixed

Signature

public mixed isCriticalUpdateAvailable ( )

isManualUpdateRequired()

View source

Returns

mixed

Signature

public mixed isManualUpdateRequired ( )

isPluginDbUpdateNeeded()

Returns if a plugin needs to run a database update or not.

View source

Returns

boolean

Signature

public boolean isPluginDbUpdateNeeded ( )

isSchemaVersionCompatible()

Returns whether the uploaded DB schema is equal to or greater than the installed schema

View source

Returns

boolean

Signature

public boolean isSchemaVersionCompatible ( )

isUpdateInfoCached()

Signature

public boolean isUpdateInfoCached ( )

onBeginUpdate()

Fires an 'onBeginUpdate' event.

View source

Arguments

Returns

null

Signature

public null onBeginUpdate ( Craft\Event $event )

onEndUpdate()

Fires an 'onEndUpdate' event.

View source

Arguments

Returns

null

Signature

public null onEndUpdate ( Craft\Event $event )

prepareUpdate()

View source

Arguments

  • $manual
  • $handle

Returns

array

Signature

public array prepareUpdate ( $manual, $handle )

processUpdateDownload()

View source

Arguments

Returns

array

Signature

public array processUpdateDownload ( $md5, $handle )

rollbackUpdate()

View source

Arguments

Returns

array

Signature

public array rollbackUpdate ( $uid, $handle, $dbBackupPath = false )

setNewPluginInfo()

View source

Arguments

Returns

boolean

Signature

public boolean setNewPluginInfo ( Craft\BasePlugin $plugin )

updateCleanUp()

View source

Arguments

Returns

array

Signature

public array updateCleanUp ( $uid, $handle )

updateCraftVersionInfo()

Updates the Craft version info in the craft_info table.

View source

Returns

boolean

Signature

public boolean updateCraftVersionInfo ( )

updateDatabase()

View source

Arguments

Returns

array

Throws

Signature

public array updateDatabase ( $handle )

updateFiles()

View source

Arguments

Returns

array

Signature

public array updateFiles ( $uid, $handle )