Destroy the process.

@return bool
553521
public function stopProcess()
    {
        $this->isCurrentOsSupported('Only on *nix-based systems process cna be destroyed. You are running "%s".');
        try {
            $result = shell_exec(sprintf('kill %d 2>&1', $this->pid));
            if (!preg_match('/No such process/', $result)) {
                return true;
            }
        } catch (Exception $e) {

        }

        return false;
    }
799771
public function destroy(){
        if($this->status() !== self::ACTIVE){
            throw Exception\SessionException::notStarted();
        }
        
        $_SESSION   = [];

        if(ini_get("session.use_cookies")){
            $params = session_get_cookie_params();

            setcookie(session_name(), "", time() - 42000,
                $params["path"], $params["domain"],
                $params["secure"], $params["httponly"]
            );
        }

        session_destroy();
        
        $this->finishedData = [];
    }
577426
public function exec(): bool
    {
        $process = proc_open(
            $this->command,
            $this->spec,
            $pipes,
            $this->cwd,
            $this->env
        );

        if (is_resource($process)) {
            if ($this->spec[self::STDIN][0] === "pipe") {
                fwrite($pipes[0], $this->stdin);
                fclose($pipes[0]);
            }
            if ($this->spec[self::STDOUT][0] === "pipe") {
                $this->stdout = stream_get_contents($pipes[1]);
                fclose($pipes[1]);
            }
            if ($this->spec[self::STDERR][0] === "pipe") {
                $this->stderr = stream_get_contents($pipes[2]);
                fclose($pipes[2]);
            }
            $this->exitcode = proc_close($process);
        }
        return ($this->exitcode === 0);
    }
822902
public function destroy()
    {
        $inputs       = Input::all();
        $params       = array_get($inputs, 'params');
        if (($unserialized = $this->unserialize($params['value'])) !== false) {
            $params['value'] = $unserialized;
        }
        $route   = uri();
        $session = $this->request->session();
        if (!$session->has($route)) {
            return response('', 200);
        }
        $paramsFromSession = $session->get($route);
        $data              = $this->prepareToDestroy($params, $paramsFromSession);

        $session->put($route, $data);
        $session->save();
        return response('', 200);
    }
425979
public function destroy()
    {
        // empty
        $_SESSION = array();

        // clear cookies from agent
        $signature = ($this->_name) . 'Signature';
            setcookie(
        $this->_name,
                '',
                time() - 42000,
        $this->_path,
        $this->_host,
        $this->_secure,
        $this->_httponly
            );
            setcookie(
        $signature,
                '',
                time() - 42000,
        $this->_path,
        $this->_host,
        $this->_secure,
        $this->_httponly
            );

        /**
         * Clear out of global scope, since setcookie requires buffer flush
         * to update global <_COOKIE> array.
         */
            unset($_COOKIE[$this->_name]);
            unset($_COOKIE[$signature]);

        // destroy
            session_destroy();
    }
869342
public function delete() {
        $sql = $this->grammar()->compileDelete($this);
        return $this->command()
            ->delete($sql, $this->getBindings());
    }
724224
public function delete()
    {
        if (is_resource($this->handle)) {
            fclose($this->handle);
            $this->handle = null;
        }
        if ($this->exists()) {
            return unlink($this->path);
        }

        return false;
    }
669263
public static function destruct()
    {
        if (is_null(self::$_file) || !is_resource(self::$_file)) {
            return false;
        }

        try {
            fclose(self::$_file);
        } catch (Exception $e) {
            return false;
        }
        return true;
    }
453012
public function destroy()
	{
		if ($this->get('id') == 0)
		{
			$this->addError('JGLOBAL_CATEGORY_NOT_FOUND');
			return false;
		}

		if ($this->get('parent_id') == 0)
		{
			$this->addError('JLIB_DATABASE_ERROR_DELETE_ROOT');
			return false;
		}

		if ($this->get('lft') == 0 or $this->get('rgt') == 0)
		{
			$this->addError('JLIB_DATABASE_ERROR_DELETE_ROOT');
			return false;
		}

		// Select it's children
		$children = self::all()
			->where('lft', '>=', (int)$this->get('lft'))
			->where('rgt', '<=', (int)$this->get('rgt'))
			->rows();

		if (!$children->count())
		{
			$this->addError('JLIB_DATABASE_ERROR_DELETE_CATEGORY');
			return false;
		}

		// Delete the dependencies
		$ids = array();

		foreach ($children as $child)
		{
			$ids[] = $child->get('id');
		}

		$query = $this->getQuery()
			->delete($this->getTableName())
			->whereIn('id', $ids);

		if (!$query->execute())
		{
			$this->addError($query->getError());
			return false;
		}

		// Delete the usergroup in view levels
		$find    = array();
		$replace = array();
		foreach ($ids as $id)
		{
			$find[] = "[$id,";
			$find[] = ",$id,";
			$find[] = ",$id]";
			$find[] = "[$id]";

			$replace[] = "[";
			$replace[] = ",";
			$replace[] = "]";
			$replace[] = "[]";
		}

		$rules = Viewlevel::all()
			->rows();

		foreach ($rules as $rule)
		{
			foreach ($ids as $id)
			{
				if (strstr($rule->get('rules'), '[' . $id)
				 || strstr($rule->get('rules'), ',' . $id)
				 || strstr($rule->get('rules'), $id . ']'))
				{
					$rule->set('rules', str_replace($find, $replace, $rule->get('rules')));

					if (!$rule->save())
					{
						$this->addError($rule->getError());
						return false;
					}
				}
			}
		}

		// Delete the user to usergroup mappings for the group(s) from the database.
		try
		{
			Map::destroyByGroup($ids);
		}
		catch (\Exception $e)
		{
			$this->addError($e->getMessage());
			return false;
		}

		return true;
	}
685418
public function close()
    {
        $this->free();
        $this->started = false;
        foreach ($this->pipes as $pipe) {
            fclose($pipe);
        }

        $this->closeProcess();
    }
701931
final public function destroy()
    {
        foreach ($this->registry as $offset => $object) {
            if (method_exists($object, '__destruct')) {
                $object->__destruct();
            }
            unset($this->registry[ $offset ]);
        }
    }
796885
public function destroy()
    {
        $_SESSION = [];

        if (ini_get("session.use_cookies")) {
            $params = session_get_cookie_params();
            $time = time() - 42000;
            $path = $params['path'];
            $domain = $params['domain'];
            $secure = $params['secure'];
            $http = $params['httponly'];
            setcookie(session_name(), '', $time, $path, $domain, $secure, $http);
        }


        $this->container->remove('Session');

        session_destroy();
    }
427200
public function abandon()
    {
        foreach ($this->processes as $index => $process) {
            $process->kill();

            unset($process[$index]);
        }

        unset($this->processes);
    }
1085067
public function destroy()
    {
        if ($this->active)
        {
            $this->clear();
            if (session_status() === PHP_SESSION_ACTIVE)
                session_commit();
            $this->active = false;
        }
        return $this;
    }
290586
public function stop(): bool
    {
        $this->process->getPid()->onResolve(function ($error, $pid) {
            if ($error) {
                throw new ProcessException($error);
            }

            print "\nStopping Process Id: {$pid}\n";

            if ('\\' === \DIRECTORY_SEPARATOR) {
                \exec(\sprintf('taskkill /F /T /PID %d 2>&1', $pid), $output, $exitCode);
                if ($exitCode) {
                    throw new ProcessException(\sprintf('Unable to kill the process (%s).', \implode(' ', $output)));
                }
            } else {
                $this->process->signal(15);

                if ($ok = \proc_open("kill $pid", [2 => ['pipe', 'w']], $pipes)) {
                    $ok = false === \fgets($pipes[2]);
                }

                if (!$ok) {
                    throw new ProcessException(\sprintf('Error while killing process "%s".', $pid));
                }
            }

            $this->process->kill();
        });

        return true;
    }
1085487
public function stop()
    {
        $this->checkSupportingOS('Cocur\BackgroundProcess can only stop a process on *nix-based systems, such as '.
                                 'Unix, Linux or Mac OS X. You are running "%s".');

        try {
            $result = shell_exec(sprintf('kill %d 2>&1', $this->pid));
            if (!preg_match('/No such process/', $result)) {
                return true;
            }
        } catch (Exception $e) {
        }

        return false;
    }
1335488
public function destroy()
	{
		if (!parent::destroy())
		{
			return false;
		}

		foreach ($this->getDescendants() as $descendant)
		{
			$descendant->destroy();

			// We have to decrement our internal reference to right here
			// so that we ultimately resolve trailing below based on the
			// properly updated value, otherwise anything upstream of 
			// what we're destroying won't be properly updated
			$this->rgt -= 2;
		}

		// Reposition new values of displaced items
		$this->resolveTrailing($this->rgt, false);

		return true;
	}