Skip to content
Merged
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
89 changes: 89 additions & 0 deletions core/Cache/ReadOnlyPeer.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php
/***************************************************************************
* Copyright (C) 2011 by Alexander A. Klestov *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation; either version 3 of the *
* License, or (at your option) any later version. *
* *
***************************************************************************/

/**
* Cache with read-only access.
*
* @ingroup Cache
**/
final class ReadOnlyPeer extends CachePeer
{
/**
* @var CachePeer
*/
private $innerPeer = null;

/**
* @return ReadOnlyPeer
*/
public static function create(CachePeer $peer)
{
return new ReadOnlyPeer($peer);
}

public function __construct(CachePeer $peer)
{
$this->innerPeer = $peer;
}

public function isAlive()
{
return $this->innerPeer->isAlive();
}

public function mark($className)
{
return $this->innerPeer->mark($className);
}

public function get($key)
{
return $this->innerPeer->get($key);
}

public function getList($indexes)
{
return $this->innerPeer->getList($indexes);
}

public function clean()
{
throw new UnsupportedMethodException();
}

public function increment($key, $value)
{
throw new UnsupportedMethodException();
}

public function decrement($key, $value)
{
throw new UnsupportedMethodException();
}

public function delete($index, $time = null)
{
throw new UnsupportedMethodException();
}

public function append($key, $data)
{
throw new UnsupportedMethodException();
}

protected function store(
$method, $index, $value, $expires = Cache::EXPIRES_MINIMUM
)
{
throw new UnsupportedMethodException();
}
}
?>