/**
* 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;
}