Back to ModuleAdapter class

Method setupUninstall

protected void
setupUninstall
()
Method to do any prechecks and setup the uninstall job
Returns
  • void
Since
  • 4.0.0
Class: ModuleAdapter
Project: Joomla

Method setupUninstall - Source code

/**
 * Method to do any prechecks and setup the uninstall job
 *
 * @return  void
 *
 * @since   4.0.0
 */
protected function setupUninstall()
{
    // Get the extension root path
    $element = $this->extension->element;
    $client = ApplicationHelper::getClientInfo($this->extension->client_id);
    if ($client === false) {
        throw new \RuntimeException(Text::sprintf('JLIB_INSTALLER_ERROR_MOD_UNINSTALL_UNKNOWN_CLIENT', $this->extension->client_id));
    }
    $this->parent->setPath('extension_root', $client->path . '/modules/' . $element);
    $this->parent->setPath('source', $this->parent->getPath('extension_root'));
    // Get the module's manifest object
    // We do findManifest to avoid problem when uninstalling a list of extensions: getManifest cache its manifest file.
    $this->parent->findManifest();
    $this->setManifest($this->parent->getManifest());
    // Attempt to load the language file; might have uninstall strings
    $this->loadLanguage(($this->extension->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/modules/' . $element);
}