Flush - sends the flush_all command to Memcached instance and returns the result.

@author Benjamin Carl <opensource@clickalicious.de>
@return mixed The response for command version
@access public
427885
public function flush_all()
    {
        /**
         * flush_all\r\n
         */

        // Build packet to send ...
        $data = self::COMMAND_FLUSH_ALL . self::COMMAND_TERMINATOR;

        return $this->send(self::COMMAND_FLUSH_ALL, $data);
    }
704802
public function flushAllAction()
    {
        try {
            $this->getWorker()->execute('flushAll');
            
            $this->get('session')->getFlashBag()->add('success', 'Flush ALL executed successfully');
        }catch(\Exception $e) {
            $this->get('session')->getFlashBag()->add('error', 'We have encountered an error : '.$e->getMessage());
        }
        
        return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
    }
1362451
public function flushCache()
    {
        $database = $this->getDatabase();
        
        $tables = static::getTables($database);
        
        $key  = 'db/tables/' . $database;
        static::getCache()->remove($key);
        
        if ($tables) {
            foreach ($tables as $table) {
                $key  = 'db/tableinfo/' . $table;
                static::getCache()->remove($key);
            }
        }
    }
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;
    }
714018
public function flush()
    {
        if (null === $this->routesFactory) {
            $routes = new RouteCollection();
        } else {
            $routes = $this->routesFactory;
        }

        return $this->doFlush('', $routes);
    }
767364
public function cacheCommand()
    {
        $file = $this->alias->resolve('@root/.env');
        if (!file_exists($file)) {
            return $this->console->writeLn(['`:file` dotenv file is not exists', 'file' => $file]);
        }

        $data = (new Dotenv())->parse(file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES));
        $content = '<?php' . PHP_EOL .
            'return ' . var_export($data, true) . ';' . PHP_EOL;
        $this->filesystem->filePut('@root/.env.php', $content);

        return 0;
    }
14180
def flush_all(self, time):
        
        logger.info('Flushing memcached')
        self._send(struct.pack(self.HEADER_STRUCT +
                               self.COMMANDS['flush']['struct'],
                               self.MAGIC['request'],
                               self.COMMANDS['flush']['command'],
                               0, 4, 0, 0, 4, 0, 0, time))

        (magic, opcode, keylen, extlen, datatype, status, bodylen, opaque,
         cas, extra_content) = self._get_response()

        if status not in (self.STATUS['success'], self.STATUS['server_disconnected']):
            raise MemcachedException('Code: %d message: %s' % (status, extra_content), status)

        logger.debug('Memcached flushed')
        return True
1053860
def flush_dns_cache
      if @flush_command && !@flush_command.empty?
        stdout, stderr, status = Open3.capture3(@flush_command)
        if status == 0
          @logger.debug("Flushed #{stdout.chomp} records from DNS cache")
        else
          @logger.warn("Failed to flush DNS cache: #{stderr.chomp}")
        end
      end
    end
1256769
public function clearCache()
    {
        if ($this->Using === 'APCu') {
            return $this->Modified = apcu_clear_cache();
        }
        if ($this->Using === 'Memcached') {
            return ($this->WorkingData->flush() && ($this->Modified = true));
        }
        if ($this->Using === 'Redis') {
            return ($this->WorkingData->flushDb() && ($this->Modified = true));
        }
        if ($this->Using === 'PDO') {
            $PDO = $this->WorkingData->prepare(self::clearQuery);
            if ($PDO !== false && $PDO->execute()) {
                return ($PDO->rowCount() > 0 && $this->Modified = true);
            }
            return false;
        }
        if (is_array($this->WorkingData)) {
            $this->WorkingData = [];
            return $this->Modified = true;
        }
        return false;
    }
546273
public static function flushAll()
    {
        try {
            return static::getDb()->createCommand()->truncateTable(static::tableName())->execute();
        } catch (Exception $e) {
            if (YII_ENV_DEV) {
                throw $e;
            }
        }
    }
1114091
public function flush()
    {
        $this->initializeOnDemand();

        if ($this->cacheMapper->flush()) {
            // Reset the current state as well
            $this->cache = array();
            return true;
        } else {
            return false;
        }
    }
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;
	}
796837
public function stream_flush()
    {
        switch ($this->mode) {
            case 'r+':
            case 'rb+':
            case 'w':
            case 'wb':
            case 'w+':
            case 'wb+':
            case 'a':
            case 'ab':
            case 'a+':
            case 'ab+':
                $origPos = ftell($this->fd);
                fseek($this->fd, 0, SEEK_END);
                $size = ftell($this->fd);
                fseek($this->fd, 0, SEEK_SET);
                $contents = fread($this->fd, $size);
                fseek($this->fd, $origPos, SEEK_SET);
                self::cache()->set($this->path, $contents);
                break;
        }

        return true;
    }
741255
public function flush()
    {
        if (($files = $this->getCacheFiles()) === false) {
            return false;
        }

        $result = true;
        foreach ($files as $file) {
            $result = $result && @unlink($file);
        }
        return $result;
    }
628555
static public function flushRoutesCache()
    {
        $cachePath = Config::getCommon('router.cache_file');
        if (FileHelper::delete($cachePath)) {
            return ErrorInfo::success('flush routes cache success');
        } else {
            return ErrorInfo::error('flush routes cache fail, please check config[router.cache_file]');
        }
    }
128736
public function flush()
    {
        $this->cache->flush();

        return $this->database->table($this->config['db_table'])->truncate();
    }
832584
public function flush(): bool
    {
        $this->checkConnection(__METHOD__);
        $flush = $this->engine->flush();
        if ($flush && $this->index) {
            $this->index->events()->trigger(Indexing::EVENT_ON_FLUSH)
                ->fire();
        }

        return $flush;
    }