Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache interface fix #211

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 29 additions & 0 deletions lib/Doctrine/Common/Cache/Cache.php
Expand Up @@ -41,6 +41,21 @@ interface Cache
const STATS_MEMORY_USAGE = 'memory_usage'; const STATS_MEMORY_USAGE = 'memory_usage';
const STATS_MEMORY_AVAILIABLE = 'memory_available'; const STATS_MEMORY_AVAILIABLE = 'memory_available';


/**
* Set the namespace to prefix all cache ids with.
*
* @param string $namespace
* @return void
*/
function setNamespace($namespace);

/**
* Retrieve the namespace that prefixes all cache ids.
*
* @return string
*/
function getNamespace();

/** /**
* Fetches an entry from the cache. * Fetches an entry from the cache.
* *
Expand Down Expand Up @@ -75,6 +90,20 @@ function save($id, $data, $lifeTime = 0);
*/ */
function delete($id); function delete($id);


/**
* Delete all cache entries.
*
* @return boolean TRUE if the cache entries were successfully deleted, FALSE otherwise.
*/
function deleteAll();

/**
* Deletes all cache entries.
*
* @return boolean TRUE if the cache entries were successfully flushed, FALSE otherwise.
*/
function flushAll();

/** /**
* Retrieves cached information from data store * Retrieves cached information from data store
* *
Expand Down
17 changes: 4 additions & 13 deletions lib/Doctrine/Common/Cache/CacheProvider.php
Expand Up @@ -45,20 +45,15 @@ abstract class CacheProvider implements Cache
private $namespaceVersion; private $namespaceVersion;


/** /**
* Set the namespace to prefix all cache ids with. * {@inheritdoc}
*
* @param string $namespace
* @return void
*/ */
public function setNamespace($namespace) public function setNamespace($namespace)
{ {
$this->namespace = (string) $namespace; $this->namespace = (string) $namespace;
} }


/** /**
* Retrieve the namespace that prefixes all cache ids. * {@inheritdoc}
*
* @return string
*/ */
public function getNamespace() public function getNamespace()
{ {
Expand Down Expand Up @@ -106,19 +101,15 @@ public function getStats()
} }


/** /**
* Deletes all cache entries. * {@inheritdoc}
*
* @return boolean TRUE if the cache entries were successfully flushed, FALSE otherwise.
*/ */
public function flushAll() public function flushAll()
{ {
return $this->doFlush(); return $this->doFlush();
} }


/** /**
* Delete all cache entries. * {@inheritdoc}
*
* @return boolean TRUE if the cache entries were successfully deleted, FALSE otherwise.
*/ */
public function deleteAll() public function deleteAll()
{ {
Expand Down