Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Symfony/Component/Cache/Adapter/ApcuAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ protected function doHave($id)
*/
protected function doClear($namespace)
{
return apcu_clear_cache();
return isset($namespace[0]) && class_exists('APCuIterator', false)
? apcu_delete(new \APCuIterator(sprintf('/^%s/', preg_quote($namespace, '/')), APC_ITER_KEY))
: apcu_clear_cache();
}

/**
Expand Down
9 changes: 7 additions & 2 deletions src/Symfony/Component/Cache/Adapter/DoctrineAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ class DoctrineAdapter extends AbstractAdapter

public function __construct(CacheProvider $provider, $defaultLifetime = 0, $namespace = '')
{
parent::__construct($namespace, $defaultLifetime);
parent::__construct('', $defaultLifetime);
$this->provider = $provider;
$provider->setNamespace($namespace);
}

/**
Expand All @@ -47,7 +48,11 @@ protected function doHave($id)
*/
protected function doClear($namespace)
{
return $this->provider->flushAll();
$namespace = $this->provider->getNamespace();

return isset($namespace[0])
? $this->provider->deleteAll()
: $this->provider->flushAll();
}

/**
Expand Down