Skip to content

Commit

Permalink
Replace PHP_INI_ with INI_ constants
Browse files Browse the repository at this point in the history
  • Loading branch information
haszi committed Jan 27, 2024
1 parent 6922244 commit d8deee5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions RFC/skeletons/ini.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
<row>
<entry>theini_option</entry>
<entry>itsvalue</entry>
<entry>its PHP_INI_* value</entry>
<entry>its INI_* value</entry>
<entry>version changes information</entry>
</row>
<row>
<entry>anotherini_option</entry>
<entry>itsvalue</entry>
<entry>its PHP_INI_* value</entry>
<entry>its INI_* value</entry>
<entry></entry>
</row>
</tbody>
Expand All @@ -37,9 +37,9 @@
&ini.php.constants;

</para>

&ini.descriptions.title;

<para>
<variablelist>

Expand Down
8 changes: 4 additions & 4 deletions scripts/docgen/docgen.php
Original file line number Diff line number Diff line change
Expand Up @@ -678,10 +678,10 @@ function gen_extension_markup(ReflectionExtension $obj, $content, $xml_file) { /
if ($ini = ini_get_all($obj->name)) {

$visibility = array(
INI_USER => 'PHP_INI_USER',
INI_PERDIR => 'PHP_INI_PERDIR',
INI_SYSTEM => 'PHP_INI_SYSTEM',
INI_ALL => 'PHP_INI_ALL',
INI_USER => 'INI_USER',
INI_PERDIR => 'INI_PERDIR',
INI_SYSTEM => 'INI_SYSTEM',
INI_ALL => 'INI_ALL',
);

$ident = get_ident_size('INI_ENTRIES', $content);
Expand Down
22 changes: 11 additions & 11 deletions scripts/genPHP_INI_ENTRY.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
$legend = <<<LEGEND
<para>
Read the manual section on <link linkend="configuration">
Configurations</link> for more information in regards to setting
PHP configurations. The <literal>PHP_INI_*</literal>
<link linkend="language.constants">constants</link> used in the
Configurations</link> for more information in regards to setting
PHP configurations. The <literal>INI_*</literal>
<link linkend="language.constants">constants</link> used in the
table below are defined as follows:
</para>
<para>
Expand All @@ -83,23 +83,23 @@
</thead>
<tbody>
<row>
<entry><constant>PHP_INI_USER</constant></entry>
<entry><constant>INI_USER</constant></entry>
<entry>1</entry>
<entry>Entry can be set in user scripts</entry>
</row>
<row>
<entry><constant>PHP_INI_PERDIR</constant></entry>
<entry><constant>INI_PERDIR</constant></entry>
<entry>2</entry>
<entry>Entry can be set in <filename>.htaccess</filename></entry>
</row>
<row>
<entry><constant>PHP_INI_SYSTEM</constant></entry>
<entry><constant>INI_SYSTEM</constant></entry>
<entry>4</entry>
<entry>Entry can be set in <filename>php.ini</filename> or
<filename>httpd.conf</filename></entry>
</row>
<row>
<entry><constant>PHP_INI_ALL</constant></entry>
<entry><constant>INI_ALL</constant></entry>
<entry>7</entry>
<entry>Entry can be set anywhere</entry>
</row>
Expand Down Expand Up @@ -192,7 +192,7 @@ function findINI($fname) {/*{{{*/
continue;
}
$found['INI'][$entry[1]] = array(
'def' => $entry[2],
'def' => $entry[2],
'mod' => str_replace(array(' ', "\n","\r","\t"),'',$entry[3])
);
}
Expand All @@ -218,7 +218,7 @@ function flatentree($tree, $section) {/*{{{*/

function createINI($dir, $cfgs) {/*{{{*/
global $master_ini_table;

if (empty($cfgs)) {
return false;
}
Expand Down Expand Up @@ -252,7 +252,7 @@ function createINI($dir, $cfgs) {/*{{{*/
$rows .= " </row>\n";
}
$master_ini_table .= $rows;

if ($dir == 'en/chapters') {
$id = 'general';
} else {
Expand Down Expand Up @@ -284,7 +284,7 @@ function createMasterINI ($dir, $rows) {/*{{{*/
fflush($fp);
fclose($fp);
echo "CREATED {$GLOBALS['phpdoc_dir']}/{$dir}/config.master_test.xml\n";
}
}
} /*}}}*/

// Set the PHP4 and the PHPDOC source dirs
Expand Down
18 changes: 9 additions & 9 deletions scripts/mk_ini_set_table.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
# Author: Jesus M. Castagnetto
# Created: Mon Mar 19 04:57:02 PST 2001
# Updated: Thu Apr 25 11:42:26 PDT 2002
# - look through all PHP_INI_ containing files
# - look through all INI_ containing files
# - save table in the new split dir for the function
# Updated: Wed Nov 20 18:16:12 PST 2002
# - rearrange the order of the tables, put the PHP_INI_* definitions first.
# - rearrange the order of the tables, put the INI_* definitions first.

cfiles=`grep -rl PHP_INI_ ../php4/*`
cfiles=`grep -rl INI_ ../php4/*`
ini_set_table="en/reference/info/functions/ini_set_table";

awk 'BEGIN {
print "<note>";
print " <para>";
print " The PHP_INI_* constants used in the table below are defined as follows:";
print " The INI_* constants used in the table below are defined as follows:";
print " <table>";
print " <thead>";
print " <row>";
Expand All @@ -28,23 +28,23 @@ awk 'BEGIN {
print " </thead>";
print " <tbody>";
print " <row>";
print " <entry>PHP_INI_USER</entry>";
print " <entry>INI_USER</entry>";
print " <entry>1</entry>";
print " <entry>Entry can be set in user scripts</entry>";
print " </row>";
print " <row>";
print " <entry>PHP_INI_PERDIR</entry>";
print " <entry>INI_PERDIR</entry>";
print " <entry>2</entry>";
print " <entry>Entry can be set in <filename>.htaccess</filename></entry>";
print " </row>";
print " <row>";
print " <entry>PHP_INI_SYSTEM</entry>";
print " <entry>INI_SYSTEM</entry>";
print " <entry>4</entry>";
print " <entry>Entry can be set in <filename>php.ini</filename> or";
print " <filename>httpd.conf</filename></entry>";
print " </row>";
print " <row>";
print " <entry>PHP_INI_ALL</entry>";
print " <entry>INI_ALL</entry>";
print " <entry>7</entry>";
print " <entry>Entry can be set anywhere</entry>";
print " </row>";
Expand All @@ -63,7 +63,7 @@ awk 'BEGIN {
print " </thead>";
print " <tbody>";
}
$0 ~ /PHP_INI_.*\(/ && $0 !~ /^static/ && $0 !~ /PHP_INI_(BEGIN|END)/ {
$0 ~ /INI_.*\(/ && $0 !~ /^static/ && $0 !~ /INI_(BEGIN|END)/ {
nf = split($0,tmp,",");
varname = substr(tmp[1], index(tmp[1], "\""));
Expand Down

0 comments on commit d8deee5

Please sign in to comment.