LanguageAdapter

Extends InstallerAdapter

Language installer

since

3.1

package

Joomla CMS

Methods

__construct

Constructor

__construct(\Joomla\CMS\Installer\Installer parent, \Joomla\Database\DatabaseDriver db, mixed||string|int options = []) : 
inherited
since

3.4

Arguments

parent

InstallerParent object

db

DatabaseDriverDatabase object

options

array<string|int, mixed>Configuration Options

Response

mixed

__get

Proxy for db variable.

__get( name) : 
inherited deprecated
since

4.2.0

deprecated

4.3 will be removed in 6.0 Use getDatabase() instead of directly accessing _db

Arguments

name

stringThe name of the element

Response

mixedThe value of the element if set, null otherwise

_install

Install function that is designed to handle individual clients

_install( cname,  basePath,  clientId,  &element) : bool|int
since

3.1

Arguments

cname

stringCname @todo: not used

basePath

stringThe base name.

clientId

intThe client id.

element

objectThe XML element.

Response

bool|intThe extension ID on success, boolean false on failure

canUninstallPackageChild

Check if a package extension allows its child extensions to be uninstalled individually

canUninstallPackageChild( packageId) : 
inherited
since

3.7.0

note

This method defaults to true to emulate the behavior of 3.6 and earlier which did not support this lookup

Arguments

packageId

intThe extension ID of the package to check

Response

bool

checkExistingExtension

Method to check if the extension is already present in the database

checkExistingExtension() : 
inherited
since

3.4

throws

RuntimeException

Response

void

checkExtensionInFilesystem

Method to check if the extension is present in the filesystem, flags the route as update if so

checkExtensionInFilesystem() : 
inherited
since

3.4

throws

RuntimeException

Response

void

copyBaseFiles

Method to copy the extension's base files from the <files> tag(s) and the manifest file

copyBaseFiles() : 
since

3.4

throws

RuntimeException

Response

void

createContentLanguage

Create an unpublished content language.

createContentLanguage(tag) : 
throws

Exception

since

4.0.0

Arguments

tag

string The language tag

Response

mixed

createExtensionRoot

Method to create the extension root path if necessary

createExtensionRoot() : 
inherited
since

3.4

throws

RuntimeException

Response

void

discover

Custom discover method Finds language files

discover() : \Joomla\CMS\Table\Extension||string|int
since

3.1

Response

array<string|int, Extension>Array of discovered extensions.

discover_install

Custom discover install method Basically updates the manifest cache and leaves everything alone

discover_install() : 
since

3.1

Response

intThe extension id

doDatabaseTransactions

Method to handle database transactions for the installer

doDatabaseTransactions() : 
inherited
since

3.4

throws

RuntimeException

Response

boolTrue on success

doLoadLanguage

Load language files

doLoadLanguage( extension,  source,  base = JPATH_ADMINISTRATOR) : 
inherited
since

3.4

Arguments

extension

stringThe name of the extension

source

stringPath to the extension

base

stringBase path for the extension language

Response

void

finaliseInstall

Method to finalise the installation processing

finaliseInstall() : 
since

4.0.0

throws

RuntimeException

Response

void

finaliseUninstall

Method to finalise the uninstallation processing

finaliseUninstall() : 
since

4.0.0

throws

RuntimeException

Response

bool

getDiscoverInstallSupported

Checks if the adapter supports discover_install

getDiscoverInstallSupported() : 
inherited
since

3.4

Response

bool

getElement

Get the filtered extension element from the manifest

getElement( element = null) : 
inherited
since

3.4

Arguments

element

stringOptional element name to be converted

Response

stringThe filtered element

getManifest

Get the manifest object.

getManifest() : \SimpleXMLElement
inherited
since

3.4

Response

SimpleXMLElementManifest object

getName

Get the filtered component name from the manifest

getName() : 
inherited
since

3.4

Response

stringThe filtered name

getParent

Retrieves the parent installer

getParent() : \Joomla\CMS\Installer\Installer
inherited
since

4.0.0

Response

Installer

getRoute

Get the install route being followed

getRoute() : 
inherited
since

3.4

Response

stringThe install route

getScriptClassName

Get the class name for the install adapter script.

getScriptClassName() : 
inherited
since

3.4

Response

stringThe class name.

getSefString

Gets a unique language SEF string.

getSefString( itemLanguageTag) : 

This function checks other existing language with the same code, if they exist provides a unique SEF name. For instance: en-GB, en-US and en-AU will share the same SEF code by default: www.mywebsite.com/en/ To avoid this conflict, this function creates a specific SEF in case of existing conflict: For example: www.mywebsite.com/en-au/

since

3.7.0

Arguments

itemLanguageTag

stringLanguage Tag.

Response

string

install

Custom install method

install() : bool|int

Note: This behaves badly due to hacks made in the middle of 1.5.x to add the ability to install multiple distinct packs in one install. The preferred method is to use a package to install multiple language packs.

since

3.1

Response

bool|intThe extension ID on success, boolean false on failure

parseOptionalTags

Method to parse optional tags in the manifest

parseOptionalTags() : 
inherited
since

3.1

Response

void

parseQueries

Method to parse the queries specified in the <sql> tags

parseQueries() : 
inherited
since

3.4

throws

RuntimeException

Response

void

prepareDiscoverInstall

Prepares the adapter for a discover_install task

prepareDiscoverInstall() : 
inherited
since

3.4

Response

void

refreshManifestCache

Refreshes the extension table cache

refreshManifestCache() : 
since

3.1

Response

boolresult of operation, true if updated, false on failure

removeExtensionFiles

Removes this extension's files

removeExtensionFiles() : 
since

4.0.0

throws

RuntimeException

Response

void

resetUserLanguage

Resets user language to default language

resetUserLanguage() : 
since

4.0.0

Response

void

setManifest

Set the manifest object.

setManifest( manifest) : \Joomla\CMS\Installer\InstallerAdapter
inherited
since

3.4

Arguments

manifest

objectThe manifest object

Response

InstallerAdapterInstance of this class to support chaining

setRoute

Set the install route being followed

setRoute( route) : \Joomla\CMS\Installer\InstallerAdapter
inherited
since

3.4

Arguments

route

stringThe install route being followed

Response

InstallerAdapterInstance of this class to support chaining

setupInstallPaths

Method to do any prechecks and setup the install paths for the extension

setupInstallPaths() : 
since

3.4

Response

void

setupScriptfile

Setup the manifest script file for those adapters that use it.

setupScriptfile() : 
inherited
since

3.4

Response

void

setupUninstall

Method to do any prechecks and setup the uninstall job

setupUninstall() : 
since

4.0.0

Response

void

setupUpdates

Method to setup the update routine for the adapter

setupUpdates() : 
inherited
since

3.4

Response

void

storeExtension

Method to store the extension to the database

storeExtension() : 
since

3.4

throws

RuntimeException

Response

void

triggerManifestScript

Executes a custom install script method

triggerManifestScript( method) : 
inherited
since

3.4

throws

RuntimeException

Arguments

method

stringThe install method to execute

Response

boolTrue on success

uninstall

Generic update method for extensions

uninstall( id) : 
inherited
since

4.0.0

Arguments

id

intThe extension ID

Response

boolTrue on success

update

Custom update method

update() : 
since

3.1

Response

boolTrue on success, false on failure

Properties

changelogurl

Changelog URL of extensions

inherited
since

4.0.0

Type(s)

string

currentExtensionId

ID for the currently installed extension if present

inherited
since

3.4

Type(s)

int

element

The unique identifier for the extension (e.g. mod_login)

inherited
since

3.4

Type(s)

string

extension

Extension object.

inherited
since

3.4

Type(s)

Extension

extensionMessage

Messages rendered by custom scripts

inherited
since

3.4

Type(s)

string

manifest

Copy of the XML manifest file.

inherited

Making this object public allows extensions to customize the manifest in custom scripts.

since

3.4

Type(s)

SimpleXMLElement

manifest_script

A path to the PHP file that the scriptfile declaration in the manifest refers to.

inherited
since

3.4

Type(s)

string

name

Name of the extension

inherited
since

3.4

Type(s)

string

parent

Installer used with this adapter

inherited
since

4.0.0

Type(s)

Installer

route

Install function routing

inherited
since

3.4

Type(s)

string

supportsDiscoverInstall

Flag if the adapter supports discover installs

inherited

Adapters should override this and set to false if discover install is unsupported

since

3.4

Type(s)

bool

type

The type of adapter in use

inherited
since

3.4

Type(s)

string

core

Core language pack flag

since

3.0.0

Type(s)

bool

tag

The language tag for the package

since

4.0.0

Type(s)

string

ignoreUninstallQueries

Flag indicating the uninstall process should not run SQL queries

since

4.0.0

Type(s)

bool