Back to Installer class

Method refreshManifestCache

public bool
refreshManifestCache
(mixed $eid)
Refreshes the manifest cache stored in #__extensions
Parameters
  • int $eid Extension ID
Returns
  • bool
Since
  • 3.1
Class: Installer
Project: Joomla

Method refreshManifestCache - Source code

/**
 * Refreshes the manifest cache stored in #__extensions
 *
 * @param   integer  $eid  Extension ID
 *
 * @return  boolean
 *
 * @since   3.1
 */
public function refreshManifestCache($eid)
{
    if ($eid) {
        if (!$this->extension->load($eid)) {
            $this->abort(Text::_('JLIB_INSTALLER_ABORT_LOAD_DETAILS'));
            return false;
        }
        if ($this->extension->state == -1) {
            $this->abort(Text::sprintf('JLIB_INSTALLER_ABORT_REFRESH_MANIFEST_CACHE', $this->extension->name));
            return false;
        }
        // Fetch the adapter
        $adapter = $this->loadAdapter($this->extension->type);
        if (!\is_object($adapter)) {
            return false;
        }
        if (!method_exists($adapter, 'refreshManifestCache')) {
            $this->abort(Text::sprintf('JLIB_INSTALLER_ABORT_METHODNOTSUPPORTED_TYPE', $this->extension->type));
            return false;
        }
        $result = $adapter->refreshManifestCache();
        if ($result !== false) {
            return true;
        } else {
            return false;
        }
    }
    $this->abort(Text::_('JLIB_INSTALLER_ABORT_REFRESH_MANIFEST_CACHE_VALID'));
    return false;
}