0

We have an old PHP application that we're porting to PHP 7. We would like to move away from the memcache extension, and start using the memcached extension.

However -- we have a lot of legacy code written against the memcache APIs and memcached extension is not a drop in replacement.

Is there any known science for dealing with this? A shim library between the two? Auto conversation tools? Something we're not thinking of?

4
  • 1
    I'd try to find a polyfill, and if it does not exist - it should not be too complicated to implement it. PS: I'm sure this question would be closed as "offtopic: library recommendation"
    – zerkms
    Nov 30, 2018 at 0:47
  • The proper solution would be to implement abstractions in your code so that it doesn't matter if you're using one or the other, or Redis, or literally anything else. Simply shimming between two flavors of Memcache extension would be a waste of effort. php-cache is a solid bet for this.
    – Sammitch
    Nov 30, 2018 at 1:00
  • Thanks @zerkms -- you say polyfill, I say shim library :) I'm hoping the question stays open -- while an existing shim/polyfill is one solution, there may be others, and I'm hoping the question will be received in that spirit. Nov 30, 2018 at 1:41
  • @Sammitch Useful information, thank you. In a world not contained by people's time I'd be right there with you. Nov 30, 2018 at 1:42

1 Answer 1

1

Here is a shim/polyfill library for this problem...

https://github.com/mhawker/memcacheshim

It contains guidance and warnings - but looks like a great option if you are trying to get legacy systems ported without a significant cache layer re-write.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.