Back to PluginAdapter class

Method refreshManifestCache

public bool
refreshManifestCache
()
Refreshes the extension table cache.
Returns
  • bool Result of operation, true if updated, false on failure.
Since
  • 3.1
Class: PluginAdapter
Project: Joomla

Method refreshManifestCache - Source code

/**
 * Refreshes the extension table cache.
 *
 * @return  boolean  Result of operation, true if updated, false on failure.
 *
 * @since   3.1
 */
public function refreshManifestCache()
{
    /*
     * Plugins use the extensions table as their primary store
     * Similar to modules and templates, rather easy
     * If it's not in the extensions table we just add it
     */
    $client = ApplicationHelper::getClientInfo($this->parent->extension->client_id);
    $manifestPath = $client->path . '/plugins/' . $this->parent->extension->folder . '/' . $this->parent->extension->element . '/' . $this->parent->extension->element . '.xml';
    $this->parent->manifest = $this->parent->isManifest($manifestPath);
    $this->parent->setPath('manifest', $manifestPath);
    $manifest_details = Installer::parseXMLInstallFile($this->parent->getPath('manifest'));
    $this->parent->extension->manifest_cache = json_encode($manifest_details);
    $this->parent->extension->name = $manifest_details['name'];
    if ($this->parent->extension->store()) {
        return true;
    } else {
        Log::add(Text::_('JLIB_INSTALLER_ERROR_PLG_REFRESH_MANIFEST_CACHE'), Log::WARNING, 'jerror');
        return false;
    }
}