public
|
#
__construct( string $basepath = __DIR__, string $classprefix = 'JInstallerAdapter', string $adapterfolder = 'adapter' )
Constructor
Parameters
- $basepath
string - $basepath Base Path of the adapters
- $classprefix
string - $classprefix Class prefix of adapters
- $adapterfolder
string - $adapterfolder Name of folder to append to base path
Since
3.1
Overrides
|
public static
JInstaller
|
#
getInstance( string $basepath = __DIR__, string $classprefix = 'JInstallerAdapter', string $adapterfolder = 'adapter' )
Returns the global Installer object, only creating it if it doesn't already
exist.
Returns the global Installer object, only creating it if it doesn't already
exist.
Parameters
- $basepath
string - $basepath Base Path of the adapters
- $classprefix
string - $classprefix Class prefix of adapters
- $adapterfolder
string - $adapterfolder Name of folder to append to base path
Returns
Since
3.1
|
public
boolean
|
#
isOverwrite( )
Get the allow overwrite switch
Get the allow overwrite switch
Returns
boolean - Allow overwrite switch
Since
3.1
|
public
boolean
|
#
setOverwrite( boolean $state = false )
Set the allow overwrite switch
Set the allow overwrite switch
Parameters
- $state
boolean - $state Overwrite switch state
Returns
boolean - True it state is set, false if it is not
Since
3.1
|
public
string
|
#
getRedirectUrl( )
Get the redirect location
Get the redirect location
Returns
string - Redirect location (or null)
Since
3.1
|
public
|
#
setRedirectUrl( string $newurl )
Set the redirect location
Set the redirect location
Parameters
- $newurl
string - $newurl New redirect location
Since
3.1
|
public
boolean
|
#
isPackageUninstall( )
Get whether this installer is uninstalling extensions which are part of a
package
Get whether this installer is uninstalling extensions which are part of a
package
Returns
boolean
Since
3.7.0
|
public
|
#
setPackageUninstall( boolean $uninstall )
Set whether this installer is uninstalling extensions which are part of a
package
Set whether this installer is uninstalling extensions which are part of a
package
Parameters
- $uninstall
boolean - $uninstall True if a package triggered the uninstall, false otherwise
Since
3.7.0
|
public
boolean
|
#
isUpgrade( )
Get the upgrade switch
Returns
boolean
Since
3.1
|
public
boolean
|
#
setUpgrade( boolean $state = false )
Set the upgrade switch
Parameters
- $state
boolean - $state Upgrade switch state
Returns
boolean - True if upgrade, false otherwise
Since
3.1
|
public
SimpleXMLElement
|
#
getManifest( )
Get the installation manifest object
Get the installation manifest object
Returns
Since
3.1
|
public
string
|
#
getPath( string $name, string $default = null )
Get an installer path by name
Get an installer path by name
Parameters
- $name
string - $name Path name
- $default
string - $default Default value
Returns
string - Path
Since
3.1
|
public
|
#
setPath( string $name, string $value )
Sets an installer path by name
Sets an installer path by name
Parameters
- $name
string - $name Path name
- $value
string - $value Path
Since
3.1
|
public
|
#
pushStep( array $step )
Pushes a step onto the installer stack for rolling back steps
Pushes a step onto the installer stack for rolling back steps
Parameters
- $step
array - $step Installer step
Since
3.1
|
public
boolean
|
#
abort( string $msg = null, string $type = null )
Installation abort method
Installation abort method
Parameters
- $msg
string - $msg Abort message from the installer
- $type
string - $type Package type if defined
Returns
boolean - True if successful
Since
3.1
|
public
boolean
|
#
install( string $path = null )
Package installation method
Package installation method
Parameters
- $path
string - $path Path to package source folder
Returns
boolean - True if successful
Since
3.1
|
public
boolean
|
#
discover_install( integer $eid = null )
Discovered package installation method
Discovered package installation method
Parameters
- $eid
integer - $eid Extension ID
Returns
boolean - True if successful
Since
3.1
|
public
JInstallerExtension[]
|
#
discover( )
Extension discover method
Extension discover method
Asks each adapter to find extensions
Returns
Since
3.1
|
public
boolean
|
#
update( string $path = null )
Package update method
Parameters
- $path
string - $path Path to package source folder
Returns
boolean - True if successful
Since
3.1
|
public
boolean
|
#
uninstall( string $type, mixed $identifier, integer $cid = 0 )
Package uninstallation method
Package uninstallation method
Parameters
- $type
string - $type Package type
- $identifier
mixed - $identifier Package identifier for adapter
- $cid
integer - $cid Application ID; deprecated in 1.6
Returns
boolean - True if successful
Since
3.1
|
public
boolean
|
#
refreshManifestCache( integer $eid )
Refreshes the manifest cache stored in #__extensions
Refreshes the manifest cache stored in #__extensions
Parameters
- $eid
integer - $eid Extension ID
Returns
boolean
Since
3.1
|
public
boolean|JInstallerAdapter
|
#
setupInstall( string $route = 'install', boolean $returnAdapter = false )
Prepare for installation: this method sets the installation directory, finds
and checks the installation file and verifies the installation type.
Prepare for installation: this method sets the installation directory, finds
and checks the installation file and verifies the installation type.
Parameters
- $route
string - $route The install route being followed
- $returnAdapter
boolean - $returnAdapter Flag to return the instantiated adapter
Returns
boolean|JInstallerAdapter - JInstallerAdapter object if explicitly requested otherwise boolean
Since
3.1
|
public
mixed
|
#
parseQueries( SimpleXMLElement $element )
Backward compatible method to parse through a queries element of the
installation manifest file and take appropriate action.
Backward compatible method to parse through a queries element of the
installation manifest file and take appropriate action.
Parameters
Returns
mixed - Number of queries processed or False on error
Since
3.1
|
public
mixed
|
#
parseSQLFiles( object $element )
Method to extract the name of a discreet installation sql file from the
installation manifest file.
Method to extract the name of a discreet installation sql file from the
installation manifest file.
Parameters
- $element
object - $element The XML node to process
Returns
mixed - Number of queries processed or False on error
Since
3.1
|
public
|
#
setSchemaVersion( SimpleXMLElement $schema, integer $eid )
Set the schema version for an extension by looking at its latest update
Set the schema version for an extension by looking at its latest update
Parameters
Since
3.1
|
public
boolean
|
#
parseSchemaUpdates( SimpleXMLElement $schema, integer $eid )
Method to process the updates for an item
Method to process the updates for an item
Parameters
- $schema
SimpleXMLElement - $schema The XML node to process
- $eid
integer - $eid Extension Identifier
Returns
boolean - Result of the operations
Since
3.1
|
public
boolean
|
#
parseFiles( SimpleXMLElement $element, integer $cid = 0, array $oldFiles = null, array $oldMD5 = null )
Method to parse through a files element of the installation manifest and take
appropriate action.
Method to parse through a files element of the installation manifest and take
appropriate action.
Parameters
- $element
SimpleXMLElement - $element The XML node to process
- $cid
integer - $cid Application ID of application to install to
- $oldFiles
array - $oldFiles List of old files (SimpleXMLElement's)
- $oldMD5
array - $oldMD5 List of old MD5 sums (indexed by filename with value as MD5)
Returns
boolean - True on success
Since
3.1
|
public
boolean
|
#
parseLanguages( SimpleXMLElement $element, integer $cid = 0 )
Method to parse through a languages element of the installation manifest and
take appropriate action.
Method to parse through a languages element of the installation manifest and
take appropriate action.
Parameters
- $element
SimpleXMLElement - $element The XML node to process
- $cid
integer - $cid Application ID of application to install to
Returns
boolean - True on success
Since
3.1
|
public
boolean
|
#
parseMedia( SimpleXMLElement $element, integer $cid = 0 )
Method to parse through a media element of the installation manifest and take
appropriate action.
Method to parse through a media element of the installation manifest and take
appropriate action.
Parameters
- $element
SimpleXMLElement - $element The XML node to process
- $cid
integer - $cid Application ID of application to install to
Returns
boolean - True on success
Since
3.1
|
public
string
|
#
getParams( )
Method to parse the parameters of an extension, build the JSON string for its
default parameters, and return the JSON string.
Method to parse the parameters of an extension, build the JSON string for its
default parameters, and return the JSON string.
Returns
string - JSON string of parameter values
Since
3.1
Note
This method must always return a JSON compliant string
|
public
boolean
|
#
copyFiles( array $files, boolean $overwrite = null )
Copyfiles
Copy files from source directory to the target directory
Parameters
- $files
array - $files Array with filenames
- $overwrite
boolean - $overwrite True if existing files can be replaced
Returns
boolean - True on success
Since
3.1
|
public
boolean
|
#
removeFiles( object $element, integer $cid = 0 )
Method to parse through a files element of the installation manifest and
remove the files that were installed
Method to parse through a files element of the installation manifest and
remove the files that were installed
Parameters
- $element
object - $element The XML node to process
- $cid
integer - $cid Application ID of application to remove from
Returns
boolean - True on success
Since
3.1
|
public
boolean
|
#
copyManifest( integer $cid = 1 )
Copies the installation manifest file to the extension folder in the given
client
Copies the installation manifest file to the extension folder in the given
client
Parameters
- $cid
integer - $cid Where to copy the installfile [optional: defaults to 1 (admin)]
Returns
boolean - True on success, False on error
Since
3.1
|
public
boolean
|
#
findManifest( )
Tries to find the package manifest file
Tries to find the package manifest file
Returns
boolean - True on success, False on error
Since
3.1
|
public
SimpleXMLElement |null
|
#
isManifest( string $file )
Is the XML file a valid Joomla installation manifest file.
Is the XML file a valid Joomla installation manifest file.
Parameters
- $file
string - $file An xmlfile path to check
Returns
Since
3.1
|
public
string
|
#
generateManifestCache( )
Generates a manifest cache
Generates a manifest cache
Returns
string - serialised manifest data
Since
3.1
|
public
object
|
#
cleanDiscoveredExtension( string $type, string $element, string $folder = '', integer $client = 0 )
Cleans up discovered extensions if they're being installed some other way
Cleans up discovered extensions if they're being installed some other way
Parameters
- $type
string - $type The type of extension (component, etc)
- $element
string - $element Unique element identifier (e.g. com_content)
- $folder
string - $folder The folder of the extension (plugins; e.g. system)
- $client
integer - $client The client application (administrator or site)
Returns
object - Result of query
Since
3.1
|
public
array
|
#
findDeletedFiles( array $old_files, array $new_files )
Compares two "files" entries to find deleted files/folders
Compares two "files" entries to find deleted files/folders
Parameters
- $old_files
array - $old_files An array of SimpleXMLElement objects that are the old files
- $new_files
array - $new_files An array of SimpleXMLElement objects that are the new files
Returns
array - An array with the delete files and folders in findDeletedFiles[files] and
findDeletedFiles[folders] respectively
Since
3.1
|
public
array
|
#
loadMD5Sum( string $filename )
Loads an MD5SUMS file into an associative array
Loads an MD5SUMS file into an associative array
Parameters
- $filename
string - $filename Filename to load
Returns
array - Associative array with filenames as the index and the MD5 as the value
Since
3.1
|
public static
array
|
#
parseXMLInstallFile( string $path )
Parse a XML install manifest file.
Parse a XML install manifest file.
XML Root tag should be 'install' except for languages which use meta
file.
Parameters
- $path
string - $path Full path to XML file.
Returns
array - XML metadata.
Since
12.1
|
public
JInstallerAdapter
|
#
getAdapter( string $name, array $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
Fetches an adapter and adds it to the internal storage if an instance is not
set while also ensuring its a valid adapter name
Deprecated
4.0 The internal adapter cache will no longer be supported, use loadAdapter() to
fetch an adapter instance
Parameters
- $name
string - $name Name of adapter to return
- $options
array - $options Adapter options
Returns
Since
3.4
Overrides
|
public
array
|
#
getAdapters( array $options = array(), array $custom = array() )
Gets a list of available install adapters.
Gets a list of available install adapters.
Parameters
- $options
array - $options An array of options to inject into the adapter
- $custom
array - $custom Array of custom install adapters
Returns
array - An array of available install adapters.
Since
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.
|
public
JInstallerAdapter
|
#
loadAdapter( string $adapter, array $options = array() )
Method to load an adapter instance
Method to load an adapter instance
Parameters
- $adapter
string - $adapter Adapter name
- $options
array - $options Adapter options
Returns
Throws
Since
3.4
|
public
|
#
loadAllAdapters( array $options = array() )
Loads all adapters.
Deprecated
4.0 Individual adapters should be instantiated as needed
Parameters
- $options
array - $options Adapter options
Since
3.4
Note
This method is serving as a proxy of the legacy JAdapter API into the preferred
API
Overrides
|