So how do we use memcache on Frapi?

33 views
Skip to first unread message

Louie Miranda

unread,
Feb 5, 2013, 4:29:54 AM2/5/13
to frapi-...@googlegroups.com
Just want to ask, so how do we use memcache on Frapi?

Is it as easy as?

$this->cache = new Memcached();
        $this->cache->addServer('127.0.0.1', '11211');
        
$options = array(
              'servers' => array(
                  '127.0.0.1' => 11211
              )
          ); 
        $this->Frapi_Cache_Adapter_Memcached = new Frapi_Cache_Adapter_Memcached($options);


Trevor Morse

unread,
Feb 5, 2013, 8:04:44 AM2/5/13
to frapi-...@googlegroups.com
Hi Louie,

Are you looking to use memcached as the cache for the internal frapi
options or for your own use?

-tm
> --
> You received this message because you are subscribed to the Google Groups
> "frapi-general" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to frapi-genera...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Louie Miranda

unread,
Feb 5, 2013, 8:53:56 PM2/5/13
to frapi-...@googlegroups.com
Hi TM,

Correction, memcache.

I tried to add a __construct() on one of the controller so I can access it for all on that class.

function __construct() {

     $options = array(
'servers' => array(
'192.168.100.204' => 11211,
'192.168.100.218' => 11211,
'192.168.100.219' => 11211,
    )
);

$this->memcache = new Frapi_Cache_Adapter_Memcache($options);

$this->memcache->add('testcache', '123gotit');
echo "memcache:".$this->memcache->get('testcache');
}

It worked anyway, but was wondering if you guys could add like an AppController and AppModel, so we could declare everything there for global use.

Regards,
Louie

Trevor Morse

unread,
Feb 8, 2013, 7:59:34 AM2/8/13
to frapi-...@googlegroups.com
Louie,

Could you please create an issue in github for this?

Thanks!

-tm
Reply all
Reply to author
Forward
0 new messages