Destroy an app and all its add-ons
7798
def destroy(self):
        """"""
        result = self._result(
            ["heroku", "apps:destroy", "--app", self.name, "--confirm", self.name]
        )
        return result
194451
def invalidate(self):
        "  "
        logger.info('Invalidating %s applications', len(self.apps))

        for app in self.apps:
            app.invalidate()
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))
549056
protected function destroyApplication()
    {
        $this->client->resetPersistentVars();
        if (isset(\Yii::$app) && \Yii::$app->has('session', true)) {
            \Yii::$app->session->close();
        }
        // Close connections if exists
        if (isset(\Yii::$app) && \Yii::$app->has('db', true)) {
            \Yii::$app->db->close();
        }
    }
1208618
def destroy(ctx, app, expire_hit, sandbox):
    """"""
    if expire_hit:
        ctx.invoke(expire, app=app, sandbox=sandbox, exit=False)
    HerokuApp(app).destroy()
983446
def release(self):
        """"""
        self.clear()

        if hasattr(self, "functions"):
            del self.functions

        if hasattr(self, "lib") and self.lib is not None:
            self.lib._jit_destroy_state(self.state)
            self.lib = None
229609
function destroy(released) {
    function flush() {
      if (messages.messages.length && !released) {
        return messages.flush();
      }
      return Promise.resolve();
    }

    function finalize() {
      messages.ignoreSignal();
      channel.destroy();
      channel = undefined;
    }

    return flush().then(function(){
      return unsubscribe(channel, options);
    }).then(finalize, finalize);
  }
738798
def destroy(self):
        
        path = next(iter(self.linuxPaths))
        directory = _Directory(os.path.dirname(path))
        with directory as device:
            device.SNAP_DESTROY(name=str(os.path.basename(path)), )
529945
public void destroy() {
		logger.debug("Goodbye POIProxy");
		for (POIProxyListener listener : listeners) {
			listener.destroy();
		}
		logger.debug("ZZZzzzzzZZzzZz");
	}
1309321
function remove(appName, domain, callback) {
    var url = format('/%s/apps/%s/domains/%s', deis.version, appName, domain);
    commons.del(url, callback);
  }
804914
def destroy(self):
        """"""
        r = api.Resources(self.provider_conf.to_dict())
        # insert force_deploy
        r.destroy()
233489
public static function destroy() {
		$__run_only_bootstrap = \Application::get('flag.global.__run_only_bootstrap');
		// we need to set working directory again
		chdir(\Application::get('application.path_full'));
		// error processing
		if (empty(\Object\Error\Base::$flag_error_already)) {
			$last_error = error_get_last();
			$flag_render = false;
			if (in_array($last_error['type'], [E_COMPILE_ERROR, E_PARSE, E_ERROR])) {
				\Object\Error\Base::errorHandler($last_error['type'], $last_error['message'], $last_error['file'], $last_error['line']);
				\Object\Error\Base::$flag_error_already = true;
				$flag_render = true;
			}
			if ($flag_render || \Object\Error\Base::$flag_exception) {
				\Object\Error\Base::$flag_error_already = true;
				if ($__run_only_bootstrap) {
					\Helper\Ob::cleanAll();
					print_r(\Object\Error\Base::$errors);
				} else {
					\Helper\Ob::cleanAll();
					// set mvc + process
					\Object\Error\Base::$flag_database_tenant_not_found = true;
					\Object\Controller\Front::setMvc('/Errors/_Error/500');
					\Application::$controller = new \Controller\Errors();
					\Application::process();
				}
			}
		}
		// final benchmark
		if (\Debug::$debug) {
			\Debug::benchmark('application end');
		}
		// debugging toolbar last
		if (\Debug::$toolbar && !$__run_only_bootstrap) {
			echo str_replace('<!-- [numbers: debug toolbar] -->', \Debug::render(), \Helper\Ob::clean());
		}
		// flush data to client
		flush();
		// closing caches before db
		$cache = \Factory::get(['cache']);
		if (!empty($cache)) {
			foreach ($cache as $k => $v) {
				if (!empty(cache::$reset_caches[$k])) {
					$v['object']->gc(3, cache::$reset_caches[$k]);
				}
				$v['object']->close();
			}
		}
		// destroy i18n
		if (\I18n::$initialized) {
			\I18n::destroy();
		}
		// custom destroy methods
		$temp = \Object\ACL\Resources::getStatic('destroy');
		if (!empty($temp)) {
			foreach ($temp as $v) {
				$method = \Factory::method($v['method'], null, true);
				call_user_func_array($method, []);
			}
		}
		// write sessions
		session_write_close();
		// close db connections
		$dbs = \Factory::get(['db']);
		if (!empty($dbs)) {
			foreach ($dbs as $k => $v) {
				$v['object']->close();
			}
		}
		// emails with erros
		if (\Debug::$debug && !empty(\Debug::$email) && \Application::get('Numbers.Backend', ['backend_exists' => true]) && \Application::get('Numbers.Frontend', ['backend_exists' => true])) {
			\Debug::sendErrorsToAdmin();
		}
	}
1089226
final protected function removeAppProcess()
    {
        $appname = $this->params['appname'];
        Output::displayAsGreen("Processing to delete app : $appname \n", "none", false);
        sleep(1);

        // DELETE TO APP CORE

        $file = json_decode(file_get_contents(FEnvFcm::get("framework.config.core.apps.file")));
        if (!empty($file)) {
            foreach ($file as $one => $val) {
                if ($val->name == $appname) {
                    unset($file->$one);
                    break;
                }
            }

            $file = array_values((array)$file);
            $filetemp = $file;
            $file = json_encode((object) $file, JSON_PRETTY_PRINT);

            file_put_contents(FEnvFcm::get("framework.config.core.apps.file"), $file);
            if (strlen($file) < 3) {
                file_put_contents(FEnvFcm::get("framework.config.core.apps.file"), "");
            }
        }

        $asm = new AssetsManager();
        $asm->__render(["commands" => ["assets:clear"],
            "options" => ["--quiet", "--noexit", "--appname=". $this->params['appname']]]);
        // $this->removeComposerApp($appname);
        Server::delete(FEnvFcm::get("framework.apps")."$appname", "directory");
        if (empty($filetemp)) {
            $base = __DIR__."/../../../../../../";
            $elem = json_decode(file_get_contents($base."elements/config_files/core/framework.config.json"));
            $elem->installation = null;
            $elem->deployment = null;
            file_put_contents($base."elements/config_files/core/framework.config.json", json_encode($elem));
        }
        Output::displayAsGreen("The application has been deleted. To create a new application,
         use [app create] .", "none", false);
    }
777468
function() {
								jQuery.each(req.apps, function(idx, item) {
									item.name = item.name || item.appId;
									F2.log('Removed failed ' + item.name + ' app', item);
									F2.AppHandlers.__trigger(
										_sAppHandlerToken,
										F2.Constants.AppHandlers.APP_MANIFEST_REQUEST_FAIL,
										item // the app config
									);
									F2.removeApp(item.instanceId);
								});
							}
1045606
def purge(packages, fatal=False):
    """"""
    cmd = ['yum', '--assumeyes', 'remove']
    if isinstance(packages, six.string_types):
        cmd.append(packages)
    else:
        cmd.extend(packages)
    log("Purging {}".format(packages))
    _run_yum_command(cmd, fatal)
1076545
private void cleanApps() {
        File AppsDir = new File(serverConfigDir.getAbsolutePath(), "apps");
        if (AppsDir.exists()) {
            cleanDir(AppsDir);
            log(MessageFormat.format(messages.getString("info.element.cleaned"), "apps"));
        } else {
            log(MessageFormat.format(messages.getString("info.directory.noexist"), AppsDir.getAbsolutePath()));
        }
    }
1350612
def destroy_s3(app='', env='dev', **_):
    
    session = boto3.Session(profile_name=env)
    client = session.resource('s3')

    generated = get_details(app=app, env=env)
    archaius = generated.archaius()

    bucket = client.Bucket(archaius['bucket'])

    for item in bucket.objects.filter(Prefix=archaius['path']):
        item.Object().delete()
        LOG.info('Deleted: %s/%s', item.bucket_name, item.key)

    return True