Display a page with results of plugin uninstallation and inform about the need to remove plugin files manually.

@param core_plugin_manager $pluginman
@param \core\plugininfo\base $pluginfo
@param progress_trace_buffer $progress
@return string
167532
public function plugin_uninstall_results_page(core_plugin_manager $pluginman, \core\plugininfo\base $pluginfo, progress_trace_buffer $progress) {
        $output = '';

        $pluginname = $pluginfo->component;

        $output .= $this->output->header();
        $output .= $this->output->heading(get_string('uninstalling', 'core_plugin', array('name' => $pluginname)));

        $output .= $this->output->box($progress->get_buffer(), 'generalbox uninstallresultmessage');

        $output .= $this->output->box(get_string('uninstalldelete', 'core_plugin',
            array('name' => $pluginname, 'rootdir' => $pluginfo->rootdir)), 'generalbox uninstalldelete');
        $output .= $this->output->continue_button(new moodle_url('/admin/index.php'));
        $output .= $this->output->footer();

        return $output;
    }
823777
public function progress_bar(lesson $lesson, $progress = null) {
        $context = context_module::instance($this->page->cm->id);

        // lesson setting to turn progress bar on or off
        if (!$lesson->progressbar) {
            return '';
        }

        // catch teachers
        if (has_capability('mod/lesson:manage', $context)) {
            return $this->output->notification(get_string('progressbarteacherwarning2', 'lesson'));
        }

        if ($progress === null) {
            $progress = $lesson->calculate_progress();
        }

        $content = html_writer::start_tag('div');
        $content .= html_writer::start_tag('div', array('class' => 'progress'));
        $content .= html_writer::start_tag('div', array('class' => 'progress-bar bar', 'role' => 'progressbar',
            'style' => 'width: ' . $progress .'%', 'aria-valuenow' => $progress, 'aria-valuemin' => 0, 'aria-valuemax' => 100));
        $content .= $progress . "%";
        $content .= html_writer::end_tag('div');
        $content .= html_writer::end_tag('div');
        $printprogress = html_writer::tag('div', get_string('progresscompleted', 'lesson', $progress) . $content);
        return $this->output->box($printprogress, 'progress_bar');
    }
568227
protected function get_progress_trace_instance() {
        if ($this->progress === null) {
            if (!$this->table->is_downloading()) {
                $this->progress = new \core\progress\display_if_slow(get_string('calculatingallstats', 'quiz_statistics'));
                $this->progress->set_display_names();
            } else {
                $this->progress = new \core\progress\none();
            }
        }
        return $this->progress;
    }
819687
public function removePlugin($plugin, $stopOnVersion = null)
    {
        $code = is_string($plugin) ? $plugin : $this->pluginManager->getIdentifier($plugin);

        if (!$this->hasVersionFile($code)) {
            return false;
        }

        $pluginHistory = $this->getDatabaseHistory($code);
        $pluginHistory = array_reverse($pluginHistory);

        $stopOnNextVersion = false;
        $newPluginVersion = null;

        foreach ($pluginHistory as $history) {
            if ($stopOnNextVersion && $history->version !== $stopOnVersion) {
                // Stop if the $stopOnVersion value was found and
                // this is a new version. The history could contain
                // multiple items for a single version (comments and scripts).
                $newPluginVersion = $history->version;
                break;
            }

            if ($history->type == self::HISTORY_TYPE_COMMENT) {
                $this->removeDatabaseComment($code, $history->version);
            }
            elseif ($history->type == self::HISTORY_TYPE_SCRIPT) {
                $this->removeDatabaseScript($code, $history->version, $history->detail);
            }

            if ($stopOnVersion === $history->version) {
                $stopOnNextVersion = true;
            }
        }

        $this->setDatabaseVersion($code, $newPluginVersion);

        if (isset($this->fileVersions[$code])) {
            unset($this->fileVersions[$code]);
        }
        if (isset($this->databaseVersions[$code])) {
            unset($this->databaseVersions[$code]);
        }
        if (isset($this->databaseHistory[$code])) {
            unset($this->databaseHistory[$code]);
        }
        return true;
    }
1149390
def unload_plugin(self, name):
        
        self._logger.debug("Unloading {}.".format(name))

        self._logger.debug("Removing plugin instance.")
        del self._plugins[name]

        self._logger.debug("Unloading module.")
        del self._modules[name]

        self._logger.debug("Unloading manifest...")
        manifest = self.get_manifest(name)
        self._manifests.remove(manifest)

        self._logger.debug("{} unloaded.".format(name))
1112737
def uninstall
      plugin = Heroku::Plugin.new(shift_argument)
      validate_arguments!
      if Heroku::Plugin.list.include? plugin.name
        action("Uninstalling #{plugin.name}") do
          plugin.uninstall
        end
      else
        Heroku::JSPlugin.uninstall(plugin.name)
      end
    end
903563
protected function get_role_map(progress_trace $trace) {
        global $DB;

        // Get all roles.
        $rolemap = array();
        $roles = $DB->get_records('role', null, '', 'id, name, shortname');
        foreach ($roles as $id=>$role) {
            $alias = $this->get_config('map_'.$id, $role->shortname, '');
            $alias = trim(core_text::strtolower($alias));
            if ($alias === '') {
                // Either not configured yet or somebody wants to skip these intentionally.
                continue;
            }
            if (isset($rolemap[$alias])) {
                $trace->output("Duplicate role alias $alias detected!");
            } else {
                $rolemap[$alias] = $id;
            }
        }

        return $rolemap;
    }
1128472
public function updatePlugin($plugin, $stopOnVersion = null)
    {
        $code = is_string($plugin) ? $plugin : $this->pluginManager->getIdentifier($plugin);

        if (!$this->hasVersionFile($code)) {
            return false;
        }

        $currentVersion = $this->getLatestFileVersion($code);
        $databaseVersion = $this->getDatabaseVersion($code);

        // No updates needed
        if ($currentVersion == $databaseVersion) {
            $this->note('- <info>Nothing to update.</info>');
            return;
        }

        $newUpdates = $this->getNewFileVersions($code, $databaseVersion);
        foreach ($newUpdates as $version => $details) {
            $this->applyPluginUpdate($code, $version, $details);

            if ($stopOnVersion === $version) {
                return true;
            }
        }

        return true;
    }
158531
public static function deleteAllCacheOnUpdate($pluginName = false)
    {
        AssetManager::getInstance()->removeMergedAssets($pluginName);
        View::clearCompiledTemplates();
        TrackerCache::deleteTrackerCache();
        PiwikCache::flushAll();
        self::clearPhpCaches();
        
        $pluginManager = Plugin\Manager::getInstance();
        $plugins = $pluginManager->getLoadedPlugins();
        foreach ($plugins as $plugin) {
            $plugin->reloadPluginInformation();
        }

        /**
         * Triggered after all non-memory caches are cleared (eg, via the cache:clear
         * command).
         */
        Piwik::postEvent('Filesystem.allCachesCleared');
    }
1063084
public function unloadPlugin($plugin)
    {
        $this->resetTransientCache();

        if (!($plugin instanceof Plugin)) {
            $oPlugin = $this->loadPlugin($plugin);
            if ($oPlugin === null) {
                unset($this->loadedPlugins[$plugin]);
                return;
            }

            $plugin = $oPlugin;
        }

        unset($this->loadedPlugins[$plugin->getPluginName()]);
    }
95137
function plugins_api_filter( $data, $action = '', $args = null ) {
            $this->_logger->entrance();

            if ( ( 'plugin_information' !== $action ) ||
                 ! isset( $args->slug )
            ) {
                return $data;
            }

            $addon    = false;
            $is_addon = false;

            if ( $this->_fs->get_slug() !== $args->slug ) {
                $addon = $this->_fs->get_addon_by_slug( $args->slug );

                if ( ! is_object( $addon ) ) {
                    return $data;
                }

                $is_addon = true;
            }

            $plugin_in_repo = false;
            if ( ! $is_addon ) {
                // Try to fetch info from .org repository.
                $data = self::_fetch_plugin_info_from_repository( $action, $args );

                $plugin_in_repo = ( false !== $data );
            }

            if ( ! $plugin_in_repo ) {
                $data = $args;

                // Fetch as much as possible info from local files.
                $plugin_local_data = $this->_fs->get_plugin_data();
                $data->name        = $plugin_local_data['Name'];
                $data->author      = $plugin_local_data['Author'];
                $data->sections    = array(
                    'description' => 'Upgrade ' . $plugin_local_data['Name'] . ' to latest.',
                );

                // @todo Store extra plugin info on Freemius or parse readme.txt markup.
                /*$info = $this->_fs->get_api_site_scope()->call('/information.json');

if ( !isset($info->error) ) {
    $data = $info;
}*/
            }

            $plugin_version = $this->_fs->get_plugin_version();

            // Get plugin's newest update.
            $new_version = $this->get_latest_download_details( $is_addon ? $addon->id : false, $plugin_version );

            if ( ! is_object( $new_version ) || empty( $new_version->version ) ) {
                $data->version = $plugin_version;
            } else {
                if ( $is_addon ) {
                    $data->name    = $addon->title . ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' );
                    $data->slug    = $addon->slug;
                    $data->url     = WP_FS__ADDRESS;
                    $data->package = $new_version->url;
                }

                if ( ! $plugin_in_repo ) {
                    $data->last_updated = ! is_null( $new_version->updated ) ? $new_version->updated : $new_version->created;
                    $data->requires     = $new_version->requires_platform_version;
                    $data->tested       = $new_version->tested_up_to_version;
                }

                $data->version       = $new_version->version;
                $data->download_link = $new_version->url;

                if ( isset( $new_version->readme ) && is_object( $new_version->readme ) ) {
                    $new_version_readme_data = $new_version->readme;
                    if ( isset( $new_version_readme_data->sections ) ) {
                        $new_version_readme_data->sections = (array) $new_version_readme_data->sections;
                    } else {
                        $new_version_readme_data->sections = array();
                    }

                    if ( isset( $data->sections ) ) {
                        if ( isset( $data->sections['screenshots'] ) ) {
                            $new_version_readme_data->sections['screenshots'] = $data->sections['screenshots'];
                        }

                        if ( isset( $data->sections['reviews'] ) ) {
                            $new_version_readme_data->sections['reviews'] = $data->sections['reviews'];
                        }
                    }

                    if ( isset( $new_version_readme_data->banners ) ) {
                        $new_version_readme_data->banners = (array) $new_version_readme_data->banners;
                    } else if ( isset( $data->banners ) ) {
                        $new_version_readme_data->banners = $data->banners;
                    }

                    $wp_org_sections = array(
                        'author',
                        'author_profile',
                        'rating',
                        'ratings',
                        'num_ratings',
                        'support_threads',
                        'support_threads_resolved',
                        'active_installs',
                        'added',
                        'homepage'
                    );

                    foreach ( $wp_org_sections as $wp_org_section ) {
                        if ( isset( $data->{$wp_org_section} ) ) {
                            $new_version_readme_data->{$wp_org_section} = $data->{$wp_org_section};
                        }
                    }

                    $data = $new_version_readme_data;
                }
            }

            return $data;
        }
132218
protected function _pluginPath($pluginName)
    {
        if (Plugin::isLoaded($pluginName)) {
            return Plugin::path($pluginName);
        }

        return current(App::path('Plugin')) . $pluginName . DIRECTORY_SEPARATOR;
    }
978156
protected function process_buffer(progress_trace $trace) {
        global $DB;

        if (!$future_enrols = $DB->get_records_select('enrol_flatfile', "timestart < ?", array(time()))) {
            $trace->output("No enrolments to be processed in flatfile buffer");
            $trace->finished();
            return false;
        }

        $trace->output("Starting processing of flatfile buffer");
        foreach($future_enrols as $en) {
            $user = $DB->get_record('user', array('id'=>$en->userid));
            $course = $DB->get_record('course', array('id'=>$en->courseid));
            if ($user and $course) {
                $trace->output("buffer: $en->action $en->roleid $user->id $course->id $en->timestart $en->timeend", 1);
                $this->process_records($trace, $en->action, $en->roleid, $user, $course, $en->timestart, $en->timeend, false);
            }
            $DB->delete_records('enrol_flatfile', array('id'=>$en->id));
        }
        $trace->output("Finished processing of flatfile buffer");
        $trace->finished();

        return true;
    }
344159
public function uninstall()
    {
        $_POST['selected'] = [];

        foreach ((array) $this->plugin as $plugin) {
            $_POST['selected'][] = $plugin->name;
        }

        $_POST['edit_method'] = 'delete';
        ob_start();
        plugin_multi_edit();
        ob_end_clean();
    }
779593
@RequestMapping(value = "/api/plugins/{id}", method = RequestMethod.DELETE)
    public
    @ResponseBody
    HashMap<String, Object> deletePluginPath(Model model, @PathVariable Integer id) {
        try {
            PluginManager.getInstance().deletePluginPath(id);
        } catch (Exception e) {
        }

        return pluginInformation();
    }
187954
void pluginCompleted(Plugin plugin) {
        PluginStats pluginStats = mapPluginStats.get(plugin.getId());
        if (pluginStats == null) {
            // Plugin was not processed
            return;
        }

        StringBuilder sb = new StringBuilder();
        if (isStop()) {
            sb.append("stopped host/plugin ");
 
        // ZAP: added skipping notifications
        } else if (pluginStats.isSkipped()) {
            sb.append("skipped plugin ");
            String reason = pluginStats.getSkippedReason();
            if (reason != null) {
                sb.append('[').append(reason).append("] ");
            }
        } else {
            sb.append("completed host/plugin ");
        }
        
        sb.append(hostAndPort).append(" | ").append(plugin.getCodeName());
        long startTimeMillis = pluginStats.getStartTime();
        long diffTimeMillis = System.currentTimeMillis() - startTimeMillis;
        String diffTimeString = decimalFormat.format(diffTimeMillis / 1000.0);
        sb.append(" in ").append(diffTimeString).append('s');
        sb.append(" with ").append(pluginStats.getMessageCount()).append(" message(s) sent");
        sb.append(" and ").append(pluginStats.getAlertCount()).append(" alert(s) raised.");

        // Probably too verbose evaluate 4 the future
        log.info(sb.toString());
        
        pluginFactory.setRunningPluginCompleted(plugin);
        notifyHostProgress(null);
                
        // ZAP: update progress as finished
        pluginStats.setProgress(nodeInScopeCount);
    }
787932
public function processUpgradeScript(Plugin $plugin, &$log, $installedVersion)
    {
        $script = $plugin->Path .'/upgrade.php';

        if(file_exists($script))
            include_once $script;

    }