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

Adds Ini_set documentation #1730

Merged
merged 5 commits into from Nov 6, 2019
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 36 additions & 0 deletions WordPress/Docs/PHP/IniSetStandard.xml
@@ -0,0 +1,36 @@
<documentation title="Detect incorrect use of the `ini_set()` function.">
NielsdeBlaauw marked this conversation as resolved.
Show resolved Hide resolved
<standard>
<![CDATA[
Using ini_set() for alternating PHP settings, as well as other functions with ability to change configuration at runtime of your scripts is discouraged. Changing runtime configuration might break other plugins and themes.
NielsdeBlaauw marked this conversation as resolved.
Show resolved Hide resolved
]]>
</standard>
<code_comparison>
<code title="Valid: ini_set() for a possibly breaking setting.">
<![CDATA[
// ini_set() should not be used.
]]>
</code>
<code title="Invalid: ini_set() for a possibly breaking setting.">
<![CDATA[
ini_set( 'short_open_tag', 'off' );
]]>
</code>
</code_comparison>
<standard>
<![CDATA[
For some configuration values there are WordPress functions. These are preferred.
NielsdeBlaauw marked this conversation as resolved.
Show resolved Hide resolved
]]>
</standard>
<code_comparison>
<code title="Valid: WordPress functional alternative.">
<![CDATA[
wp_raise_memory_limit();
]]>
</code>
<code title="Invalid: ini_set() to alter memory limits.">
<![CDATA[
ini_set( 'memory_limit', '256M' );
]]>
</code>
</code_comparison>
</documentation>