Back to Installer class

Method uninstall

public bool
uninstall
(mixed $type, mixed $identifier)
Package uninstallation method
Parameters
  • string $type Package type
  • mixed $identifier Package identifier for adapter
Returns
  • bool True if successful
Since
  • 3.1
Class: Installer
Project: Joomla

Method uninstall - Source code

/**
 * Package uninstallation method
 *
 * @param   string  $type        Package type
 * @param   mixed   $identifier  Package identifier for adapter
 *
 * @return  boolean  True if successful
 *
 * @since   3.1
 */
public function uninstall($type, $identifier)
{
    $params = array('extension' => $this->extension, 'route' => 'uninstall');
    $adapter = $this->loadAdapter($type, $params);
    if (!\is_object($adapter)) {
        return false;
    }
    // We don't load languages here, we get the extension adapter to work it out
    // Fire the onExtensionBeforeUninstall event.
    PluginHelper::importPlugin('extension');
    Factory::getApplication()->triggerEvent('onExtensionBeforeUninstall', array('eid' => $identifier));
    // Run the uninstall
    $result = $adapter->uninstall($identifier);
    // Fire the onExtensionAfterInstall
    Factory::getApplication()->triggerEvent('onExtensionAfterUninstall', array('installer' => clone $this, 'eid' => $identifier, 'removed' => $result));
    // Refresh versionable assets cache
    Factory::getApplication()->flushAssets();
    return $result;
}