-
Notifications
You must be signed in to change notification settings - Fork 12
Add memcache memoize support #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
tests/MemcacheTest.php
Outdated
| if (PHP_VERSION_ID < 80000) { | ||
| require_once 'MemcacheMockable.php'; | ||
| return $this->getMockBuilder(MemcacheMockable::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not thrilled with this but it was the only solution I could find to get the tests to pass across all versions of PHP we are currently testing against.
chadicus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion about cleaning up the php version check.
The TravisCI files should be unnecessary. Since we're using github actions for the build. We can remove TravisCI, coveralls and scrutinizer in a separate PR though.
.travis.yml
Outdated
| env: | ||
| - PREFER_LOWEST="--prefer-lowest --prefer-stable" | ||
| - PREFER_LOWEST="" | ||
| services: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be removed
.travis/memcache.ini
Outdated
| @@ -0,0 +1 @@ | |||
| extension=memcache.so | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file shouldn't be necessary since we're using github actions and not TravisCI for builds
.travis/memcached.ini
Outdated
| @@ -0,0 +1 @@ | |||
| extension=memcached.so | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file shouldn't be necessary since we're using github actions and not TravisCI for builds
tests/MemcacheTest.php
Outdated
| if (PHP_VERSION_ID < 80000) { | ||
| require_once 'MemcacheMockable.php'; | ||
| return $this->getMockBuilder(MemcacheMockable::class) | ||
| ->setMethods(['get', 'set'])->getMock(); | ||
| } else { | ||
| return $this->getMockBuilder(\Memcache::class)->setMethods(['get', 'set'])->getMock(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (PHP_VERSION_ID < 80000) { | |
| require_once 'MemcacheMockable.php'; | |
| return $this->getMockBuilder(MemcacheMockable::class) | |
| ->setMethods(['get', 'set'])->getMock(); | |
| } else { | |
| return $this->getMockBuilder(\Memcache::class)->setMethods(['get', 'set'])->getMock(); | |
| } | |
| $isOlderPHPVersion = PHP_VERSION_ID < 80000; | |
| $memcacheClass =$isOlderPHPVersion ? MemcacheMockable::class : Memcache::class; | |
| return $this->getMockBuilder(\Memcache::class)->setMethods(['get', 'set'])->getMock(); |
Just a suggestion to avoid the inline require_once call
What does this PR do?
Added support for caching results in Memcache
Checklist