API16

JInstallerComponent/refreshManifestCache: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> {{Description...
 
m preparing for archive only
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<! removed transcluded page call, red link never existed >
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JInstallerComponent/refreshManifestCache|Edit Descripton]]<nowiki>]</nowiki>
</span>
 
{{Description:JInstallerComponent/refreshManifestCache}}


===Syntax===
===Syntax===
Line 38: Line 33:
</source>
</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JInstallerComponent/refreshManifestCache|Edit See Also]]<nowiki>]</nowiki>
<! removed transcluded page call, red link never existed >
</span>
{{SeeAlso:JInstallerComponent/refreshManifestCache}}


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=refreshManifestCache
  category=refreshManifestCache
  category=JInstallerComponent
  category=JInstallerComponent
  category=CodeExample
  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

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

Syntax

refreshManifestCache()


Defined in

libraries/joomla/installer/adapters/component.php

Importing

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

Source Body

public function refreshManifestCache()
{
        // 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 = str_replace('com_', '', $this->parent->extension->element);
        $manifestPath = $client->path . DS . 'components'. DS . $this->parent->extension->element . DS . $short_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'];
        try {
                return $this->parent->extension->store();
        } catch(JException $e) {
                JError::raiseWarning(101, JText::_('Component').' '.JText::_('Refresh Manifest Cache').': '.JText::_('Failed to store extension details'));
                return false;
        }
}


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

Examples

Code Examples