Skip to content
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

Add missing constants and function for Memcached #3873

Merged
merged 17 commits into from
Nov 10, 2024

Conversation

cracksalad
Copy link
Contributor

This PR...

  • adds 30 previously undocumented class constants (2 of which are new in v3.3.0)
  • adds 1 previously undocumented method
  • fixes some inconsistencies in constant documentation

References:

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.

Thank you! The markup looks okay (see comments below, though), but I don't know about the actual contents. Maybe @m6w6 can have a look?

reference/memcached/constants.xml Outdated Show resolved Hide resolved
reference/memcached/constants.xml Outdated Show resolved Hide resolved
@m6w6
Copy link
Contributor

m6w6 commented Oct 17, 2024

Awesome work, @cracksalad, thank you so much!

Comment on lines 126 to 131
<simpara>The <link xlink:href="&url.pecl.package;msgpack">MessagePack</link> serializer.</simpara>
<para>
This serializer is supported only if memcached is configured with
<literal>--enable-memcached-msgpack</literal> option and the
<literal>msgpack</literal> extension is loaded.
</para>
Copy link
Member

Choose a reason for hiding this comment

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

Just noticed that you sometimes use <simpara>, sometimes <para> and sometimes both in a <listitem> element. Please use always <simpara> there (unless <para> would be required, but I don't think this is the case here).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cmb69 When using

<simpara>foo</simpara>
<simpara>bar</simpara>

there is no line break in between.

In this specific example it would look like this (which in this case would not be a problem, but other cases would look worse):
grafik

Copy link
Member

Choose a reason for hiding this comment

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

Oh, indeed, for whatever reason a simpara inside a listitem is rendered as span:

https://github.com/php/phd/blob/8428f31cfd767cff36812108c79ff4b9b518edd4/phpdotnet/phd/Package/Generic/XHTML.php#L278-L284

Although DocBook says:

Processing expectations
Formatted as a displayed block.

Not sure what to do. Fixing PhD seems to be trivial, but might break some intentional rendering. @Girgias, @haszi, @jimwins, thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

I think <simpara> should be rendered as <p> and if that causes HTML layout problems when it is inside a <note>, <listitem>, or <entry>, we need to change the CSS styling so it looks how we want. Maybe we should make it <p class="simpara">.

(I would also be happy to see <simpara> just go away in favor of always using <para> because it seems rather pointless and probably some artifact of optimizing for old XML processing toolchains. But I haven't looked deeply at DocBook to see if there are places where you can only use <simpara> and not <para> that justify its existence.)

Copy link
Member

Choose a reason for hiding this comment

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

https://tdg.docbook.org/tdg/5.2/para:

A para is a paragraph. Paragraphs in DocBook may contain almost all inlines and most block elements.

The latter doesn't fit well with HTML's <p> element (what is currently used to render <para>). In my opinion, we should use <simpara> whenever suitable (i.e. when containing only inline elements), and only use <para> where necessary.

Copy link
Member

Choose a reason for hiding this comment

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

I can see 3 solutions to the problem here.

Mapping <simpara> to <p> except if it is in a <itemizedlist><listitem> or <orderedlist><listitem> sequence.
(this would cover the issue here where a <simpara> is used in a <listitem> in a <varlistentry>.

We convert those compact lists to <simplelist> tags.

We add a role="compact" on <itemizedlist>/<orderedlist> to change the processing inline (this might be annoying considering how PhD is implemented).

Copy link
Contributor

Choose a reason for hiding this comment

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

I think <simplelist> wouldn't make sense semantically as it is supposed to be "An undecorated list of single words or short phrases".

The implementation of the other two options would take about the same amount of effort but I'm in favor of the role="compact" on <itemizedlist>/<orderedlist> elements as this shows intent in the documentation and can directly be controlled from there instead of the special casing hack that would only be known to those few of us who were part of this conversation. :-)

Copy link
Member

Choose a reason for hiding this comment

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

Then let's do the role="compact" option. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How to proceed with this PR: Should I wait for the role="compact" change to be in place or should I change the paras to simparas right now?

Copy link
Member

Choose a reason for hiding this comment

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

I suggest to stick with you have for now. Changing to simpara would break the rendering, and waiting on role="compact" to be implemented might leave this important PR hanging around.

reference/memcached/constants.xml Outdated Show resolved Hide resolved
Comment on lines 126 to 131
<simpara>The <link xlink:href="&url.pecl.package;msgpack">MessagePack</link> serializer.</simpara>
<para>
This serializer is supported only if memcached is configured with
<literal>--enable-memcached-msgpack</literal> option and the
<literal>msgpack</literal> extension is loaded.
</para>
Copy link
Member

Choose a reason for hiding this comment

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

I can see 3 solutions to the problem here.

Mapping <simpara> to <p> except if it is in a <itemizedlist><listitem> or <orderedlist><listitem> sequence.
(this would cover the issue here where a <simpara> is used in a <listitem> in a <varlistentry>.

We convert those compact lists to <simplelist> tags.

We add a role="compact" on <itemizedlist>/<orderedlist> to change the processing inline (this might be annoying considering how PhD is implemented).

reference/memcached/memcached/setoption.xml Outdated Show resolved Hide resolved
<member><literal>Memcached::COMPRESSION_FASTLZ</literal> does not support compression levels.</member>
<member><literal>Memcached::COMPRESSION_ZSTD</literal>: minimum level is <literal>-22</literal> and maximum level is <literal>22</literal>.</member>
<member><literal>Memcached::COMPRESSION_ZLIB</literal>: minimum level is <literal>0</literal> and maximum level is <literal>9</literal>.</member>
</simplelist>
<para>Type: <type>int</type>, default: <literal>3</literal>.</para>
Copy link
Member

Choose a reason for hiding this comment

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

Just realizing that normally we put the type info in the <term> tag, but this is a follow-up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about the default values?
(1) Should they be moved to the <term> tag as well or
(2) would you describe them in a simpara kind of as is or
(3) should we move them to the setOption-method doc, cause constants do not really have defaults, or
(4) should we restructure the "Predefined Constants" site to have different sections (one for the OPT_* constants, one for option values, one for RES_* constants etc.) and maybe use a table for the OPT_* constants (as is for DateTime) where we could add a column for the defaults
(5) more differently...

Copy link
Member

Choose a reason for hiding this comment

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

I don't quite understand how a constant would have a default value. However, I agree with @Girgias that we can do that in a follow-up PR; this one is already very comprehensive.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't quite understand how a constant would have a default value.

It doesn't! But the constant is used as the "name" of an option which has a default. I think it is really important to document those defaults, but I am not sure where. Since you can think of the documentation of those constants as the documentation of the configuration options, it seems to be the right place.

Copy link
Member

Choose a reason for hiding this comment

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

The standard way to markup constant lists is with <variablelist>, but you can have multiple ones and even add a <title> tag to describe the grouping, look at streams/constants.xml for a rewrite that I recently did.

Tables are not great as they might not fit the width of the screen (e.g. mobile) and at present nearly all constant lists don't use tables.

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.

Please revert the markup changes for functions where the documentation did not change (effectively revert Remove unnecessary para tag wrapping variablelist tag for Memcached methods). Yes, the markup is not what I consider ideal, but no need to give unnecessary work to translations.

reference/memcached/memcached/construct.xml Outdated Show resolved Hide resolved
reference/memcached/memcached/setencodingkey.xml Outdated Show resolved Hide resolved
reference/memcached/memcached/setencodingkey.xml Outdated Show resolved Hide resolved
reference/memcached/memcached/setencodingkey.xml Outdated Show resolved Hide resolved
reference/memcached/memcached/setencodingkey.xml Outdated Show resolved Hide resolved
reference/memcached/memcached/setencodingkey.xml Outdated Show resolved Hide resolved
@cracksalad
Copy link
Contributor Author

Please revert the markup changes for functions where the documentation did not change (effectively revert Remove unnecessary para tag wrapping variablelist tag for Memcached methods). Yes, the markup is not what I consider ideal, but no need to give unnecessary work to translations.

But there were exactly 42 🎉 changed files, now there are only 5 left 😢

@cmb69
Copy link
Member

cmb69 commented Nov 9, 2024

@cracksalad, we try to distinguish between fixes/improvements to the documentation which affect all translations (beside EN, there are about 10 of these active), and changes which are likely only relevant for EN (such as whitespace changes, typo fixes etc.) The latter can be marked as skip-revcheck, so translators do not need to care about these.

The (now reverted) markup changes would have affected all translations; much work for a small gain. Still, we may consider to do these changes for EN in a separate PR; that is then still something which translators may skip at their own decision.

@cracksalad
Copy link
Contributor Author

@cmb69 I was just joking. 42 simply felt right 😂

So this skip-revcheck is a PR level marking, such that we have to at least do those changes in a different PR. Did I get that right?

@cmb69
Copy link
Member

cmb69 commented Nov 9, 2024

42 simply felt right

Ah, got it. :)

skip-revcheck is applied to individual commits, but it's simpler to have separate PRs (often we want to squash-merge commits).

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.

Some minor comments now, hopefully last round of reviews.

reference/memcached/memcached/addserver.xml Outdated Show resolved Hide resolved
reference/memcached/memcached/setoption.xml Outdated Show resolved Hide resolved
reference/memcached/memcached/setoption.xml Outdated Show resolved Hide resolved
@cracksalad cracksalad requested a review from Girgias November 9, 2024 15:51
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.

Okay, I clearly didn't properly go through the constant list.
Hopefully this is really the last one.

reference/memcached/constants.xml Outdated Show resolved Hide resolved
reference/memcached/constants.xml Outdated Show resolved Hide resolved
reference/memcached/constants.xml Outdated Show resolved Hide resolved
reference/memcached/constants.xml Show resolved Hide resolved
reference/memcached/constants.xml Show resolved Hide resolved
reference/memcached/constants.xml Outdated Show resolved Hide resolved
reference/memcached/constants.xml Outdated Show resolved Hide resolved
reference/memcached/constants.xml Outdated Show resolved Hide resolved
reference/memcached/constants.xml Outdated Show resolved Hide resolved
reference/memcached/constants.xml Outdated Show resolved Hide resolved
@Girgias
Copy link
Member

Girgias commented Nov 9, 2024

Also please rebase, as it now conflicts because of #4028

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.

Thank you!

reference/memcached/constants.xml Outdated Show resolved Hide resolved
reference/memcached/constants.xml Outdated Show resolved Hide resolved
reference/memcached/constants.xml Outdated Show resolved Hide resolved
reference/memcached/constants.xml Outdated Show resolved Hide resolved
reference/memcached/constants.xml Outdated Show resolved Hide resolved
@Girgias Girgias merged commit 7e6d80a into php:master Nov 10, 2024
2 checks passed
Ayesh added a commit that referenced this pull request Nov 10, 2024
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.

6 participants