Updates
- Type
- Class
- Namespace
- craft\services
- Inherits
- craft\services\Updates » yii\base\Component » yii\base\BaseObject
- Implements
- yii\base\Configurable
- Since
- 3.0.0
Updates service.
An instance of the Updates service is globally accessible in Craft via Craft::$app->updates
.
# Public Properties
# areMigrationsPending
- Type
- boolean
- Default value
null
- Access
- Read-only
- Since
- 3.5.15
# cacheKey
- Type
- string
- Default value
'updates'
# hasCraftVersionChanged
- Type
- boolean
- Default value
null
- Access
- Read-only
# isCraftDbMigrationNeeded
- Type
- boolean
- Default value
null
- Access
- Read-only
# isCraftSchemaVersionCompatible
- Type
- boolean
- Default value
null
- Access
- Read-only
# isCriticalUpdateAvailable
- Type
- boolean
- Default value
null
- Access
- Read-only
# isPluginDbUpdateNeeded
- Type
- boolean
- Default value
null
- Access
- Read-only
# isUpdateInfoCached
- Type
- boolean
- Default value
null
- Access
- Read-only
# newPluginInfo
- Type
- craft\base\PluginInterface
- Default value
null
- Access
- Write-only
# pendingMigrationHandles
- Type
- string[]
- Default value
null
- Access
- Read-only
# totalAvailableUpdates
- Type
- integer
- Default value
null
- Access
- Read-only
# updates
- Type
- craft\models\Updates
- Default value
null
- Access
- Read-only
# wasCraftBreakpointSkipped
- Type
- boolean
- Default value
null
- Access
- Read-only
# Public Methods
Method | Description |
---|---|
__call() | Calls the named method which is not a class method. |
__clone() | This method is called after the object is created by cloning an existing one. |
__construct() | Constructor. |
__get() | Returns the value of an object property. |
__isset() | Checks if a property is set, i.e. defined and not null. |
__set() | Sets value of an object property. |
__unset() | Sets an object property to null. |
attachBehavior() | Attaches a behavior to this component. |
attachBehaviors() | Attaches a list of behaviors to the component. |
behaviors() | Returns a list of behaviors that this component should behave as. |
cacheUpdates() | Caches new update info. |
canGetProperty() | Returns a value indicating whether a property can be read. |
canSetProperty() | Returns a value indicating whether a property can be set. |
className() | Returns the fully qualified name of this class. |
detachBehavior() | Detaches a behavior from the component. |
detachBehaviors() | Detaches all behaviors from the component. |
ensureBehaviors() | Makes sure that the behaviors declared in behaviors() are attached to this component. |
getAreMigrationsPending() | Returns whether there are any pending migrations. |
getBehavior() | Returns the named behavior object. |
getBehaviors() | Returns all behaviors attached to this component. |
getHasCraftVersionChanged() | Returns whether a different Craft version has been uploaded. |
getIsCraftDbMigrationNeeded() | Returns whether Craft needs to run any database migrations. |
getIsCraftSchemaVersionCompatible() | Returns whether the uploaded DB schema is equal to or greater than the installed schema. |
getIsCriticalUpdateAvailable() | Returns whether a critical update is available. |
getIsPluginDbUpdateNeeded() | Returns whether a plugin needs to run a database update. |
getIsUpdateInfoCached() | Returns whether the update info is cached. |
getPendingMigrationHandles() | Returns a list of things with updated schema versions. |
getTotalAvailableUpdates() | |
getUpdates() | |
getWasCraftBreakpointSkipped() | Returns true if the version stored in craft_info is less than the minimum required version on the file system. |
hasEventHandlers() | Returns a value indicating whether there is any handler attached to the named event. |
hasMethod() | Returns a value indicating whether a method is defined. |
hasProperty() | Returns a value indicating whether a property is defined. |
init() | Initializes the object. |
off() | Detaches an existing event handler from this component. |
on() | Attaches an event handler to an event. |
runMigrations() | Runs the pending migrations for the given list of handles. |
setNewPluginInfo() | |
trigger() | Triggers an event. |
updateCraftVersionInfo() | Updates the Craft version info in the craft_info table. |
# cacheUpdates()
- Since
- 3.3.16
Caches new update info.
Arguments
$updateData
(array)
Returns
# getAreMigrationsPending()
- Since
- 3.5.15
Returns whether there are any pending migrations.
Arguments
$includeContent
(boolean) – Whether pending content migrations should be considered
Returns
# getHasCraftVersionChanged()
Returns whether a different Craft version has been uploaded.
Returns
# getIsCraftDbMigrationNeeded()
Returns whether Craft needs to run any database migrations.
Returns
# getIsCraftSchemaVersionCompatible()
Returns whether the uploaded DB schema is equal to or greater than the installed schema.
Returns
# getIsCriticalUpdateAvailable()
Returns whether a critical update is available.
Arguments
$check
(boolean) – Whether to check for updates if they aren't cached already
Returns
# getIsPluginDbUpdateNeeded()
Returns whether a plugin needs to run a database update.
Returns
# getIsUpdateInfoCached()
Returns whether the update info is cached.
Returns
# getPendingMigrationHandles()
Returns a list of things with updated schema versions.
Craft CMS will be represented as "craft", plugins will be represented by their handles, and content will be represented as "content".
See also runMigrations() View source
Arguments
$includeContent
(boolean) – Whether pending content migrations should be considered
Returns
string[]
# getTotalAvailableUpdates()
Arguments
$check
(boolean) – Whether to check for updates if they aren't cached already
Returns
# getUpdates()
Arguments
$refresh
(boolean)
Returns
# getWasCraftBreakpointSkipped()
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.
Returns
# runMigrations()
Runs the pending migrations for the given list of handles.
See also getPendingMigrationHandles() View source
Arguments
$handles
(string[]) – The list of handles to run migrations for
Throws
# setNewPluginInfo()
Arguments
$plugin
(craft\base\PluginInterface)
Returns
# updateCraftVersionInfo()
Updates the Craft version info in the craft_info table.
Returns
← Tokens UserGroups →