-
Notifications
You must be signed in to change notification settings - Fork 1k
Added commands for the WordPress object cache #155
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
This commit adds commands for interacting with the WordPress object cache. For each public function in for the WordPress object cache, a corresponding command has been created. Additionally, a "which" command has been written that attempts to determine which 3rd party object cache the current installation is implementing.
|
This command should have a man page. See |
|
All of these suggestions are excellent! I will make the changes and submit new code. |
|
@scribu Made suggested changes. It looks like the commits were pulled over automatically. Please let me know if there is a different way that you want me to do the pull request. |
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.
Why are there two checks for Memcache PECL?
Also, shouldn't those ifs be elseifs?
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 mean like this:
if ( test for memcache ) {
...
} elseif ( test for APC ) {
...
} ...
|
There are 2 checks for different libraries that utilize memcached because there are 2 different WordPress memcached object cache backends: the original one by Ryan Boren (http://wordpress.org/extend/plugins/memcached/) that uses the memcache PECL extension, and a newer one my me (https://github.com/tollmanz/wordpress-memcached-backend) that uses the memached PECL extension (note the inclusion/exclusion of the "d"). These two memcached libraries are vastly different and I wanted to note which was being used. Ideally, it would be nice if the object cache had a way of identifying itself in WordPress, but since that doesn't yet happen, I am merely guessing at the possibilities. Good point about the if/elseif usage. I would normally return data after one of the conditions matched, but that does not work for this function and I should have altered my style a bit. I'll get a new commit in to fix that. |
|
Ok, thanks; didn't notice the 'd'. I think the " (Memcached PECL extension)" qualifier doesn't help either. It should just be "Memcache" or "Memcached". |
|
Fair enough...will do. |
Added commands for the WordPress object cache
|
I merged the pull request; thanks for that! I removed Besides, if you need to operate on a certain blog, you already have the |
This commit adds commands for interacting with the WordPress object cache. For each public function in the WordPress object cache, a corresponding command has been created. Additionally, a "which" command has been written that attempts to determine which 3rd party object cache the current installation is implementing.
These commands allow a user to add/set, get, delete, etc. cached objects. The commands give simple access to cached data that can sometimes be difficulty to access.