API16

API16:JInstallerPlugin/refreshManifestCache

From Joomla! Documentation

Revision as of 01:50, 25 March 2017 by JoomlaWikiBot (talk | contribs) (preparing for archive only)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<! removed transcluded page call, red link never existed >

Syntax

refreshManifestCache()


Defined in

libraries/joomla/installer/adapters/plugin.php

Importing

jimport( 'joomla.installer.adapters.plugin' );

Source Body

function refreshManifestCache()
{
        // Plugins use the extensions table as their primary store
        // Similar to modules and templates, rather easy
        // If its not in the extensions table we just add it
        $client = JApplicationHelper::getClientInfo($this->parent->extension->client_id);
        $manifestPath = $client->path . DS . 'plugins'. DS . $this->parent->extension->folder . DS . $this->parent->extension->element . '.xml';
        $this->parent->manifest = $this->parent->isManifest($manifestPath);
        $this->parent->setPath('manifest', $manifestPath);
        $manifest_details = JApplicationHelper::parseXMLInstallFile($this->parent->getPath('manifest'));
        $this->parent->extension->manifest_cache = serialize($manifest_details);

        $this->parent->extension->name = $manifest_details['name'];
        if ($this->parent->extension->store()) {
                return true;
        }
        else
        {
                JError::raiseWarning(101, JText::_('Plugin').' '.JText::_('Refresh Manifest Cache').': '.JText::_('Failed to store extension details'));
                return false;
        }
}


<! removed transcluded page call, red link never existed >

Examples

Code Examples