JInstallerLanguage/discover install: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Custom discover install method Basically updates the manifest cache and leaves everything alone
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>... |
m preparing for archive only |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
Custom discover install method Basically updates the manifest cache and leaves everything alone | Custom discover install method Basically updates the manifest cache and leaves everything alone | ||
<! removed transcluded page call, red link never existed > | |||
===Syntax=== | ===Syntax=== | ||
| Line 47: | Line 45: | ||
</source> | </source> | ||
<! removed transcluded page call, red link never existed > | |||
< | |||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=discover_install | category=discover_install | ||
category=JInstallerLanguage | category=JInstallerLanguage | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
[[Category:Archived pages API16]] | |||
Latest revision as of 01:49, 25 March 2017
Description
Custom discover install method Basically updates the manifest cache and leaves everything alone
<! removed transcluded page call, red link never existed >
Syntax
discover_install()
Defined in
libraries/joomla/installer/adapters/language.php
Importing
jimport( 'joomla.installer.adapters.language' );
Source Body
function discover_install()
{
// Need to find to find where the XML file is since we don't store this normally
$client = JApplicationHelper::getClientInfo($this->parent->extension->client_id);
$short_element = $this->parent->extension->element;
$manifestPath = $client->path . DS . 'language'. DS . $short_element . DS . $short_element . '.xml';
$this->parent->manifest = $this->parent->isManifest($manifestPath);
$this->parent->setPath('manifest', $manifestPath);
$this->parent->setPath('source', $client->path . DS . 'language'. DS . $short_element);
$this->parent->setPath('extension_root', $this->parent->getPath('source'));
$manifest_details = JApplicationHelper::parseXMLInstallFile($this->parent->getPath('manifest'));
$this->parent->extension->manifest_cache = serialize($manifest_details);
$this->parent->extension->state = 0;
$this->parent->extension->name = $manifest_details['name'];
$this->parent->extension->enabled = 1;
//$this->parent->extension->params = $this->parent->getParams();
try {
$this->parent->extension->store();
}
catch(JException $e)
{
JError::raiseWarning(101, JText::_('Language').' '.JText::_('Discover Install').': '.JText::_('Failed to store extension details'));
return false;
}
return $this->parent->extension->get('extension_id');
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples