Permalink
Browse files

fixed caching to include the workspace name

  • Loading branch information...
lsmith77 committed Sep 19, 2012
1 parent b01c012 commit 5bedabf59573e9062d0bbabd2e346e39fb818ce5
@@ -124,13 +124,13 @@ public function getNode($path)
{
$this->assertLoggedIn();
- if (isset($this->caches['nodes']) && $result = $this->caches['nodes']->fetch("nodes: $path")) {
+ if (isset($this->caches['nodes']) && $result = $this->caches['nodes']->fetch("nodes: $path, ".$this->workspaceId)) {
return $result;
}
$node = parent::getNode($path);
if (isset($this->caches['nodes'])) {
- $this->caches['nodes']->save("nodes: $path", $node);
+ $this->caches['nodes']->save("nodes: $path, ".$this->workspaceId, $node);
}
return $node;
@@ -226,14 +226,14 @@ public function getNodePathForIdentifier($uuid)
{
$this->assertLoggedIn();
- if (isset($this->caches['nodes']) && $result = $this->caches['nodes']->fetch("nodes by uuid: $uuid")) {
+ if (isset($this->caches['nodes']) && $result = $this->caches['nodes']->fetch("nodes by uuid: $uuid, ".$this->workspaceId)) {
return $result;
}
$path = parent::getNodePathForIdentifier($uuid);
if (isset($this->caches['nodes'])) {
- $this->caches['nodes']->save("nodes by uuid: $uuid", $path);
+ $this->caches['nodes']->save("nodes by uuid: $uuid, ".$this->workspaceId, $path);
}
return $path;
@@ -298,14 +298,14 @@ public function unregisterNamespace($prefix)
*/
protected function getNodeReferences($path, $name = null, $weakReference = false)
{
- if (isset($this->caches['nodes']) && $result = $this->caches['nodes']->fetch("nodes references: $path, $name, $weakReference")) {
+ if (isset($this->caches['nodes']) && $result = $this->caches['nodes']->fetch("nodes references: $path, $name, $weakReference, ".$this->workspaceId)) {
return $result;
}
$references = parent::getNodeReferences($path, $name, $weakReference);
if (isset($this->caches['nodes'])) {
- $this->caches['nodes']->save("nodes references: $path, $name, $weakReference", $references);
+ $this->caches['nodes']->save("nodes references: $path, $name, $weakReference, ".$this->workspaceId, $references);
}
return $references;
@@ -70,7 +70,7 @@ class Client extends BaseTransport implements QueryTransport, WritingInterface,
/**
* @var int|string
*/
- private $workspaceId;
+ protected $workspaceId;
/**
* @var string

0 comments on commit 5bedabf

Please sign in to comment.