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

Fonctions membres publiques

 __construct ($basepath=__DIR__, $classprefix='\\Joomla\\CMS\\Installer\\Adapter', $adapterfolder='Adapter')
 
 isOverwrite ()
 
 setOverwrite ($state=false)
 
 getRedirectUrl ()
 
 setRedirectUrl ($newurl)
 
 isPackageUninstall ()
 
 setPackageUninstall ($uninstall)
 
 isUpgrade ()
 
 setUpgrade ($state=false)
 
 getManifest ()
 
 getPath ($name, $default=null)
 
 setPath ($name, $value)
 
 pushStep ($step)
 
 abort ($msg=null, $type=null)
 
 install ($path=null)
 
 discover_install ($eid=null)
 
 discover ()
 
 update ($path=null)
 
 uninstall ($type, $identifier)
 
 refreshManifestCache ($eid)
 
 setupInstall ($route='install', $returnAdapter=false)
 
 parseQueries (\SimpleXMLElement $element)
 
 parseSQLFiles ($element)
 
 setSchemaVersion (\SimpleXMLElement $schema, $eid)
 
 parseSchemaUpdates (\SimpleXMLElement $schema, $eid)
 
 parseFiles (\SimpleXMLElement $element, $cid=0, $oldFiles=null, $oldMD5=null)
 
 parseLanguages (\SimpleXMLElement $element, $cid=0)
 
 parseMedia (\SimpleXMLElement $element, $cid=0)
 
 getParams ()
 
 copyFiles ($files, $overwrite=null)
 
 removeFiles ($element, $cid=0)
 
 copyManifest ($cid=1)
 
 findManifest ()
 
 isManifest ($file)
 
 generateManifestCache ()
 
 cleanDiscoveredExtension ($type, $element, $folder='', $client=0)
 
 findDeletedFiles ($oldFiles, $newFiles)
 
 loadMD5Sum ($filename)
 
 getAdapters ($options=array(), array $custom=array())
 
 loadAdapter ($adapter, $options=array())
 
- Fonctions membres publiques hérités de Adapter
 __construct ($basepath, $classprefix=null, $adapterfolder=null)
 
 getDbo ()
 
 getAdapter ($name, $options=array())
 
 setAdapter ($name, &$adapter=null, $options=array())
 
 loadAllAdapters ($options=array())
 
- 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 DatabaseAwareInterface
 setDatabase (DatabaseInterface $db)
 

Fonctions membres publiques statiques

static getInstance ($basepath=__DIR__, $classprefix='\\Joomla\\CMS\\Installer\\Adapter', $adapterfolder='Adapter')
 
static splitSql (?string $sql)
 
static parseXMLInstallFile ($path)
 

Champs de données

 $manifestClass = null
 
 $extension = null
 
 $message = null
 
 $manifest = null
 
 $extraQuery = ''
 

Attributs protégés

 $paths = array()
 
 $upgrade = null
 
 $overwrite = false
 
 $stepStack = array()
 
 $extension_message = null
 
 $redirect_url = null
 
 $packageUninstall = false
 
const CAN_FAIL_MARKER = '/** CAN FAIL **/'
 
const CAN_FAIL_MARKER_LENGTH = 16
 
- Attributs protégés hérités de Adapter
 $_adapters = array()
 
 $_adapterfolder = 'adapters'
 
 $_classprefix = 'J'
 
 $_basepath = null
 
 $_db
 
- Attributs protégés hérités de CMSObject
 $_errors = array()
 

Attributs protégés statiques

static $instances
 

Description détaillée

Joomla base installer class

Depuis
3.1

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $basepath = __DIR__,
  $classprefix = '\\Joomla\\CMS\\Installer\\Adapter',
  $adapterfolder = 'Adapter' 
)

Constructor

Paramètres
string$basepathBase Path of the adapters
string$classprefixClass prefix of adapters
string$adapterfolderName of folder to append to base path
Depuis
3.1

Références Symfony\Contracts\Service\__construct(), extension, et Table\getInstance().

Documentation des fonctions membres

◆ abort()

abort (   $msg = null,
  $type = null 
)

Installation abort method

Paramètres
string$msgAbort message from the installer
string$typePackage type if defined
Renvoie
boolean True if successful
Depuis
3.1

Références $db, $method, $query, $step, $type, Text\_(), Log\add(), File\delete(), Folder\delete(), Joomla\Database\getDatabase(), ParameterType\INTEGER, null, et Log\WARNING.

◆ cleanDiscoveredExtension()

cleanDiscoveredExtension (   $type,
  $element,
  $folder = '',
  $client = 0 
)

Cleans up discovered extensions if they're being installed some other way

Paramètres
string$typeThe type of extension (component, etc)
string$elementUnique element identifier (e.g. com_content)
string$folderThe folder of the extension (plugins; e.g. system)
integer$clientThe client application (administrator or site)
Renvoie
object Result of query
Depuis
3.1

Références $client, $db, $folder, $query, $type, Joomla\Database\getDatabase(), et ParameterType\INTEGER.

◆ copyFiles()

copyFiles (   $files,
  $overwrite = null 
)

Copyfiles

Copy files from source directory to the target directory

Paramètres
array$filesArray with filenames
boolean$overwriteTrue if existing files can be replaced
Renvoie
boolean True on success
Depuis
3.1

Références $step, Text\_(), Log\add(), Path\clean(), Folder\copy(), File\copy(), elseif, null, Text\sprintf(), et Log\WARNING.

◆ copyManifest()

copyManifest (   $cid = 1)

Copies the installation manifest file to the extension folder in the given client

Paramètres
integer$cidWhere to copy the installfile [optional: defaults to 1 (admin)]
Renvoie
boolean True on success, False on error
Depuis
3.1

Références $client, $path, et ApplicationHelper\getClientInfo().

◆ discover()

discover ( )

Extension discover method

Asks each adapter to find extensions

Renvoie
InstallerExtension[]
Depuis
3.1

Références $results, et $tmp.

◆ discover_install()

discover_install (   $eid = null)

Discovered package installation method

Paramètres
integer$eidExtension ID
Renvoie
boolean True if successful
Depuis
3.1

Références $params, $result, $this, $type, Text\_(), extension, Factory\getApplication(), PluginHelper\importPlugin(), null, et Text\sprintf().

◆ findDeletedFiles()

findDeletedFiles (   $oldFiles,
  $newFiles 
)

Compares two "files" entries to find deleted files/folders

Paramètres
array$oldFilesAn array of objects that are the old files
array$newFilesAn array of objects that are the new files
Renvoie
array An array with the delete files and folders in findDeletedFiles[files] and findDeletedFiles[folders] respectively
Depuis
3.1

Références $container.

◆ findManifest()

findManifest ( )

Tries to find the package manifest file

Renvoie
boolean True on success, False on error
Depuis
3.1

Références $manifest, Text\_(), Log\add(), Folder\exists(), Folder\files(), null, et Log\WARNING.

◆ generateManifestCache()

generateManifestCache ( )

Generates a manifest cache

Renvoie
string serialised manifest data
Depuis
3.1

◆ getAdapters()

getAdapters (   $options = array(),
array  $custom = array() 
)

Gets a list of available install adapters.

Paramètres
array$optionsAn array of options to inject into the adapter
array$customArray of custom install adapters
Renvoie
string[] An array of the class names of available install adapters.
Depuis
3.4

Références $class, $name, et JLoader\register().

◆ getInstance()

static getInstance (   $basepath = __DIR__,
  $classprefix = '\\Joomla\\CMS\\Installer\\Adapter',
  $adapterfolder = 'Adapter' 
)
static

Returns the global Installer object, only creating it if it doesn't already exist.

Paramètres
string$basepathBase Path of the adapters
string$classprefixClass prefix of adapters
string$adapterfolderName of folder to append to base path
Renvoie
Installer An installer object
Depuis
3.1

Références class, et Factory\getContainer().

Référencé par DiscoverModel\discover(), ExtensionRemoveCommand\doExecute(), UpdateModel\finaliseUpgrade(), InstallModel\install(), UpdateModel\install(), ExtensionInstallCommand\processPathInstallation(), ManageModel\refresh(), ManageModel\remove(), et ConfigurationModel\setup().

◆ getManifest()

getManifest ( )

Get the installation manifest object

Renvoie
Manifest object
Depuis
3.1

Références $manifest.

◆ getParams()

getParams ( )

Method to parse the parameters of an extension, build the JSON string for its default parameters, and return the JSON string.

Renvoie
string JSON string of parameter values
Depuis
3.1
Note
This method must always return a JSON compliant string

Références $field, $fieldsets, $name, $value, et null.

◆ getPath()

getPath (   $name,
  $default = null 
)

Get an installer path by name

Paramètres
string$namePath name
string$defaultDefault value
Renvoie
string Path
Depuis
3.1

Références $default, et $name.

◆ getRedirectUrl()

getRedirectUrl ( )

Get the redirect location

Renvoie
string Redirect location (or null)
Depuis
3.1

◆ install()

install (   $path = null)

Package installation method

Paramètres
string$pathPath to package source folder
Renvoie
boolean True if successful
Depuis
3.1

Références $manifest, $path, $result, $this, Text\_(), Folder\exists(), Factory\getApplication(), et PluginHelper\importPlugin().

◆ isManifest()

isManifest (   $file)

Is the XML file a valid Joomla installation manifest file.

Paramètres
string$fileAn xmlfile path to check
Renvoie
|null A , or null if the file failed to parse
Depuis
3.1

Références $xml.

◆ isOverwrite()

isOverwrite ( )

Get the allow overwrite switch

Renvoie
boolean Allow overwrite switch
Depuis
3.1

◆ isPackageUninstall()

isPackageUninstall ( )

Get whether this installer is uninstalling extensions which are part of a package

Renvoie
boolean
Depuis
3.7.0

◆ isUpgrade()

isUpgrade ( )

Get the upgrade switch

Renvoie
boolean
Depuis
3.1

◆ loadAdapter()

loadAdapter (   $adapter,
  $options = array() 
)

Method to load an adapter instance

Paramètres
string$adapterAdapter name
array$optionsAdapter options
Renvoie
InstallerAdapter
Depuis
3.4
Exceptions

Références $class, $options, $this, Joomla\DI\getContainer(), Joomla\Database\getDatabase(), et Symfony\Contracts\Service\has().

◆ loadMD5Sum()

loadMD5Sum (   $filename)

Loads an MD5SUMS file into an associative array

Paramètres
string$filenameFilename to load
Renvoie
array Associative array with filenames as the index and the MD5 as the value
Depuis
3.1

Références $data, et $results.

◆ parseFiles()

parseFiles ( \SimpleXMLElement  $element,
  $cid = 0,
  $oldFiles = null,
  $oldMD5 = null 
)

Method to parse through a files element of the installation manifest and take appropriate action.

Paramètres
\SimpleXMLElement$elementThe XML node to process
integer$cidApplication ID of application to install to
array$oldFilesList of old files (SimpleXMLElement's)
array$oldMD5List of old MD5 sums (indexed by filename with value as MD5)
Renvoie
boolean True on success
Depuis
3.1

Références $client, $folder, $path, Text\_(), Log\add(), Folder\create(), File\delete(), Folder\delete(), ApplicationHelper\getClientInfo(), Text\sprintf(), et Log\WARNING.

◆ parseLanguages()

parseLanguages ( \SimpleXMLElement  $element,
  $cid = 0 
)

Method to parse through a languages element of the installation manifest and take appropriate action.

Paramètres
\SimpleXMLElement$elementThe XML node to process
integer$cidApplication ID of application to install to
Renvoie
boolean True on success
Depuis
3.1

Références $client, $folder, $path, Text\_(), Log\add(), Folder\create(), Folder\exists(), ApplicationHelper\getClientInfo(), Text\sprintf(), et Log\WARNING.

◆ parseMedia()

parseMedia ( \SimpleXMLElement  $element,
  $cid = 0 
)

Method to parse through a media element of the installation manifest and take appropriate action.

Paramètres
\SimpleXMLElement$elementThe XML node to process
integer$cidApplication ID of application to install to
Renvoie
boolean True on success
Depuis
3.1

Références $folder, $path, Text\_(), Log\add(), Path\clean(), Folder\create(), JPATH_ROOT, null, Text\sprintf(), et Log\WARNING.

◆ parseQueries()

parseQueries ( \SimpleXMLElement  $element)

Backward compatible method to parse through a queries element of the installation manifest file and take appropriate action.

Paramètres
\SimpleXMLElement$elementThe XML node to process
Renvoie
mixed Number of queries processed or False on error
Depuis
3.1

Références $db, $query, Log\add(), Text\sprintf(), et Log\WARNING.

◆ parseSchemaUpdates()

parseSchemaUpdates ( \SimpleXMLElement  $schema,
  $eid 
)

Method to process the updates for an item

Paramètres
\SimpleXMLElement$schemaThe XML node to process
integer$eidExtension Identifier
Renvoie
boolean|int Number of SQL updates executed; false on failure.
Depuis
3.1

Références $buffer, $db, $query, $version, Text\_(), Log\add(), elseif, Folder\files(), Joomla\Database\getDatabase(), Log\INFO, ParameterType\INTEGER, Text\sprintf(), et Log\WARNING.

◆ parseSQLFiles()

parseSQLFiles (   $element)

Method to extract the name of a discreet installation sql file from the installation manifest file.

Paramètres
object$elementThe XML node to process
Renvoie
mixed Number of queries processed or False on error
Depuis
3.1

Références $buffer, $db, $query, Text\_(), Log\add(), elseif, Text\sprintf(), et Log\WARNING.

◆ parseXMLInstallFile()

◆ pushStep()

pushStep (   $step)

Pushes a step onto the installer stack for rolling back steps

Paramètres
array$stepInstaller step
Renvoie
void
Depuis
3.1

Références $step.

◆ refreshManifestCache()

refreshManifestCache (   $eid)

Refreshes the manifest cache stored in #__extensions

Paramètres
integer$eidExtension ID
Renvoie
boolean
Depuis
3.1

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

◆ removeFiles()

removeFiles (   $element,
  $cid = 0 
)

Method to parse through a files element of the installation manifest and remove the files that were installed

Paramètres
object$elementThe XML node to process
integer$cidApplication ID of application to remove from
Renvoie
boolean True on success
Depuis
3.1

Références $client, $folder, $path, $val, Log\add(), File\delete(), Folder\delete(), Folder\exists(), ApplicationHelper\getClientInfo(), null, et Log\WARNING.

◆ setOverwrite()

setOverwrite (   $state = false)

Set the allow overwrite switch

Paramètres
boolean$stateOverwrite switch state
Renvoie
boolean True it state is set, false if it is not
Depuis
3.1

Références $state, et $tmp.

◆ setPackageUninstall()

setPackageUninstall (   $uninstall)

Set whether this installer is uninstalling extensions which are part of a package

Paramètres
boolean$uninstallTrue if a package triggered the uninstall, false otherwise
Renvoie
void
Depuis
3.7.0

◆ setPath()

setPath (   $name,
  $value 
)

Sets an installer path by name

Paramètres
string$namePath name
string$valuePath
Renvoie
void
Depuis
3.1

Références $name, et $value.

◆ setRedirectUrl()

setRedirectUrl (   $newurl)

Set the redirect location

Paramètres
string$newurlNew redirect location
Renvoie
void
Depuis
3.1

◆ setSchemaVersion()

setSchemaVersion ( \SimpleXMLElement  $schema,
  $eid 
)

Set the schema version for an extension by looking at its latest update

Paramètres
\SimpleXMLElement$schemaSchema Tag
integer$eidExtension ID
Renvoie
void
Depuis
3.1

Références $db, $query, Folder\files(), Joomla\Database\getDatabase(), et ParameterType\INTEGER.

◆ setUpgrade()

setUpgrade (   $state = false)

Set the upgrade switch

Paramètres
boolean$stateUpgrade switch state
Renvoie
boolean True if upgrade, false otherwise
Depuis
3.1

Références $state, et $tmp.

◆ setupInstall()

setupInstall (   $route = 'install',
  $returnAdapter = false 
)

Prepare for installation: this method sets the installation directory, finds and checks the installation file and verifies the installation type.

Paramètres
string$routeThe install route being followed
boolean$returnAdapterFlag to return the instantiated adapter
Renvoie
boolean|InstallerAdapter InstallerAdapter object if explicitly requested otherwise boolean
Depuis
3.1

Références $params, $route, et $type.

◆ splitSql()

static splitSql ( ?string  $sql)
static

Splits a string of multiple queries into an array of individual queries.

This is different than DatabaseDriver::splitSql. It supports the special CAN FAIL comment marker which indicates that a SQL statement could fail without raising an error during the installation.

Paramètres
string | null$sqlInput SQL string with which to split into individual queries.
Renvoie
array
Depuis
4.2.0

Références $i, $query, $sql, $start, et elseif.

◆ uninstall()

uninstall (   $type,
  $identifier 
)

Package uninstallation method

Paramètres
string$typePackage type
mixed$identifierPackage identifier for adapter
Renvoie
boolean True if successful
Depuis
3.1

Références $params, $result, $this, $type, extension, Factory\getApplication(), et PluginHelper\importPlugin().

◆ update()

update (   $path = null)

Package update method

Paramètres
string$pathPath to package source folder
Renvoie
boolean True if successful
Depuis
3.1

Références $manifest, $path, $result, $this, Text\_(), Folder\exists(), Factory\getApplication(), et PluginHelper\importPlugin().

Documentation des champs

◆ $extension

◆ $extension_message

$extension_message = null
protected

◆ $extraQuery

$extraQuery = ''

◆ $instances

$instances
staticprotected

◆ $manifest

$manifest = null

◆ $manifestClass

$manifestClass = null

◆ $message

$message = null

◆ $overwrite

$overwrite = false
protected

◆ $packageUninstall

$packageUninstall = false
protected

◆ $paths

$paths = array()
protected

◆ $redirect_url

$redirect_url = null
protected

◆ $stepStack

$stepStack = array()
protected

◆ $upgrade

$upgrade = null
protected

◆ CAN_FAIL_MARKER

const CAN_FAIL_MARKER = '/** CAN FAIL **/'
protected

A comment marker to indicate that an update SQL query may fail without triggering an update error.

Depuis
4.2.0

◆ CAN_FAIL_MARKER_LENGTH

const CAN_FAIL_MARKER_LENGTH = 16
protected

The length of the CAN_FAIL_MARKER string

Depuis
4.2.0

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