Skip to content

Instantly share code, notes, and snippets.

@phalcon
Created October 21, 2012 22:58
Show Gist options
  • Save phalcon/3928836 to your computer and use it in GitHub Desktop.
Save phalcon/3928836 to your computer and use it in GitHub Desktop.
<?php
//a developer wants to create its own cache backend
class MyOwnBackend implements Phalcon\Cache\BackendInterface
{
public function __construct($frontendObject, $backendOptions=array()){
}
public function get($keyName, $lifetime=null){
}
public function save($keyName=null, $content=null, $lifetime=null, $stopBuffer=true){
}
}
<?php
//this is provided by phalcon
namespace Phalcon\Cache\Backend;
class Mongo extends \Phalcon\Cache\Backend
#if not RELEASE
implements Phalcon\Cache\BackendInterface
#endif
{
public function __construct($frontendObject, $backendOptions=array()){
}
public function get($keyName, $lifetime=null){
}
public function save($keyName=null, $content=null, $lifetime=null, $stopBuffer=true){
}
}
<?php
//this is provided by phalcon
namespace Phalcon\Cache;
interface BackendInteface {
public function __construct($frontendObject, $backendOptions=array());
public function get($keyName, $lifetime=null);
public function save($keyName=null, $content=null, $lifetime=null, $stopBuffer=true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment