Jump to content

Community

Developer Documentation

core/Uninstall

What it is

Uninstall extensions are executed when an application is uninstalled, allowing an application an opportunity to perform any necessary cleanup not automatically performed by Invision Community. Examples include deleting files that may have been stored special during installation, or pinging a remote API to disable the site.

How to use

The extension defines 3 methods (and a deprecated method left in place for backwards compatibility)

    /**
     * Code to execute before the application has been uninstalled
     *
     * @param    string    $application    Application directory
     * @return    array
     */
    public function preUninstall( $application )
    {
    }

The preUninstall() method is called just prior to the application being uninstalled. This can be useful if you need to look data up before it is deleted, in order to perform the cleanup.

    /**
     * Code to execute after the application has been uninstalled
     *
     * @param    string    $application    Application directory
     * @return    array
     */
    public function postUninstall( $application )
    {
    }

The postUninstall() method is called just after the application has been uninstalled. 

    /**
     * Code to execute when other applications or plugins are uninstalled
     *
     * @param    string    $application    Application directory
     * @param    int        $plugin            Plugin ID
     * @return    void
     */
    public function onOtherUninstall( $application=NULL, $plugin=NULL )
    {
    }

If another application is uninstalled, you may need to take action within your application. For instance, your application may enable certain features integrating with the Calendar application, however if the Calendar application is uninstalled you may need to disable those features. This method allows your application an opportunity to take action when a different application (or plugin) is uninstalled.


  Report Document


×
×
  • Create New...