Actions

API16

JInstallerLanguage/discover install

From Joomla! Documentation

< API16:JInstallerLanguage
Revision as of 21:01, 13 May 2013 by JoomlaWikiBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

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

[<! removed edit link to red link >]

<! 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 edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />