Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
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 |
Joomla base installer class
__construct | ( | $basepath = __DIR__ , |
|
$classprefix = '\\Joomla\\CMS\\Installer\\Adapter' , |
|||
$adapterfolder = 'Adapter' |
|||
) |
Constructor
string | $basepath | Base Path of the adapters |
string | $classprefix | Class prefix of adapters |
string | $adapterfolder | Name of folder to append to base path |
Références Symfony\Contracts\Service\__construct(), extension, et Table\getInstance().
Installation abort method
string | $msg | Abort message from the installer |
string | $type | Package type if defined |
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 | ( | $type, | |
$element, | |||
$folder = '' , |
|||
$client = 0 |
|||
) |
Cleans up discovered extensions if they're being installed some other way
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) |
Références $client, $db, $folder, $query, $type, Joomla\Database\getDatabase(), et ParameterType\INTEGER.
copyFiles | ( | $files, | |
$overwrite = null |
|||
) |
Copyfiles
Copy files from source directory to the target directory
array | $files | Array with filenames |
boolean | $overwrite | True if existing files can be replaced |
Références $step, Text\_(), Log\add(), Path\clean(), Folder\copy(), File\copy(), elseif, null, Text\sprintf(), et Log\WARNING.
copyManifest | ( | $cid = 1 | ) |
Copies the installation manifest file to the extension folder in the given client
integer | $cid | Where to copy the installfile [optional: defaults to 1 (admin)] |
Références $client, $path, et ApplicationHelper\getClientInfo().
discover | ( | ) |
Extension discover method
Asks each adapter to find extensions
discover_install | ( | $eid = null | ) |
Discovered package installation method
integer | $eid | Extension ID |
Références $params, $result, $this, $type, Text\_(), extension, Factory\getApplication(), PluginHelper\importPlugin(), null, et Text\sprintf().
findDeletedFiles | ( | $oldFiles, | |
$newFiles | |||
) |
Compares two "files" entries to find deleted files/folders
array | $oldFiles | An array of objects that are the old files |
array | $newFiles | An array of objects that are the new files |
Références $container.
findManifest | ( | ) |
Tries to find the package manifest file
Références $manifest, Text\_(), Log\add(), Folder\exists(), Folder\files(), null, et Log\WARNING.
generateManifestCache | ( | ) |
Generates a manifest cache
getAdapters | ( | $options = array() , |
|
array | $custom = array() |
||
) |
Gets a list of available install adapters.
array | $options | An array of options to inject into the adapter |
array | $custom | Array of custom install adapters |
Références $class, $name, et JLoader\register().
|
static |
Returns the global Installer object, only creating it if it doesn't already exist.
string | $basepath | Base Path of the adapters |
string | $classprefix | Class prefix of adapters |
string | $adapterfolder | Name of folder to append to base path |
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 | ( | ) |
getParams | ( | ) |
Method to parse the parameters of an extension, build the JSON string for its default parameters, and return the JSON string.
Références $field, $fieldsets, $name, $value, et null.
getPath | ( | $name, | |
$default = null |
|||
) |
getRedirectUrl | ( | ) |
install | ( | $path = null | ) |
Package installation method
string | $path | Path to package source folder |
Références $manifest, $path, $result, $this, Text\_(), Folder\exists(), Factory\getApplication(), et PluginHelper\importPlugin().
isManifest | ( | $file | ) |
isOverwrite | ( | ) |
Get the allow overwrite switch
isPackageUninstall | ( | ) |
Get whether this installer is uninstalling extensions which are part of a package
isUpgrade | ( | ) |
Get the upgrade switch
loadAdapter | ( | $adapter, | |
$options = array() |
|||
) |
Method to load an adapter instance
Références $class, $options, $this, Joomla\DI\getContainer(), Joomla\Database\getDatabase(), et Symfony\Contracts\Service\has().
loadMD5Sum | ( | $filename | ) |
Method to parse through a files element of the installation manifest and take appropriate action.
\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) |
Références $client, $folder, $path, Text\_(), Log\add(), Folder\create(), File\delete(), Folder\delete(), ApplicationHelper\getClientInfo(), Text\sprintf(), et Log\WARNING.
parseLanguages | ( | \SimpleXMLElement | $element, |
$cid = 0 |
|||
) |
Method to parse through a languages element of the installation manifest and take appropriate action.
\SimpleXMLElement | $element | The XML node to process |
integer | $cid | Application ID of application to install to |
Références $client, $folder, $path, Text\_(), Log\add(), Folder\create(), Folder\exists(), ApplicationHelper\getClientInfo(), Text\sprintf(), et Log\WARNING.
parseMedia | ( | \SimpleXMLElement | $element, |
$cid = 0 |
|||
) |
Method to parse through a media element of the installation manifest and take appropriate action.
\SimpleXMLElement | $element | The XML node to process |
integer | $cid | Application ID of application to install to |
Références $folder, $path, Text\_(), Log\add(), Path\clean(), Folder\create(), JPATH_ROOT, null, Text\sprintf(), et Log\WARNING.
parseQueries | ( | \SimpleXMLElement | $element | ) |
Backward compatible method to parse through a queries element of the installation manifest file and take appropriate action.
\SimpleXMLElement | $element | The XML node to process |
Références $db, $query, Log\add(), Text\sprintf(), et Log\WARNING.
parseSchemaUpdates | ( | \SimpleXMLElement | $schema, |
$eid | |||
) |
Method to process the updates for an item
\SimpleXMLElement | $schema | The XML node to process |
integer | $eid | Extension Identifier |
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 | ( | $element | ) |
Method to extract the name of a discreet installation sql file from the installation manifest file.
object | $element | The XML node to process |
Références $buffer, $db, $query, Text\_(), Log\add(), elseif, Text\sprintf(), et Log\WARNING.
|
static |
Parse a XML install manifest file.
XML Root tag should be 'install' except for languages which use meta file.
string | $path | Full path to XML file. |
Références $data, $name, $path, $xml, Text\_(), et File\stripExt().
Référencé par ModuleAdapter\discover(), LibraryAdapter\discover(), PluginAdapter\discover(), TemplateAdapter\discover(), LanguageAdapter\discover(), ComponentAdapter\discover(), LanguageAdapter\discover_install(), LanguagesModel\getInstalledlangs(), PlgSampledataMultilang\getInstalledlangs(), TemplatesHelper\parseXMLTemplateFile(), PluginsHelper\parseXMLTemplateFile(), ModuleAdapter\refreshManifestCache(), LibraryAdapter\refreshManifestCache(), FileAdapter\refreshManifestCache(), PluginAdapter\refreshManifestCache(), TemplateAdapter\refreshManifestCache(), PackageAdapter\refreshManifestCache(), LanguageAdapter\refreshManifestCache(), ComponentAdapter\refreshManifestCache(), LibraryAdapter\storeExtension(), PluginAdapter\storeExtension(), et TemplateAdapter\storeExtension().
pushStep | ( | $step | ) |
refreshManifestCache | ( | $eid | ) |
Refreshes the manifest cache stored in #__extensions
integer | $eid | Extension ID |
Références $result, Text\_(), extension, et Text\sprintf().
removeFiles | ( | $element, | |
$cid = 0 |
|||
) |
Method to parse through a files element of the installation manifest and remove the files that were installed
object | $element | The XML node to process |
integer | $cid | Application ID of application to remove from |
Références $client, $folder, $path, $val, Log\add(), File\delete(), Folder\delete(), Folder\exists(), ApplicationHelper\getClientInfo(), null, et Log\WARNING.
setOverwrite | ( | $state = false | ) |
setPackageUninstall | ( | $uninstall | ) |
Set whether this installer is uninstalling extensions which are part of a package
boolean | $uninstall | True if a package triggered the uninstall, false otherwise |
setPath | ( | $name, | |
$value | |||
) |
setRedirectUrl | ( | $newurl | ) |
Set the redirect location
string | $newurl | New redirect location |
setSchemaVersion | ( | \SimpleXMLElement | $schema, |
$eid | |||
) |
Set the schema version for an extension by looking at its latest update
Références $db, $query, Folder\files(), Joomla\Database\getDatabase(), et ParameterType\INTEGER.
setUpgrade | ( | $state = false | ) |
Prepare for installation: this method sets the installation directory, finds and checks the installation file and verifies the installation type.
string | $route | The install route being followed |
boolean | $returnAdapter | Flag to return the instantiated adapter |
|
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.
string | null | $sql | Input SQL string with which to split into individual queries. |
uninstall | ( | $type, | |
$identifier | |||
) |
Package uninstallation method
string | $type | Package type |
mixed | $identifier | Package identifier for adapter |
Références $params, $result, $this, $type, extension, Factory\getApplication(), et PluginHelper\importPlugin().
update | ( | $path = null | ) |
Package update method
string | $path | Path to package source folder |
Références $manifest, $path, $result, $this, Text\_(), Folder\exists(), Factory\getApplication(), et PluginHelper\importPlugin().
|
protected |
$extraQuery = '' |
|
staticprotected |
$manifest = null |
$manifestClass = null |
$message = null |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
A comment marker to indicate that an update SQL query may fail without triggering an update error.
|
protected |
The length of the CAN_FAIL_MARKER string