API16:JInstallerLanguage/install
From Joomla! Documentation
Description
Custom install method 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.
<! removed transcluded page call, red link never existed >
Syntax
install()
Returns
boolean True on success
Defined in
libraries/joomla/installer/adapters/language.php
Importing
jimport( 'joomla.installer.adapters.language' );
Source Body
public function install()
{
$this->manifest = $this->parent->getManifest();
$root = &$this->manifest->document;
// Get the client application target
if ((string)$this->manifest->attributes()->client == 'both')
{
JError::raiseWarning(42, JText::_('Instr_Error_Deprecated_format'));
$element = $this->manifest->site->files;
if (!$this->_install('site', JPATH_SITE, 0, $element)) {
return false;
}
$element = $this->manifest->administration->files;
if (!$this->_install('administrator', JPATH_ADMINISTRATOR, 1, $element)) {
return false;
}
// This causes an issue because we have two eid's, *sigh* nasty hacks!
return true;
}
elseif ($cname = (string)$this->manifest->attributes()->client)
{
// Attempt to map the client to a base path
jimport('joomla.application.helper');
$client = &JApplicationHelper::getClientInfo($cname, true);
if ($client === null) {
$this->parent->abort(JText::sprintf('Instr_Abort', JText::sprintf('Instr_Error_Unknown_client_type', $cname)));
return false;
}
$basePath = $client->path;
$clientId = $client->id;
$element = $this->manifest->files;
return $this->_install($cname, $basePath, $clientId, $element);
}
else
{
// No client attribute was found so we assume the site as the client
$cname = 'site';
$basePath = JPATH_SITE;
$clientId = 0;
$element = $this->manifest->files;
return $this->_install($cname, $basePath, $clientId, $element);
}
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples