Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe UpdateModel
+ Graphe d'héritage de UpdateModel:

Fonctions membres publiques

 applyUpdateSite ()
 
 refreshUpdates ($force=false)
 
 getCheckForSelfUpdate ()
 
 getUpdateInformation ()
 
 purge ()
 
 download ()
 
 createRestorationFile ($basename=null)
 
 createUpdateFile ($basename=null)
 
 finaliseUpgrade ()
 
 cleanUp ()
 
 upload ()
 
 captiveLogin ($credentials)
 
 captiveFileExists ()
 
 removePackageFiles ()
 
 getPhpOptions ()
 
 getPhpSettings ()
 
 isDatabaseTypeSupported ()
 
 isPhpVersionSupported ()
 
 getIniParserAvailability ()
 
 getNonCoreExtensions ()
 
 getNonCorePlugins ($folderFilter=['system', 'user', 'authentication', 'actionlog', 'multifactorauth'])
 
 fetchCompatibility ($extensionID, $joomlaTargetVersion)
 
 isTemplateActive ($template)
 
- Fonctions membres publiques hérités de BaseDatabaseModel
 __construct ($config=array(), MVCFactoryInterface $factory=null)
 
 getTable ($name='', $prefix='', $options=array())
 
 isCheckedOut ($item)
 
 getDbo ()
 
 setDbo (DatabaseInterface $db=null)
 
 __get ($name)
 
- Fonctions membres publiques hérités de BaseModel
 __construct ($config=array())
 
 getName ()
 
- Fonctions membres publiques hérités de CMSObject
 __construct ($properties=null)
 
 __toString ()
 
 def ($property, $default=null)
 
 get ($property, $default=null)
 
 getProperties ($public=true)
 
 getError ($i=null, $toString=true)
 
 getErrors ()
 
 set ($property, $value=null)
 
 setProperties ($properties)
 
 setError ($error)
 
- Fonctions membres publiques hérités de StatefulModelInterface
 getState ($property=null, $default=null)
 
 setState ($property, $value=null)
 
- Fonctions membres publiques hérités de DispatcherAwareInterface
 setDispatcher (DispatcherInterface $dispatcher)
 
- Fonctions membres publiques hérités de CurrentUserInterface
 setCurrentUser (User $currentUser)
 
- Fonctions membres publiques hérités de CacheControllerFactoryAwareInterface
 setCacheControllerFactory (CacheControllerFactoryInterface $factory)
 
- Fonctions membres publiques hérités de DatabaseAwareInterface
 setDatabase (DatabaseInterface $db)
 

Fonctions membres protégées

 downloadPackage ($url, $target)
 
 translateExtensionName (&$item)
 
- Fonctions membres protégées hérités de BaseDatabaseModel
 _getList ($query, $limitstart=0, $limit=0)
 
 _getListCount ($query)
 
 _createTable ($name, $prefix='Table', $config=array())
 
 bootComponent ($component)
 
 dispatchEvent (EventInterface $event)
 

Fonctions membres privées

 isChecksumValid ($packagefile, $updateObject)
 
 getConfiguredDatabaseType ()
 
 getTargetMinimumPHPVersion ()
 
 getUpdateSitesInfo ($extensionID)
 
 getCollectionDetailsUrls ($updateSiteInfo, $joomlaTargetVersion)
 
 checkCompatibility ($updateFileUrl, $joomlaTargetVersion)
 

Attributs privés

 $updateInformation = null
 

Membres hérités additionnels

- Fonctions membres publiques statiques hérités de BaseModel
static addIncludePath ($path='', $prefix='')
 
- Attributs protégés hérités de BaseDatabaseModel
 $option = null
 
 $event_clean_cache = null
 
- Attributs protégés hérités de BaseModel
 $name
 
- Attributs protégés hérités de CMSObject
 $_errors = array()
 
- Attributs protégés statiques hérités de BaseModel
static $paths
 

Description détaillée

Joomla! update overview Model

Depuis
2.5.4

Documentation des fonctions membres

◆ applyUpdateSite()

applyUpdateSite ( )

Detects if the Joomla! update site currently in use matches the one configured in this component. If they don't match, it changes it.

Renvoie
void
Depuis
2.5.4

"Minor & Patch Release for Current version (recommended and default)". The commented "case" below are for documenting where 'default' and legacy options falls case 'default': case 'lts': case 'sts': (It's shown as "Default" because that option does not exist any more) case 'nochange':

Références $db, $id, $params, $query, Text\_(), Factory\getApplication(), Joomla\Database\getDatabase(), Joomla\CMS\MVC\Model\getDbo(), ExtensionHelper\getExtensionRecord(), ComponentHelper\getParams(), et ParameterType\INTEGER.

◆ captiveFileExists()

captiveFileExists ( )

Does the captive (temporary) file we uploaded before still exist?

Renvoie
boolean
Depuis
3.6.0

Références File\exists(), Factory\getApplication(), et null.

◆ captiveLogin()

captiveLogin (   $credentials)

Checks the super admin credentials are valid for the currently logged in users

Paramètres
array$credentialsThe credentials to authenticate the user with
Renvoie
boolean
Depuis
3.6.0

Références $user, Authentication\getInstance(), Factory\getUser(), null, et Authentication\STATUS_SUCCESS.

◆ checkCompatibility()

checkCompatibility (   $updateFileUrl,
  $joomlaTargetVersion 
)
private

Method to check non core extensions for compatibility.

Paramètres
string$updateFileUrlThe items update XML url.
string$joomlaTargetVersionThe Joomla! version to test against
Renvoie
array An array of strings with compatible version numbers
Depuis
3.10.0

Références ComponentHelper\getParams(), et Updater\STABILITY_STABLE.

◆ cleanUp()

cleanUp ( )

Removes the extracted package file and trigger onJoomlaAfterUpdate event.

The onJoomlaAfterUpdate event compares the stored list of files previously overridden with the updated core files, finding out which files have changed during the update, thereby determining how many and which override files need to be checked and possibly updated after the Joomla update.

Renvoie
void
Depuis
2.5.4

Références $app, File\delete(), File\exists(), Factory\getApplication(), PluginHelper\importPlugin(), JPATH_ROOT, et null.

◆ createRestorationFile()

createRestorationFile (   $basename = null)

Backwards compatibility. Use createUpdateFile() instead.

Paramètres
null$basenameThe basename of the file to create
Renvoie
boolean
Depuis
2.5.1
Obsolète:
5.0

◆ createUpdateFile()

createUpdateFile (   $basename = null)

Create the update.php file and trigger onJoomlaBeforeUpdate event.

The onJoomlaBeforeUpdate event stores the core files for which overrides have been defined. This will be compared in the onJoomlaAfterUpdate event with the current filesystem state, thereby determining how many and which overrides need to be checked and possibly updated after Joomla installed an update.

Paramètres
string$basenameOptional base path to the file.
Renvoie
boolean True if successful; false otherwise.
Depuis
2.5.4

Références $app, $config, $data, $filesize, $password, $result, File\delete(), File\exists(), UserHelper\genRandomPassword(), Factory\getApplication(), PluginHelper\importPlugin(), File\invalidateFileCache(), JPATH_SITE, et File\write().

◆ download()

download ( )

Downloads the update package to the site.

Renvoie
array
Depuis
2.5.4

Références HttpFactory\getHttp().

◆ downloadPackage()

downloadPackage (   $url,
  $target 
)
protected

Downloads a package file to a specific directory

Paramètres
string$urlThe URL to download from
string$targetThe directory to store the file
Renvoie
boolean True on success
Depuis
2.5.4

Références $result, $target, $url, Log\add(), File\delete(), HttpFactory\getHttp(), Log\INFO, Text\sprintf(), et File\write().

◆ fetchCompatibility()

fetchCompatibility (   $extensionID,
  $joomlaTargetVersion 
)

Called by controller's fetchExtensionCompatibility, which is called via AJAX.

Paramètres
string$extensionIDThe ID of the checked extension
string$joomlaTargetVersionTarget version of Joomla
Renvoie
object
Depuis
3.10.0

◆ finaliseUpgrade()

finaliseUpgrade ( )

Finalise the upgrade.

This method will do the following:

  • Run the schema update SQL files.
  • Run the Joomla post-update script.
  • Update the manifest cache and #__extensions entry for Joomla itself.

It performs essentially the same function as InstallerFile::install() without the file copy.

Renvoie
boolean True on success.
Depuis
2.5.4

Références $db, $id, $manifest, $query, $result, Text\_(), Factory\getApplication(), Joomla\Database\getDatabase(), Joomla\CMS\MVC\Model\getDbo(), ExtensionHelper\getExtensionRecord(), Installer\getInstance(), JPATH_ADMINISTRATOR, JPATH_MANIFESTS, JPATH_ROOT, JLoader\register(), et Text\sprintf().

◆ getCheckForSelfUpdate()

getCheckForSelfUpdate ( )

Makes sure that the Joomla! Update Component Update is in the database and check if there is a new version.

Renvoie
boolean True if there is an update else false
Depuis
4.0.0

Références $db, $query, Factory\getApplication(), Joomla\Database\getDatabase(), Joomla\CMS\MVC\Model\getDbo(), Updater\getInstance(), ParameterType\INTEGER, null, et Updater\STABILITY_STABLE.

◆ getCollectionDetailsUrls()

getCollectionDetailsUrls (   $updateSiteInfo,
  $joomlaTargetVersion 
)
private

Method to get details URLs from a collection update site for given extension and Joomla target version.

Paramètres
array$updateSiteInfoThe update site and extension information record to process
string$joomlaTargetVersionThe Joomla! version to test against,
Renvoie
array An array of URLs.
Depuis
3.10.0

Références $attribs, $extension, $key, $return, $value, et null.

◆ getConfiguredDatabaseType()

getConfiguredDatabaseType ( )
private

Returns the configured database type id (mysqli or sqlsrv or ...)

Renvoie
string
Depuis
3.10.0

Références Factory\getApplication().

◆ getIniParserAvailability()

getIniParserAvailability ( )

Checks the availability of the parse_ini_file and parse_ini_string functions.

Renvoie
boolean True if the method exists.
Depuis
3.10.0

Références $i, et $result.

◆ getNonCoreExtensions()

getNonCoreExtensions ( )

Gets an array containing all installed extensions, that are not core extensions.

Renvoie
array name,version,updateserver
Depuis
3.10.0

Références $db, $extension, $query, $rows, Text\_(), ExtensionHelper\getCoreExtensionIds(), Joomla\Database\getDatabase(), et Joomla\CMS\MVC\Model\getDbo().

◆ getNonCorePlugins()

getNonCorePlugins (   $folderFilter = ['system','user','authentication','actionlog','multifactorauth'])

Gets an array containing all installed and enabled plugins, that are not core plugins.

Paramètres
array$folderFilterLimit the list of plugins to a specific set of folder values
Renvoie
array name,version,updateserver
Depuis
3.10.0

Références $db, $query, $rows, Text\_(), ExtensionHelper\getCoreExtensionIds(), Joomla\Database\getDatabase(), et Joomla\CMS\MVC\Model\getDbo().

◆ getPhpOptions()

getPhpOptions ( )

Gets PHP options.

Renvoie
array Array of PHP config options
Depuis
3.10.0

Références $option, $options, Text\_(), Version\MAJOR_VERSION, null, et Text\sprintf().

◆ getPhpSettings()

getPhpSettings ( )

Gets PHP Settings.

Renvoie
array
Depuis
3.10.0

Références $settings, Text\_(), et Text\sprintf().

◆ getTargetMinimumPHPVersion()

getTargetMinimumPHPVersion ( )
private

Returns the PHP minimum version for the update. Returns JOOMLA_MINIMUM_PHP, if there is no information given.

Renvoie
string
Depuis
3.10.0

Références JOOMLA_MINIMUM_PHP.

◆ getUpdateInformation()

getUpdateInformation ( )

◆ getUpdateSitesInfo()

getUpdateSitesInfo (   $extensionID)
private

Returns records with update sites and extension information for a given extension ID.

Paramètres
int$extensionIDThe extension ID
Renvoie
array
Depuis
3.10.0

Références $db, $id, $query, $result, Joomla\Database\getDatabase(), Joomla\CMS\MVC\Model\getDbo(), et ParameterType\INTEGER.

◆ isChecksumValid()

isChecksumValid (   $packagefile,
  $updateObject 
)
private

Return the result of the checksum of a package with the SHA256/SHA384/SHA512 tags in the update server manifest

Paramètres
string$packagefileLocation of the package to be installed
Update$updateObjectThe Update Object
Renvoie
boolean False in case the validation did not work; true in any other case.
Note
This method has been forked from (JInstallerHelper::isChecksumValid) so it does not depend on an up-to-date InstallerHelper at the update time
Depuis
3.9.0

Références $hash.

◆ isDatabaseTypeSupported()

isDatabaseTypeSupported ( )

Returns true, if J! version is < 4 or current configured database type is compatible with the update.

Renvoie
boolean
Depuis
3.10.0

Références Version\MAJOR_VERSION.

◆ isPhpVersionSupported()

isPhpVersionSupported ( )

Returns true, if current installed php version is compatible with the update.

Renvoie
boolean
Depuis
3.10.0

◆ isTemplateActive()

isTemplateActive (   $template)

Checks whether a given template is active

Paramètres
string$templateThe template name to be checked
Renvoie
boolean
Depuis
3.10.4

Références $db, $menu, $query, $template, $value, ArrayHelper\getColumn(), Joomla\Database\getDatabase(), Joomla\CMS\MVC\Model\getDbo(), et ParameterType\STRING.

◆ purge()

purge ( )

Removes all of the updates from the table and enable all update streams.

Renvoie
boolean Result of operation.
Depuis
3.0

Références $db, $query, Text\_(), Joomla\Database\getDatabase(), et Joomla\CMS\MVC\Model\getDbo().

◆ refreshUpdates()

refreshUpdates (   $force = false)

Makes sure that the Joomla! update cache is up-to-date.

Paramètres
boolean$forceForce reload, ignoring the cache timeout.
Renvoie
void
Depuis
2.5.4

Références ExtensionHelper\getExtensionRecord(), Updater\getInstance(), ComponentHelper\getParams(), et Updater\STABILITY_STABLE.

◆ removePackageFiles()

removePackageFiles ( )

Remove the captive (temporary) file we uploaded before and the .

Renvoie
void
Depuis
3.6.0

Références File\delete(), File\exists(), Factory\getApplication(), et null.

◆ translateExtensionName()

translateExtensionName ( $item)
protected

Translates an extension name

Paramètres
object&$itemThe extension of which the name needs to be translated
Renvoie
void
Depuis
3.10.0

Références $extension, $item, $lang, $path, Text\_(), Factory\getLanguage(), JPATH_ADMINISTRATOR, JPATH_PLUGINS, et JPATH_SITE.

◆ upload()

upload ( )

Uploads what is presumably an update ZIP file under a mangled name in the temporary directory.

Renvoie
void
Depuis
3.6.0

Références $input, $result, Text\_(), Factory\getApplication(), null, et File\upload().

Documentation des champs

◆ $updateInformation

$updateInformation = null
private

La documentation de cette classe a été générée à partir du fichier suivant :