Disable a plugin wihout checking any dependency. Only add the disable file.
@throws IOException
320878
private void disableWithoutCheck() throws IOException {
        // creates an empty file
        try (OutputStream os = Files.newOutputStream(disableFile.toPath())) {
            os.close();
        } catch (InvalidPathException e) {
            throw new IOException(e);
        }
    }
1107544
function disable(path) {
        var result = new $.Deferred(),
            file = FileSystem.getFileForPath(path + "/.disabled");

        var defaultExtensionPath = ExtensionLoader.getDefaultExtensionPath();
        if (file.fullPath.indexOf(defaultExtensionPath) === 0) {
            toggleDefaultExtension(path, false);
            result.resolve();
            return result.promise();
        }

        file.write("", function (err) {
            if (err) {
                return result.reject(err);
            }
            result.resolve();
        });
        return result.promise();
    }
171220
protected function _disable(PluginPackage $plugin)
    {
        $requiredBy = Plugin::checkReverseDependency($plugin->name);
        if (!empty($requiredBy)) {
            $names = [];
            foreach ($requiredBy as $p) {
                $names[] = $p->name();
            }

            $this->err(__d('installer', 'Plugin "{0}" cannot be disabled as it is required by: {1}', $plugin->humanName, implode(', ', $names)));

            return false;
        }

        if (!$this->params['no-callbacks']) {
            $trigger = $this->_triggerBeforeEvents($plugin);
            if (!$trigger) {
                return false;
            }
        }

        return $this->_finish($plugin);
    }
194083
public function disable() {

        global $wp_filesystem;

        $plugin = $GLOBALS[ 'redisObjectCache' ];

        if ( ! $plugin->object_cache_dropin_exists() ) {

            WP_CLI::error( __( 'No object cache drop-in found.', 'redis-cache' ) );

        } else {

            if ( ! $plugin->validate_object_cache_dropin() ) {

                WP_CLI::error( __( 'An unknown object cache drop-in was found. To use Redis run: wp redis update-dropin.', 'redis-cache' ) );

            } else {

                WP_Filesystem();

                if ( $wp_filesystem->delete( WP_CONTENT_DIR . '/object-cache.php' ) ) {
                    WP_CLI::success( __( 'Object cache disabled.', 'redis-cache' ) );
                } else {
                    WP_CLI::error( __( 'Object cache could not be disabled.', 'redis-cache' ) );
                }

            }

        }

    }
905903
public void addDependency(final Dependency dependency) {
        if(dependency != null && !dependencies.contains(dependency)){
            this.dependencies.add(dependency);
        }
    }
144277
function() {
			disabled = arguments[0] !== undef ? arguments[0] : true;

			if (fileInputs.length) {
				plupload.each(fileInputs, function(fileInput) {
					fileInput.disable(disabled);
				});
			}

			this.trigger('DisableBrowse', disabled);
		}
564507
def disable_plugin(self, plugin_name):
        """"""
        plugin = self.get_plugin_info(plugin_name)
        ENABLED = os.path.join(plugin["plugin_package_abspath"], "ENABLED")
        DISABLED = os.path.join(plugin["plugin_package_abspath"], "DISABLED")
        if os.path.isfile(ENABLED):
            os.remove(ENABLED)
        self.__touch_file(DISABLED)
1356097
protected function _enable(PluginPackage $plugin)
    {
        $checker = new RuleChecker((array)$plugin->composer['require']);
        if (!$checker->check()) {
            $this->err(__d('installer', 'Plugin "{0}" cannot be enabled as some dependencies are disabled or not installed: {1}', $plugin->humanName, $checker->fail(true)));

            return false;
        }

        // MENTAL NOTE: As plugin is disabled its listeners are not attached to the
        // system, so we need to manually attach them in order to trigger callbacks.
        if (!$this->params['no-callbacks']) {
            $this->_attachListeners($plugin->name, "{$plugin->path}/");
            $trigger = $this->_triggerBeforeEvents($plugin);
            if (!$trigger) {
                return false;
            }
        }

        return $this->_finish($plugin);
    }
585162
public void addDependency(JSModule dep) {
    checkNotNull(dep);
    Preconditions.checkState(dep != this, "Cannot add dependency on self", this);
    deps.add(dep);
  }
761203
private void indexPluginArtifact() throws IOException {
        dependencyZips = new ArrayList<>();
        Enumeration<? extends ZipEntry> entries = this.pluginArtifactZip.entries();
        while (entries.hasMoreElements()) {
            ZipEntry zipEntry = entries.nextElement();
            if (zipEntry.getName().startsWith("WEB-INF/lib/") && zipEntry.getName().toLowerCase().endsWith(".jar")) {
                ZipFile dependencyZipFile = extractDependency(zipEntry);
                if (dependencyZipFile != null) {
                    dependencyZips.add(dependencyZipFile);
                }
            }
        }
    }
306335
private void intialize(File sourceDirectory) throws IOException {
    getLog().debug("Initializing i18n plugin...");

    // resource
    if (!getI18nSourceFiles(sourceDirectory).isEmpty()) {
      File myGeneratedResourcesFolder = getGeneratedResourcesFolder();
      addResource(myGeneratedResourcesFolder.getPath(), target);
    }

  }
445871
function _deactivate_plugin_hook() {
            $this->_logger->entrance( 'slug = ' . $this->_slug );

            if ( ! $this->is_user_admin() ) {
                return;
            }

            $is_network_deactivation  = fs_is_network_admin();
            $storage_keys_for_removal = array();

            $this->_admin_notices->clear_all_sticky();

            $storage_keys_for_removal[] = 'sticky_optin_added';
            if ( isset( $this->_storage->sticky_optin_added ) ) {
                unset( $this->_storage->sticky_optin_added );
            }

            if ( ! isset( $this->_storage->is_plugin_new_install ) ) {
                // Remember that plugin was already installed.
                $this->_storage->is_plugin_new_install = false;
            }

            // Hook to plugin uninstall.
            register_uninstall_hook( $this->_plugin_main_file_path, array( 'Freemius', '_uninstall_plugin_hook' ) );

            $this->clear_module_main_file_cache();
            $this->clear_sync_cron( $this->_is_network_active );
            $this->clear_install_sync_cron();

            if ( $this->is_registered() ) {
                if ( $this->is_premium() && ! $this->has_active_valid_license() ) {
                    FS_Plugin_Updater::instance( $this )->delete_update_data();
                }

                if ( $is_network_deactivation ) {
                    // Send deactivation event.
                    $this->sync_installs( array(
                        'is_active' => false,
                    ) );
                } else {
                    // Send deactivation event.
                    $this->sync_install( array(
                        'is_active' => false,
                    ) );
                }
            } else {
                if ( ! $this->has_api_connectivity() ) {
                    // Reset connectivity test cache.
                    unset( $this->_storage->connectivity_test );

                    $storage_keys_for_removal[] = 'connectivity_test';
                }
            }

            if ( $is_network_deactivation ) {
                if ( isset( $this->_storage->sticky_optin_added_ms ) ) {
                    unset( $this->_storage->sticky_optin_added_ms );
                }

                if ( ! empty( $storage_keys_for_removal ) ) {
                    $sites = self::get_sites();

                    foreach ( $sites as $site ) {
                        $blog_id = self::get_site_blog_id( $site );

                        foreach ( $storage_keys_for_removal as $key ) {
                            $this->_storage->remove( $key, false, $blog_id );
                        }

                        $this->_storage->save( $blog_id );
                    }
                }
            }

            // Clear API cache on deactivation.
            FS_Api::clear_cache();

            $this->remove_sdk_reference();
        }
795995
public void addPlugin(final Plugin plugin) {
        // put plugin into the repository's reciever map
        synchronized (pluginMap) {
            String name = plugin.getName();

            // make sure the plugin has reference to repository
            plugin.setLoggerRepository(getLoggerRepository());

            Plugin existingPlugin = (Plugin) pluginMap.get(name);
            if (existingPlugin != null) {
                existingPlugin.shutdown();
            }

            // put the new plugin into the map
            pluginMap.put(name, plugin);
            firePluginStarted(plugin);
        }
    }
218756
public void disable() throws IOException {
        // This has to be synchronized or it can collide with the check in the task.
        synchronized (optOutLock) {
            // Check if the server owner has already set opt-out, if not, set it.
            if (!isOptOut()) {
                properties.setProperty("opt-out", "true");
                properties.store(new FileOutputStream(configurationFile), "http://mcstats.org");
            }

            // Disable Task, if it is running
            if (thread != null) {
                thread.interrupt();
                thread = null;
            }
        }
    }
911073
def remove(self, addon, dev=False):
        """"""
        dependencies = self.get_dependency_manager(dev=dev)
        other_dependencies = self.get_dependency_manager(dev=not dev)
        self.stdout.write(style.format_command('Removing', addon))
        removed = dependencies.remove(addon, warn=False)
        if not removed:
            removed = other_dependencies.remove(addon, warn=False)

        if removed:
            self.build()
        else:
            exception = '%s is not installed.' % Dependency(addon).to_stdout()
            self.stdout.write(style.red(exception))
554374
function removePlugin(config, pluginName) {
    var deps = config.getPluginDependencies();

    // For default plugin, we have to disable it instead of removing from the list
    if (isDefaultPlugin(pluginName)) {
        return togglePlugin(config, pluginName, false);
    }

    // Remove the dependency from the list
    deps = deps.filterNot(function(dep) {
        return dep.getName() === pluginName;
    });
    return config.setPluginDependencies(deps);
}
68032
public void disable() {
        enabled = false;

        // It's possible that another uncaught exception handler was installed 'over' us.
        // Whether or not it wrapped us, we have no control over what other classes do, and
        // so we can only remove ourselves if we are still the ('top most') default handler.
        // The 'enabled' boolean exists to ensure we no longer handle uncaught exceptions
        // even in the scenario where we are wrapped.
        Thread.UncaughtExceptionHandler currentHandler = Thread.getDefaultUncaughtExceptionHandler();
        if (currentHandler == this) {
            Thread.setDefaultUncaughtExceptionHandler(defaultExceptionHandler);
        }
    }