Flush the server

@return boolean
544093
public function flush()
    {
        if (empty($this->memcache)) {
            return false;
        }

        $flushStatus = $this->memcache->flush();

        return $flushStatus;
    }
359617
public static function flush()
    {
        $instance = self::getInstance();
        $glob = @glob(self::cacheDir() . $instance->_options['file_name_prefix'] . '--*');

        if (empty($glob)) {
            return false;
        }

        foreach ($glob as $v) {
            $fileName = basename($v);
            $id = $instance->_fileNameToId($fileName);
            $instance->delete($id);
        }
        return true;
    }
1005415
public function flush()
    {
        $query = sprintf('TRUNCATE `%s`', $this->table);
        return $this->pdo->exec($query) !== false;
    }
869052
public function flush()
    {
        if (file_exists($this->CacheFolder . "/" . $this->CacheIndex)) {
            unlink($this->CacheFolder . "/" . $this->CacheIndex);
            touch($this->CacheFolder . "/" . $this->CacheIndex);
        }
        if (file_exists($this->CacheFolder . "/" . $this->CacheDB)) {
            unlink($this->CacheFolder . "/" . $this->CacheDB);
            touch($this->CacheFolder . "/" . $this->CacheDB);
        }
    }
799384
public function flush()
    {
        try {
        	$this->helper->recursivelyDeleteFromDirectory($this->path);
        	return true;

        // @codeCoverageIgnoreStart
        } catch (\Exception $e) {
        }

        return false;
        // @codeCoverageIgnoreEnd
    }
1004017
public function flush()
    {
        /** @var Cache $cache */
        $cache = $this->app['phraseanet.cache-service'];
        $flushOK = $cache->flushAll() ? 'ok' : 'ko';

        return $this->app->redirectPath('admin_dashboard', ['flush_cache' => $flushOK]);
    }
5699
public function stream_flush()
    {
        if ($this->fileHandle === null) {
            return false;
        }
        self::restore();
        $success = fflush($this->fileHandle);
        self::register();
        return $success;
    }
192012
public function flush()
    {
        if ($this->pollMode === null) { // first polling request is not there yet
            return;
        }
        if ($this->flushing) {
            return;
        }
        $bsize = sizeof($this->buffer);
        $fbsize = sizeof($this->framesBuffer);
        if ($bsize === 0 && $fbsize === 0) {
            return;
        }
        $this->flushing = true;
        if (in_array('one-by-one', $this->pollMode)) {
            $b = array_slice($this->buffer, 0, 1);
            $bsize = sizeof($b);
        } else {
            $b = $this->buffer;
        }
        if ($fbsize > 0) {
            if (!in_array('one-by-one', $this->pollMode) || !sizeof($b)) {
                $b[] = 'a' . $this->toJson($this->framesBuffer);
            } else {
                $fbsize = 0;
            }
        }
        $this->appInstance->publish(
            's2c:' . $this->id,
            $this->toJson($b),
            function ($redis) use ($bsize, $fbsize, $b) {
                $this->flushing = false;
                if (!$redis) {
                    return;
                }
                //D(['b' => $b, $redis->result]);
                if ($redis->result === 0) {
                    return;
                }
                $reflush = false;
                if (sizeof($this->buffer) > $bsize) {
                    $this->buffer = array_slice($this->buffer, $bsize);
                    $reflush = true;
                } else {
                    $this->buffer = [];
                }

                if (sizeof($this->framesBuffer) > $fbsize) {
                    $this->framesBuffer = array_slice($this->framesBuffer, $fbsize);
                    $reflush = true;
                } else {
                    $this->framesBuffer = [];
                }
                $this->onWrite();
                if ($reflush && in_array('stream', $this->pollMode)) {
                    $this->flush();
                }
            }
        );
    }
418614
public function flush()
    {
        rewind($this->handle);
        $out = stream_get_contents($this->handle);
        fseek($this->handle, 0, SEEK_END);
        return $out;
    }
866526
public function flush()
    {
        $id = $this->batchRunner
            ->getJobFromId($this->identifier)
            ->id();

        return $this->batchRunner
            ->getProcessor()
            ->flush($id);
    }
198060
public function clear()
    {
        if (isset($this->config[ 'dbIndex' ])) {
            return $this->redis->flushDB();
        } else {
            return $this->redis->flushAll();
        }
    }
900936
protected function flush()
    {
        $method = $this->methods['flush'];

        if (!method_exists($this->storage, $method) || !is_callable([$this->storage, $method])) {
            throw new FlushMethodNotFoundException(get_class($this->storage), $method);
        }

        $this->storage->$method();

        return true;
    }
414326
private function flush()
	{
		// check if writeback is needed
		if ($this->dirty == false)
			return true;

		// prepare to writeback to file
		$data = $this->data;
		$registry = $this->encode($this->data[self::REGISTRY]);
		$data[self::META]["updated"] = date("c");
		$data[self::META]["hash"] = md5($registry);

		// overwrite existing data
		$written = file_put_contents($this->getFile(), $this->encode($data));
		if ($written === false)
			throw new Exception(strtr( 'Unable to write back to {FILE}. Data will be lost!', array('{FILE}' => $this->getFile()) ));

		return true;
	}
648580
private function flush()
    {
        $currentConfigurationHash = $this->getCurrentConfigurationState();

        if ($currentConfigurationHash !== get_option('strata_rewrite_state')) {
            update_option('strata_rewrite_state', $currentConfigurationHash);
            flush_rewrite_rules();
            return true;
        }

        return false;
    }
707290
public static function flush() {
        if (count($_COOKIE) > 0) {
            foreach ($_COOKIE as $key => $value) {
                self::delete($key, '/');
            }
        }
    }
569217
protected function flush()
    {
        if (empty($this->sockets) && $this->fork() <= 0) {
            // Failed fork
            return;
        }

        $read = null;
        $write = $this->sockets;
        $except = null;

        if (stream_select($read, $write, $except, $this->timeout) > 0) {
            foreach ($write as $socket) {
                if ($this->queue->isEmpty()) {
                    break;
                }
                if ($this->write($socket, $this->queue->dequeue()) !== false) {
                    $this->remain++;
                }
            }
        }
    }
1114091
public function flush()
    {
        $this->initializeOnDemand();

        if ($this->cacheMapper->flush()) {
            // Reset the current state as well
            $this->cache = array();
            return true;
        } else {
            return false;
        }
    }