Skip to content

Improve documentation of the Memcached delete methods #1957

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

Merged
merged 3 commits into from
Nov 15, 2022

Conversation

tstarling
Copy link
Contributor

  • Note that it's always an error to specify a non-zero time parameter, and delete the long-winded explanations of what it is meant to do.
  • Expand the description of the return value from deleteMulti().
  • Replace the incorrect description of the return value of deleteMultiByKey(). Use the one from deleteMulti() instead.
  • Explain what getResultCode() will return after deleteMulti().

* Note that it's always an error to specify a non-zero time parameter,
  and delete the long-winded explanations of what it is meant to do.
* Expand the description of the return value from deleteMulti().
* Replace the incorrect description of the return value of
  deleteMultiByKey(). Use the one from deleteMulti() instead.
* Explain what getResultCode() will return after deleteMulti().
Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

I cannot comment on memcached, so just a few nits.

<!ENTITY memcached.result.delete-multi '<para xmlns="http://docbook.org/ns/docbook">
Returns an array indexed by <parameter>keys</parameter>. Each element
is &true; if the corresponding key was deleted, or one of the
<constant>Memcached::RES_*</constant> constants if the corresponding deletion
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If #1963 will be merge, this should be:

Suggested change
<constant>Memcached::RES_*</constant> constants if the corresponding deletion
<constant><replaceable>Memcached::RES_*</replaceable></constant> constants if the corresponding deletion

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
<!ENTITY memcached.note.delete-time '<note xmlns="http://docbook.org/ns/docbook"><simpara>
As of memcached 1.3.0 (released 2009) this feature is no longer
supported. Passing a non-zero <parameter>time</parameter> will cause
libmemcached to raise an error.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know what sort of error is raised? Is it an exception an E_WARNING, an E_NOTICE something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, that is unclear, I will improve it. The library has its own error handling. $memcached->delete() will return false and $memcached->getResultCode() returns MEMCACHED_INVALID_ARGUMENTS. No PHP error is raised.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM the markup with replaceable constant is still undecided, so let's fix this at a later point.

@tstarling
Copy link
Contributor Author

Am I permitted to self-merge now that it has an approval?

@Girgias
Copy link
Member

Girgias commented Nov 15, 2022

Am I permitted to self-merge now that it has an approval?

Yes, sorry. The process here is for the most part to self merge, but if you don't want we can do it.

@tstarling tstarling merged commit af154fb into php:master Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants