Welcome Guest, Not a member yet? Register   Sign In
Codeigniter Memcached support for SASL?
#1

Hi!
I'm looking to lock down my memcache server using SASL.
Does CodeIgniter support SASL for Memcache? I saw this in PHP https://www.php.net/manual/en/memcached....thdata.php but it doesn't seem it's widely available.
Reply
#2

(This post was last modified: 03-11-2024, 05:44 PM by kenjis.)

(03-11-2024, 12:26 PM)CIDave Wrote: Hi!
Does CodeIgniter support SASL for Memcache?

No, not yet.
See https://codeigniter4.github.io/CodeIgnit...ed-caching
No settings for that.
Reply
#3

(This post was last modified: 03-12-2024, 03:59 AM by CIDave.)

(03-11-2024, 05:43 PM)kenjis Wrote:
(03-11-2024, 12:26 PM)CIDave Wrote: Hi!
Does CodeIgniter support SASL for Memcache?

No, not yet.
See https://codeigniter4.github.io/CodeIgnit...ed-caching
No settings for that.

Not sure if you can help me but...

I modified the CI MemcachedHandler to include the setSaslAuthData method and authentication worked. I needed to also set Raw data to true in order to turn activate this.

But now, when I use the Cache library's get() method, it throws an error:

Quote:Undefined array key 0
Code:
return is_array($data) ? $data[0] : $data;

SYSTEMPATH/Cache/Handlers/MemcachedHandler.php at line 175
When I do a var_dump($data) I can see it is getting my cached results. But because I store my data as an array in the cache, it seems to overwrite the keys of $data.

I.e. I'm doing:

PHP Code:
$this->cache->save($this->hash_key, array("content" => $html"otherData" => 1234"stuff" => 1), $this->defaultCacheTime); 

If I disable the setSaslAuthData method it seems to work okay again. Not sure what is causing this issue.

Also, I noticed that a get() request is being made by System/CodeIgniter.php on every page for a cached file. Anyway to disable this?

PHP Code:
if (($response $this->displayCache($cacheConfig)) instanceof ResponseInterface) { 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB