|
| __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, $cid=0) |
|
| 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) |
|
| getAdapter ($name, $options=array()) |
|
| getAdapters ($options=array(), array $custom=array()) |
|
| loadAdapter ($adapter, $options=array()) |
|
| loadAllAdapters ($options=array()) |
|
Joomla base installer class
- Depuis
- 3.1
◆ __construct()
__construct |
( |
|
$basepath = __DIR__ , |
|
|
|
$classprefix = '\\Joomla\\CMS\\Installer\\Adapter' , |
|
|
|
$adapterfolder = 'Adapter' |
|
) |
| |
Constructor
- Paramètres
-
string | $basepath | Base Path of the adapters |
string | $classprefix | Class prefix of adapters |
string | $adapterfolder | Name of folder to append to base path |
- Depuis
- 3.1
Références extension, et Table\getInstance().
◆ abort()
Installation abort method
- Paramètres
-
string | $msg | Abort message from the installer |
string | $type | Package type if defined |
- Renvoie
- boolean True if successful
- Depuis
- 3.1
Références $db, $query, $step, $type, et null.
◆ cleanDiscoveredExtension()
cleanDiscoveredExtension |
( |
|
$type, |
|
|
|
$element, |
|
|
|
$folder = '' , |
|
|
|
$client = 0 |
|
) |
| |
Cleans up discovered extensions if they're being installed some other way
- Paramètres
-
string | $type | The type of extension (component, etc) |
string | $element | Unique element identifier (e.g. com_content) |
string | $folder | The folder of the extension (plugins; e.g. system) |
integer | $client | The client application (administrator or site) |
- Renvoie
- object Result of query
- Depuis
- 3.1
Références $client, $db, $folder, $query, et $type.
◆ copyFiles()
copyFiles |
( |
|
$files, |
|
|
|
$overwrite = null |
|
) |
| |
Copyfiles
Copy files from source directory to the target directory
- Paramètres
-
array | $files | Array with filenames |
boolean | $overwrite | True if existing files can be replaced |
- Renvoie
- boolean True on success
- Depuis
- 3.1
Références $file, $files, $step, elseif, et null.
◆ copyManifest()
Copies the installation manifest file to the extension folder in the given client
- Paramètres
-
integer | $cid | Where 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_install()
discover_install |
( |
|
$eid = null | ) |
|
◆ findDeletedFiles()
findDeletedFiles |
( |
|
$oldFiles, |
|
|
|
$newFiles |
|
) |
| |
Compares two "files" entries to find deleted files/folders
- Paramètres
-
array | $oldFiles | An array of objects that are the old files |
array | $newFiles | An 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 $file, et $files.
◆ findManifest()
Tries to find the package manifest file
- Renvoie
- boolean True on success, False on error
- Depuis
- 3.1
Références $file, $manifest, et null.
◆ generateManifestCache()
generateManifestCache |
( |
| ) |
|
Generates a manifest cache
- Renvoie
- string serialised manifest data
- Depuis
- 3.1
Références json_encode.
◆ getAdapter()
getAdapter |
( |
|
$name, |
|
|
|
$options = array() |
|
) |
| |
Fetches an adapter and adds it to the internal storage if an instance is not set while also ensuring its a valid adapter name
- Paramètres
-
string | $name | Name of adapter to return |
array | $options | Adapter options |
- Renvoie
- InstallerAdapter
- Depuis
- 3.4
- Obsolète:
- 4.0 The internal adapter cache will no longer be supported, use loadAdapter() to fetch an adapter instance
Références $name, et $options.
◆ getAdapters()
getAdapters |
( |
|
$options = array() , |
|
|
array |
$custom = array() |
|
) |
| |
Gets a list of available install adapters.
- Paramètres
-
array | $options | An array of options to inject into the adapter |
array | $custom | Array of custom install adapters |
- Renvoie
- array An array of available install adapters.
- Depuis
- 3.4
- Note
- As of 4.0, this method will only return the names of available adapters and will not instantiate them and store to the $_adapters class var.
Références $class, $file, $files, $name, $options, 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 | $basepath | Base Path of the adapters |
string | $classprefix | Class prefix of adapters |
string | $adapterfolder | Name of folder to append to base path |
- Renvoie
- Installer An installer object
- Depuis
- 3.1
◆ getManifest()
Get the installation manifest object
- Renvoie
- Manifest object
- Depuis
- 3.1
Références $manifest.
◆ 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, json_encode, et null.
◆ getPath()
getPath |
( |
|
$name, |
|
|
|
$default = null |
|
) |
| |
Get an installer path by name
- Paramètres
-
string | $name | Path name |
string | $default | Default value |
- Renvoie
- string Path
- Depuis
- 3.1
Références $default, et $name.
◆ getRedirectUrl()
Get the redirect location
- Renvoie
- string Redirect location (or null)
- Depuis
- 3.1
◆ install()
◆ isManifest()
Is the XML file a valid Joomla installation manifest file.
- Paramètres
-
string | $file | An xmlfile path to check |
- Renvoie
- |null A , or null if the file failed to parse
- Depuis
- 3.1
Références $file.
◆ isOverwrite()
Get the allow overwrite switch
- Renvoie
- boolean Allow overwrite switch
- Depuis
- 3.1
◆ isPackageUninstall()
Get whether this installer is uninstalling extensions which are part of a package
- Renvoie
- boolean
- Depuis
- 3.7.0
◆ isUpgrade()
Get the upgrade switch
- Renvoie
- boolean
- Depuis
- 3.1
◆ loadAdapter()
loadAdapter |
( |
|
$adapter, |
|
|
|
$options = array() |
|
) |
| |
◆ loadAllAdapters()
loadAllAdapters |
( |
|
$options = array() | ) |
|
Loads all adapters.
- Paramètres
-
- Renvoie
- void
- Depuis
- 3.4
- Obsolète:
- 4.0 Individual adapters should be instantiated as needed
- Note
- This method is serving as a proxy of the legacy API into the preferred API
Références $options.
◆ loadMD5Sum()
Loads an MD5SUMS file into an associative array
- Paramètres
-
string | $filename | Filename to load |
- Renvoie
- array Associative array with filenames as the index and the MD5 as the value
- Depuis
- 3.1
Références $data, $results, et $row.
◆ 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 | $element | The XML node to process |
integer | $cid | Application ID of application to install to |
array | $oldFiles | List of old files (SimpleXMLElement's) |
array | $oldMD5 | List of old MD5 sums (indexed by filename with value as MD5) |
- Renvoie
- boolean True on success
- Depuis
- 3.1
Références $client, $file, $folder, $path, et ApplicationHelper\getClientInfo().
◆ parseLanguages()
parseLanguages |
( |
\SimpleXMLElement |
$element, |
|
|
|
$cid = 0 |
|
) |
| |
◆ parseMedia()
parseMedia |
( |
\SimpleXMLElement |
$element, |
|
|
|
$cid = 0 |
|
) |
| |
Method to parse through a media element of the installation manifest and take appropriate action.
- Paramètres
-
\SimpleXMLElement | $element | The XML node to process |
integer | $cid | Application ID of application to install to |
- Renvoie
- boolean True on success
- Depuis
- 3.1
Références $file, $folder, $path, JPATH_ROOT, et null.
◆ 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 | $element | The XML node to process |
- Renvoie
- mixed Number of queries processed or False on error
- Depuis
- 3.1
Références $db, et $query.
◆ parseSchemaUpdates()
parseSchemaUpdates |
( |
\SimpleXMLElement |
$schema, |
|
|
|
$eid |
|
) |
| |
◆ parseSQLFiles()
parseSQLFiles |
( |
|
$element | ) |
|
Method to extract the name of a discreet installation sql file from the installation manifest file.
- Paramètres
-
object | $element | The XML node to process |
- Renvoie
- mixed Number of queries processed or False on error
- Depuis
- 3.1
Références $buffer, $db, $file, $query, elseif, et JDatabaseDriver\splitSql().
◆ parseXMLInstallFile()
static parseXMLInstallFile |
( |
|
$path | ) |
|
|
static |
Parse a XML install manifest file.
XML Root tag should be 'install' except for languages which use meta file.
- Paramètres
-
string | $path | Full path to XML file. |
- Renvoie
- array XML metadata.
- Depuis
- 3.0.0
Références $data, $name, et $path.
Référencé par ModuleAdapter\discover(), LibraryAdapter\discover(), TemplateAdapter\discover(), PluginAdapter\discover(), LanguageAdapter\discover(), ComponentAdapter\discover(), LanguageAdapter\discover_install(), LibraryAdapter\refreshManifestCache(), ModuleAdapter\refreshManifestCache(), TemplateAdapter\refreshManifestCache(), FileAdapter\refreshManifestCache(), PluginAdapter\refreshManifestCache(), PackageAdapter\refreshManifestCache(), LanguageAdapter\refreshManifestCache(), ComponentAdapter\refreshManifestCache(), LibraryAdapter\storeExtension(), TemplateAdapter\storeExtension(), et PluginAdapter\storeExtension().
◆ pushStep()
Pushes a step onto the installer stack for rolling back steps
- Paramètres
-
- Renvoie
- void
- Depuis
- 3.1
Références $step.
◆ refreshManifestCache()
refreshManifestCache |
( |
|
$eid | ) |
|
Refreshes the manifest cache stored in #__extensions
- Paramètres
-
- Renvoie
- boolean
- Depuis
- 3.1
Références extension.
◆ removeFiles()
removeFiles |
( |
|
$element, |
|
|
|
$cid = 0 |
|
) |
| |
◆ setOverwrite()
setOverwrite |
( |
|
$state = false | ) |
|
Set the allow overwrite switch
- Paramètres
-
boolean | $state | Overwrite 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 | ) |
|
◆ setPath()
setPath |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
◆ setRedirectUrl()
setRedirectUrl |
( |
|
$newurl | ) |
|
Set the redirect location
- Paramètres
-
string | $newurl | New 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
-
- Renvoie
- void
- Depuis
- 3.1
Références $db, $files, $query, et elseif.
◆ setUpgrade()
setUpgrade |
( |
|
$state = false | ) |
|
Set the upgrade switch
- Paramètres
-
boolean | $state | Upgrade switch state |
- Renvoie
- boolean True if upgrade, false otherwise
- Depuis
- 3.1
Références $state, et $tmp.
◆ setupInstall()
Prepare for installation: this method sets the installation directory, finds and checks the installation file and verifies the installation type.
- Paramètres
-
string | $route | The install route being followed |
boolean | $returnAdapter | Flag 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.
◆ uninstall()
uninstall |
( |
|
$type, |
|
|
|
$identifier, |
|
|
|
$cid = 0 |
|
) |
| |
◆ update()
◆ $extension
◆ $extension_message
$extension_message = null |
|
protected |
◆ $extraQuery
◆ $instance
◆ $instances
◆ $manifest
◆ $manifestClass
◆ $message
◆ $overwrite
◆ $packageUninstall
$packageUninstall = false |
|
protected |
◆ $paths
◆ $redirect_url
◆ $stepStack
◆ $upgrade
La documentation de cette classe a été générée à partir du fichier suivant :