Trait craft\base\ApplicationTrait
- Implemented by
- craft\console\Application, craft\web\Application
- Available since version
- 3.0
- Source Code
- https://github.com/craftcms/cms/blob/master/src/base/ApplicationTrait.php
ApplicationTrait
Property | Type | Description | Defined By |
---|---|---|---|
$env |
string, null | The environment ID Craft is currently running in. | craft\base\ApplicationTrait |
$minVersionRequired |
string, null | The minimum Craft build number required to update to this build. | craft\base\ApplicationTrait |
$schemaVersion |
string, null | Craft’s schema version number. | craft\base\ApplicationTrait |
Property Details
$env
public property
#
The environment ID Craft is currently running in.
public string, null $env = null
$minVersionRequired
public property
#
The minimum Craft build number required to update to this build.
public string, null $minVersionRequired = null
$schemaVersion
public property
#
Craft’s schema version number.
public string, null $schemaVersion = null
Method Details
disableMaintenanceMode()
public method
#
Disables Maintenance Mode.
See also:
public boolean disableMaintenanceMode ( )
enableMaintenanceMode()
public method
#
Enables Maintenance Mode.
See also:
public boolean enableMaintenanceMode ( )
getApi()
public method
#
Returns the API service.
public craft\services\Api getApi ( )
return | craft\services\Api | The API service |
---|
getAssetIndexer()
public method
#
Returns the asset indexing service.
public craft\services\AssetIndexer getAssetIndexer ( )
return | craft\services\AssetIndexer | The asset indexing service |
---|
getAssetTransforms()
public method
#
Returns the asset transforms service.
public craft\services\AssetTransforms getAssetTransforms ( )
return | craft\services\AssetTransforms | The asset transforms service |
---|
getAssets()
public method
#
Returns the assets service.
public craft\services\Assets getAssets ( )
return | craft\services\Assets | The assets service |
---|
getCanTestEditions()
public method
#
Returns whether Craft is running on a domain that is eligible to test out the editions.
public boolean getCanTestEditions ( )
getCanUpgradeEdition()
public method
#
Returns whether Craft is eligible to be upgraded to a different edition.
public boolean getCanUpgradeEdition ( )
getCategories()
public method
#
Returns the categories service.
public craft\services\Categories getCategories ( )
return | craft\services\Categories | The categories service |
---|
getComposer()
public method
#
Returns the Composer service.
public craft\services\Composer getComposer ( )
return | craft\services\Composer | The Composer service |
---|
getConfig()
public method
#
Returns the config service.
public craft\services\Config getConfig ( )
return | craft\services\Config | The config service |
---|
getContent()
public method
#
Returns the content service.
public craft\services\Content getContent ( )
return | craft\services\Content | The content service |
---|
getContentMigrator()
public method
#
Returns the content migration manager.
public craft\db\MigrationManager getContentMigrator ( )
return | craft\db\MigrationManager | The content migration manager |
---|
getDashboard()
public method
#
Returns the dashboard service.
public craft\services\Dashboard getDashboard ( )
return | craft\services\Dashboard | The dashboard service |
---|
getDeprecator()
public method
#
Returns the deprecator service.
public craft\services\Deprecator getDeprecator ( )
return | craft\services\Deprecator | The deprecator service |
---|
getEdition()
public method
#
Returns the Craft edition.
public integer getEdition ( )
getEditionName()
public method
#
Returns the name of the Craft edition.
public string getEditionName ( )
getElementIndexes()
public method
#
Returns the element indexes service.
public craft\services\ElementIndexes getElementIndexes ( )
return | craft\services\ElementIndexes | The element indexes service |
---|
getElements()
public method
#
Returns the elements service.
public craft\services\Elements getElements ( )
return | craft\services\Elements | The elements service |
---|
getEntries()
public method
#
Returns the entries service.
public craft\services\Entries getEntries ( )
return | craft\services\Entries | The entries service |
---|
getEntryRevisions()
public method
#
Returns the entry revisions service.
public craft\services\EntryRevisions getEntryRevisions ( )
return | craft\services\EntryRevisions | The entry revisions service |
---|
getEt()
public method
#
Returns the E.T. service.
public craft\services\Et getEt ( )
return | craft\services\Et | The E.T. service |
---|
getFeeds()
public method
#
Returns the feeds service.
public craft\feeds\Feeds getFeeds ( )
return | craft\feeds\Feeds | The feeds service |
---|
getFields()
public method
#
Returns the fields service.
public craft\services\Fields getFields ( )
return | craft\services\Fields | The fields service |
---|
getGlobals()
public method
#
Returns the globals service.
public craft\services\Globals getGlobals ( )
return | craft\services\Globals | The globals service |
---|
getHasWrongEdition()
public method
#
Returns whether Craft is running with the wrong edition.
public boolean getHasWrongEdition ( )
getImages()
public method
#
Returns the images service.
public \craft\services\Images getImages ( )
return | \craft\services\Images | The images service |
---|
getInfo()
public method
#
Returns the info model, or just a particular attribute.
public craft\models\Info getInfo ( )
throws | yii\web\ServerErrorHttpException | if the info table is missing its row |
---|
getIsDbConnectionValid()
public method
#
Returns whether the DB connection settings are valid.
public boolean getIsDbConnectionValid ( )
getIsInMaintenanceMode()
public method
#
Returns whether someone is currently performing a system update.
See also:
public boolean getIsInMaintenanceMode ( )
getIsInstalled()
public method
#
Returns whether Craft is installed.
public boolean getIsInstalled ( )
getIsMultiSite()
public method
#
Returns whether this Craft install has multiple sites.
public boolean getIsMultiSite ( )
getIsSystemOn()
public method
#
Returns whether the front end is accepting HTTP requests.
public boolean getIsSystemOn ( )
getLicensedEdition()
public method
#
Returns the edition Craft is actually licensed to run in.
public integer, null getLicensedEdition ( )
getLicensedEditionName()
public method
#
Returns the name of the edition Craft is actually licensed to run in.
public string, null getLicensedEditionName ( )
getLocale()
public method
#
Returns a Locale object for the target language.
public craft\i18n\Locale getLocale ( )
return | craft\i18n\Locale | The Locale object for the target language |
---|
getMailer()
public method
#
Returns the current mailer.
public craft\mail\Mailer getMailer ( )
return | craft\mail\Mailer | The mailer component |
---|
getMatrix()
public method
#
Returns the matrix service.
public craft\services\Matrix getMatrix ( )
return | craft\services\Matrix | The matrix service |
---|
getMigrator()
public method
#
Returns the application’s migration manager.
public craft\db\MigrationManager getMigrator ( )
return | craft\db\MigrationManager | The application’s migration manager |
---|
getMutex()
public method
#
Returns the application’s mutex service.
public yii\mutex\Mutex getMutex ( )
return | yii\mutex\Mutex | The application’s mutex service |
---|
getPath()
public method
#
Returns the path service.
public craft\services\Path getPath ( )
return | craft\services\Path | The path service |
---|
getPluginStore()
public method
#
Returns the plugin store service.
public craft\services\PluginStore getPluginStore ( )
return | craft\services\PluginStore | The plugin store service |
---|
getPlugins()
public method
#
Returns the plugins service.
public craft\services\Plugins getPlugins ( )
return | craft\services\Plugins | The plugins service |
---|
getQueue()
public method
#
Returns the queue service.
public \yii\queue\db\Queue, craft\queue\QueueInterface getQueue ( )
return | \yii\queue\db\Queue, craft\queue\QueueInterface | The queue service |
---|
getRelations()
public method
#
Returns the relations service.
public craft\services\Relations getRelations ( )
return | craft\services\Relations | The relations service |
---|
getRoutes()
public method
#
Returns the routes service.
public craft\services\Routes getRoutes ( )
return | craft\services\Routes | The routes service |
---|
getSearch()
public method
#
Returns the search service.
public craft\services\Search getSearch ( )
return | craft\services\Search | The search service |
---|
getSections()
public method
#
Returns the sections service.
public craft\services\Sections getSections ( )
return | craft\services\Sections | The sections service |
---|
getSites()
public method
#
Returns the sites service.
public craft\services\Sites getSites ( )
return | craft\services\Sites | The sites service |
---|
getStructures()
public method
#
Returns the structures service.
public craft\services\Structures getStructures ( )
return | craft\services\Structures | The structures service |
---|
getSystemMessages()
public method
#
Returns the system email messages service.
public craft\services\SystemMessages getSystemMessages ( )
return | craft\services\SystemMessages | The system email messages service |
---|
getSystemSettings()
public method
#
Returns the system settings service.
public craft\services\SystemSettings getSystemSettings ( )
return | craft\services\SystemSettings | The system settings service |
---|
getSystemUid()
public method
#
Returns the system's UID.
public string, null getSystemUid ( )
getTags()
public method
#
Returns the tags service.
public craft\services\Tags getTags ( )
return | craft\services\Tags | The tags service |
---|
getTargetLanguage()
public method
#
Returns the target app language.
public string getTargetLanguage ( \craft\base\bool $useUserLanguage = true )
$useUserLanguage |
boolean | Whether the user's preferred language should be used. |
getTemplateCaches()
public method
#
Returns the template cache service.
public craft\services\TemplateCaches getTemplateCaches ( )
return | craft\services\TemplateCaches | The template caches service |
---|
getTokens()
public method
#
Returns the tokens service.
public craft\services\Tokens getTokens ( )
return | craft\services\Tokens | The tokens service |
---|
getUpdates()
public method
#
Returns the updates service.
public craft\services\Updates getUpdates ( )
return | craft\services\Updates | The updates service |
---|
getUserGroups()
public method
#
Returns the user groups service.
public craft\services\UserGroups getUserGroups ( )
return | craft\services\UserGroups | The user groups service |
---|
getUserPermissions()
public method
#
Returns the user permissions service.
public craft\services\UserPermissions getUserPermissions ( )
return | craft\services\UserPermissions | The user permissions service |
---|
getUsers()
public method
#
Returns the users service.
public craft\services\Users getUsers ( )
return | craft\services\Users | The users service |
---|
getUtilities()
public method
#
Returns the utilities service.
public craft\services\Utilities getUtilities ( )
return | craft\services\Utilities | The utilities service |
---|
getVolumes()
public method
#
Returns the volumes service.
public craft\services\Volumes getVolumes ( )
return | craft\services\Volumes | The volumes service |
---|
getYiiVersion()
public method
#
Returns the Yii framework version.
public string getYiiVersion ( )
requireEdition()
public method
#
Requires that Craft is running an equal or better edition than what's passed in
public void requireEdition ( \craft\base\int $edition, \craft\base\bool $orBetter = true )
$edition |
integer | The Craft edition to require. |
$orBetter |
boolean | If true, makes $edition the minimum edition required. |
throws | craft\errors\WrongEditionException | if attempting to do something not allowed by the current Craft edition |
---|
saveInfo()
public method
#
Updates the info row.
public boolean saveInfo ( craft\models\Info $info )
$info |
craft\models\Info |
setEdition()
public method
#
Sets the Craft edition.
public boolean setEdition ( \craft\base\int $edition )
$edition |
integer | The edition to set. |
setIsInstalled()
public method
#
Sets Craft's record of whether it's installed
public void setIsInstalled ( $value = true )
$value |
boolean, null |
updateTargetLanguage()
public method
#
Sets the target application language.
public void updateTargetLanguage ( \craft\base\bool $useUserLanguage = null )
$useUserLanguage |
boolean, null | Whether the user's preferred language should be used. If null, it will be based on whether it's a CP or console request. |