V
V
Vladislav2016-08-30 14:12:35
symfony
Vladislav, 2016-08-30 14:12:35

Why does flushAll in symfony 3 return true?

Connected DoctrineCacheBundle()
Added in settings:

# app/config/config.yml
doctrine:
    orm:
        result_cache_driver:
            type: memcache
            host: localhost
            port: 11211
            instance_class: Memcache
doctrine_cache:
    providers:
        memcache:
            type: memcache
            aliases:
                - memcache

I'm trying to get data in the controller
$memcache = $this->container->get('memcache');
$data = $memcache->flushAll();

For some reason, true comes to $data. Why is that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BoShurik, 2016-08-30
@MrBikus

This method saves all data instead of getting it

/**
  * Flushes all cache entries.
  *
  * @return bool TRUE if the cache entries were successfully flushed, FALSE otherwise.
  */
public function flushAll()

It is impossible to get all the data from the cache. Access is by key only.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question