public function cancel_plugin_installation($component) {
        global $CFG;

        if (!empty($CFG->disableupdateautodeploy)) {
            return false;
        }

        $plugin = $this->get_plugin_info($component);

        if ($this->can_cancel_plugin_installation($plugin)) {
            $this->remove_plugin_folder($plugin);
        }

        return false;
    }
public function cancel_plugin_installation($component) {
        global $CFG;

        if (!empty($CFG->disableupdateautodeploy)) {
            return false;
        }

        $plugin = $this->get_plugin_info($component);

        if ($this->can_cancel_plugin_installation($plugin)) {
            $this->remove_plugin_folder($plugin);
        }

        return false;
    }
public function cancel_plugin_installation ( $ component ) { global $ CFG ; if ( ! empty ( $ CFG -> disableupdateautodeploy ) ) { return false ; } $ plugin = $ this -> get_plugin_info ( $ component ) ; if ( $ this -> can_cancel_plugin_installation ( $ plugin ) ) { $ this -> remove_plugin_folder ( $ plugin ) ; } return false ; }
Removes the plugin code directory if it is not installed yet.

This is intended for the plugins check screen to give the admin a chance
to cancel the installation of just unzipped plugin before the database
upgrade happens.

@param string $component
Removes the plugin code directory if it is not installed yet .