File: mk_ini_set_table.sh

package info (click to toggle)
php-doc 20100521-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 59,992 kB
  • ctags: 4,085
  • sloc: xml: 796,833; php: 21,338; cpp: 500; sh: 117; makefile: 58; awk: 28
file content (92 lines) | stat: -rwxr-xr-x 2,682 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#! /bin/sh

# Quick hack to make a table of PHP options
# and where they can be changed
# Uses GNU grep and GNU awk
# 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
# - 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.

cfiles=`grep -rl PHP_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 "  <table>";
	print "   <thead>";
	print "    <row>";
	print "     <entry>Constant</entry>";
	print "     <entry>Value</entry>";
	print "     <entry>Meaning</entry>";
	print "    </row>";
	print "   </thead>";
	print "   <tbody>";
	print "    <row>";
	print "     <entry>PHP_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>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>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>7</entry>";
	print "     <entry>Entry can be set anywhere</entry>";
	print "    </row>";
	print "   </tbody>";
	print "  </table>";
	print " </para>";
	print "</note>";
	print "<table>\n <title>Configuration options</title>"
	print " <tgroup cols=\"3\">";
	print "  <thead>";
	print "   <row>";
	print "    <entry>Name</entry>";
	print "    <entry>Default</entry>";
	print "    <entry>Changeable</entry>";
	print "   </row>";
	print "  </thead>";
	print "  <tbody>";
}
$0 ~ /PHP_INI_.*\(/ && $0 !~ /^static/ && $0 !~ /PHP_INI_(BEGIN|END)/ {
nf = split($0,tmp,",");

varname = substr(tmp[1], index(tmp[1], "\""));
gsub("\"", "", varname);

vardef = tmp[2];
gsub("(\t| )+", "", vardef);
#if (index(vardef, "\""))
#	gsub("\"", "", vardef);

varmod = tmp[3];
gsub("(\t| )+", "", varmod);

print "    <row>";
print "     <entry>" varname "</entry>"
print "     <entry>" vardef "</entry>"
print "     <entry>" varmod "</entry>"
print "    </row>";
};
END {
	print "  </tbody>";
	print " </tgroup>";
	print "</table>";
	}' $cfiles > $ini_set_table

ls -l $ini_set_table