cvs: phpdoc / configure.in /en language-defs.ent /en/appendices reserved.xml /en/language constants.xml variables.xml

From: Date: Tue, 12 Mar 2002 00:57:47 +0000
Subject: cvs: phpdoc / configure.in /en language-defs.ent /en/appendices reserved.xml /en/language constants.xml variables.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969342958@lists.php.net to get a copy of this message
torben Mon Mar 11 19:57:47 2002 EDT Modified files: /phpdoc configure.in /phpdoc/en language-defs.ent /phpdoc/en/appendices reserved.xml /phpdoc/en/language constants.xml variables.xml Log: Initial commit for by-extension separation of the full constant list.

Index: phpdoc/configure.in diff -u phpdoc/configure.in:1.143 phpdoc/configure.in:1.144 --- phpdoc/configure.in:1.143 Sun Feb 24 06:04:22 2002 +++ phpdoc/configure.in Mon Mar 11 19:57:46 2002 @@ -1,4 +1,4 @@ -dnl $Id: configure.in,v 1.143 2002/02/24 11:04:22 goba Exp $ +dnl $Id: configure.in,v 1.144 2002/03/12 00:57:46 torben Exp $ dnl autoconf initialisation AC_INIT() @@ -771,6 +771,9 @@ echo >> entities/chapters.ent echo " Using the install part from installpart.xml" fi +echo "<!-- Separated list of predefined constants. -->" >> entities/chapters.ent +echo "<!ENTITY appendices.reserved.constants SYSTEM 'reserved.constants.xml'>" >> entities/chapters.ent +echo >> entities/chapters.ent for file in `find $srcdir/en -name "*.xml" | sed -e"s%^$srcdir\/en\/%%g" | sort` do name=`echo $file | sed -e"s/\//./g" -e"s/.xml$//g" -e "s/_/-/g"` Index: phpdoc/en/language-defs.ent diff -u phpdoc/en/language-defs.ent:1.11 phpdoc/en/language-defs.ent:1.12 --- phpdoc/en/language-defs.ent:1.11 Tue Feb 5 09:39:18 2002 +++ phpdoc/en/language-defs.ent Mon Mar 11 19:57:46 2002 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <!ENTITY PHPManual "PHP Manual"> <!ENTITY Date "Date:"> @@ -13,3 +13,4 @@ <!ENTITY FAQabbrev "FAQ"> <!ENTITY FunctionIndex "Function Index"> <!ENTITY CHMEdition "HTML Help Edition"> +<!ENTITY ReservedConstants "Predefined Constants"> Index: phpdoc/en/appendices/reserved.xml diff -u phpdoc/en/appendices/reserved.xml:1.14 phpdoc/en/appendices/reserved.xml:1.15 --- phpdoc/en/appendices/reserved.xml:1.14 Sat Jan 19 02:23:49 2002 +++ phpdoc/en/appendices/reserved.xml Mon Mar 11 19:57:46 2002 @@ -1,230 +1,1057 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.14 $ --> -<appendix id="reserved"> - <title>List of Reserved Words</title> - <para> - Here is the list of PHP reserved words, usually - <link linkend="language.constants">constants</link> and - <link linkend="language.variables.predefined">predefined variables</link>. - You won't find any functions here, but rather language constructs. - You shouldn't try to use such names as variable, function, constant or - method names, as it will surely lead to confusion. - <simplelist columns="3"> - <member> - <link linkend="language.operators.logical">and</link> - </member> - <member> - <link linkend="language.variables.predefined.php">$argv</link> - </member> - <member> - <link linkend="control-structures.foreach">as</link> - </member> - <member> - <link linkend="language.variables.predefined.php">$argc</link> - </member> - <member> - <link linkend="control-structures.break">break</link> - </member> - <member> - <link linkend="control-structures.switch">case</link> - </member> - <member> - <link linkend="functions.old-syntax">cfunction</link> - </member> - <member> - <link linkend="keyword.class">class</link> - </member> - <member> - <link linkend="control-structures.continue">continue</link> - </member> - <member> - <link linkend="control-structures.declare">declare</link> - </member> - <member> - <link linkend="control-structures.switch">default</link> - </member> - <member> - <link linkend="control-structures.do.while">do</link> - </member> - <member> - <function>die</function> - </member> - <member> - <function>echo</function> - </member> - <member> - <link linkend="control-structures.else">else</link> - </member> - <member> - <link linkend="control-structures.elseif">elseif</link> - </member> - <member> - <function>empty</function> - </member> - <member> - <link linkend="control-structures.declare">enddeclare</link> - </member> - <member> - <link linkend="control-structures.alternative-syntax">endfor</link> - </member> - <member> - <link linkend="control-structures.alternative-syntax">endforeach</link> - </member> - <member> - <link linkend="control-structures.alternative-syntax">endif</link> - </member> - <member> - <link linkend="control-structures.alternative-syntax">endswitch</link> - </member> - <member> - <link linkend="control-structures.alternative-syntax">endwhile</link> - </member> - <member> - <link linkend="language.constants">E_ALL</link> - </member> - <member> - <link linkend="language.constants">E_PARSE</link> - </member> - <member> - <link linkend="language.constants">E_ERROR</link> - </member> - <member> - <link linkend="language.constants">E_WARNING</link> - </member> - <member> - <link linkend="function.eval">eval</link> - </member> - <member> - <function>exit</function> - </member> - <member> - <link linkend="keyword.class">extends</link> - </member> - <member> - <link linkend="language.constants">&false;</link> - </member> - <member> - <link linkend="control-structures.for">for</link> - </member> - <member> - <link linkend="control-structures.foreach">foreach</link> - </member> - <member> - <link linkend="functions.user-defined">function</link> - </member> - <member> - <link linkend="language.variables.predefined.php">$HTTP_COOKIE_VARS</link> - </member> - <member> - <link linkend="language.variables.predefined.php">$HTTP_GET_VARS</link> - </member> - <member> - <link linkend="language.variables.predefined.php">$HTTP_POST_VARS</link> - </member> - <member> - <link linkend="language.variables.predefined.php">$HTTP_POST_FILES</link> - </member> - <member> - <link linkend="language.variables.predefined.php">$HTTP_ENV_VARS</link> - </member> - <member> - <link linkend="language.variables.predefined.php">$HTTP_SERVER_VARS</link> - </member> - <member> - <link linkend="control-structures.if">if</link> - </member> - <member> - <function>include</function> - </member> - <member> - <function>include_once</function> - </member> - <member> - <link linkend="language.variables.scope">global</link> - </member> - <member> - <function>list</function> - </member> - <member> - <link linkend="keyword.class">new</link> - </member> - <member> - <link linkend="language.operators.logical">not</link> - </member> - <member> - <link linkend="language.constants.predefined">NULL</link> - </member> - <member> - <link linkend="functions.old-syntax">old_function</link> - </member> - <member> - <link linkend="language.operators.logical">or</link> - </member> - <member> - <link linkend="keyword.parent">parent</link> - </member> - <member> - <link linkend="language.constants">PHP_OS</link> - </member> - <member> - <link linkend="language.variables.predefined.php">$PHP_SELF</link> - </member> - <member> - <link linkend="language.constants">PHP_VERSION</link> - </member> - <member> - <function>print</function> - </member> - <member> - <function>require</function> - </member> - <member> - <function>require_once</function> - </member> - <member> - <function>return</function> - </member> - <member> - <link linkend="language.variables.scope">static</link> - </member> - <member> - <link linkend="control-structures.switch">switch</link> - </member> - <member> - <link linkend="keyword.class">stdClass</link> - </member> - <member> - <link linkend="keyword.class">$this</link> - </member> - <member> - <link linkend="language.constants">&true;</link> - </member> - <member> - <link linkend="keyword.class">var</link> - </member> - <member> - <link linkend="language.operators.logical">xor</link> - </member> - <member> - <function>virtual</function> - </member> - <member> - <link linkend="control-structures.while">while</link> - </member> - <member> - <link linkend="language.constants">__FILE__</link> - </member> - <member> - <link linkend="language.constants">__LINE__</link> - </member> - <member> - <link linkend="language.oop.magic-functions">__sleep</link> - </member> - <member> - <link linkend="language.oop.magic-functions">__wakeup</link> - </member> - </simplelist> - </para> +<!-- $Revision: 1.15 $ --> + +<!-- Note: Please do not link or translate this file yet. +This is only an initial update, quite a few more commits will +follow for this appendix. --> + + <appendix id="reserved"> + <title>List of Reserved Words</title> + <para> + The following is a listing of predefined identifiers in PHP. None + of the identifiers listed here should be used as identifiers in a + your scripts. These lists include keywords and predefined variable, + constant, and class names. These lists are neither exhaustive or + complete. + </para> + + <sect1 id="reserved.keywords"> + <title>List of Keywords</title> + <simpara> + These words have special meaning in PHP. Some of them represent things + which look like functions, some look like constants, and so on--but + they're not, really: they are language constructs. You cannot use any + of the following words as constants, class names, or function names. + Using them as variable names is generally OK, but could lead to confusion. + </simpara> + + <table> + <title>PHP Keywords</title> + <tgroup cols="4"> + <tbody> + <row> + <entry> + <link linkend="language.operators.logical">and</link> + </entry> + <entry> + <link linkend="language.operators.logical">or</link> + </entry> + <entry> + <link linkend="language.operators.logical">xor</link> + </entry> + <entry> + __FILE__ + </entry> + </row> + <row> + <entry> + __LINE__ + </entry> + <entry> + <function>array</function> + </entry> + <entry> + <link linkend="control-structures.foreach">as</link> + </entry> + <entry> + <link linkend="control-structures.break">break</link> + </entry> + <entry> + <link linkend="control-structures.switch">case</link> + </entry> + </row> + <row> + <entry> + <link linkend="functions.old-syntax">cfunction</link> + </entry> + <entry> + <link linkend="keyword.class">class</link> + </entry> + <entry> + const + </entry> + <entry> + <link linkend="control-structures.continue">continue</link> + </entry> + <entry> + <link linkend="control-structures.declare">declare</link> + </entry> + </row> + <row> + <entry> + <link linkend="control-structures.switch">default</link> + </entry> + <entry> + <function>die</function> + </entry> + <entry> + <link linkend="control-structures.do.while">do</link> + </entry> + <entry> + <function>echo</function> + </entry> + <entry> + <link linkend="control-structures.else">else</link> + </entry> + </row> + <row> + <entry> + <link linkend="control-structures.elseif">elseif</link> + </entry> + <entry> + <function>empty</function> + </entry> + <entry> + <link linkend="control-structures.declare">enddeclare</link> + </entry> + <entry> + <link linkend="control-structures.alternative-syntax">endfor</link> + </entry> + <entry> + <link linkend="control-structures.alternative-syntax">endforeach</link> + </entry> + </row> + <row> + <entry> + <link linkend="control-structures.alternative-syntax">endif</link> + </entry> + <entry> + <link linkend="control-structures.alternative-syntax">endswitch</link> + </entry> + <entry> + <link linkend="control-structures.alternative-syntax">endwhile</link> + </entry> + <entry> + <link linkend="function.eval">eval</link> + </entry> + <entry> + <function>exit</function> + </entry> + </row> + <row> + <entry> + <link linkend="keyword.class">extends</link> + </entry> + <entry> + <link linkend="control-structures.for">for</link> + </entry> + <entry> + <link linkend="control-structures.foreach">foreach</link> + </entry> + <entry> + <link linkend="functions.user-defined">function</link> + </entry> + <entry> + <link linkend="language.variables.scope">global</link> + </entry> + </row> + <row> + <entry> + <link linkend="control-structures.if">if</link> + </entry> + <entry> + <function>include</function> + </entry> + <entry> + <function>include_once</function> + </entry> + <entry> + <function>isset</function> + </entry> + <entry> + <function>list</function> + </entry> + </row> + <row> + <entry> + <link linkend="keyword.class">new</link> + </entry> + <entry> + <link linkend="functions.old-syntax">old_function</link> + </entry> + <entry> + <function>print</function> + </entry> + <entry> + <function>require</function> + </entry> + <entry> + <function>require_once</function> + </entry> + </row> + <row> + <entry> + <function>return</function> + </entry> + <entry> + <link linkend="language.variables.scope">static</link> + </entry> + <entry> + <link linkend="control-structures.switch">switch</link> + </entry> + <entry> + <function>unset</function> + </entry> + <entry> + use + </entry> + </row> + <row> + <entry> + <link linkend="keyword.class">var</link> + </entry> + <entry> + <link linkend="control-structures.while">while</link> + </entry> + </row> + </tbody> + </tgroup> + </table> + </sect1> + + <sect1 id="reserved.variables"> + <title>Predefined Variables</title> + + <sect2 id="reserved.variables.server"> + <title>Server variables: <varname>$_SERVER</varname></title> + <note> + <simpara> + Introduced in 4.1.0. In earlier versions, use + <varname>$HTTP_SERVER_VARS</varname>. + </simpara> + </note> + + <simpara> + <varname>$_SERVER</varname> is an array containing information + such as headers, paths, and script locations. The entries in this + array are created by the webserver. There is no guarantee that + every webserver will provide any of these; servers may omit some, + or provide others not listed here. That said, a large number of + these variables are accounted for in the <ulink + url="&url.cgispec;">CGI 1.1 specification</ulink>, so you should + be able to expect those. + </simpara> + + <simpara> + This is a 'superglobal', or automatic global, variable. This + simply means that it is available in all scopes throughout a + script. You don't need to do a <command>global + $_SERVER;</command> to access it within functions or methods, as + you do with <varname>$HTTP_SERVER_VARS</varname>. + </simpara> + + <simpara> + <varname>$HTTP_SERVER_VARS</varname> contains the same + information, but is not an autoglobal. + </simpara> + + <simpara> + If the <link + linkend="ini.register-globals">register_globals</link> directive + is set, then these variables will also be made available in the + global scope of the script; i.e., separate from the + <varname>$_SERVER</varname> and <varname>$HTTP_SERVER_VARS</varname> + arrays. For related information, see the security chapter titled + <link linkend="security.registerglobals">Using Register + Globals</link>. These individual globals are not autoglobals. + </simpara> + + <simpara> + You may or may not find any of the following elements in + $_SERVER. Note that few, if any, of these will be available (or + indeed have any meaning) if running PHP on the command line. + </simpara> + + <para> + <variablelist> + <varlistentry> + <term>'<varname>GATEWAY_INTERFACE</varname>'</term> + <listitem> + <simpara> + What revision of the CGI specification the server is using; + i.e. 'CGI/1.1'. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>SERVER_NAME</varname>'</term> + <listitem> + <simpara> + The name of the server host under which the current script is + executing. If the script is running on a virtual host, this + will be the value defined for that virtual host. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>SERVER_SOFTWARE</varname>'</term> + <listitem> + <simpara> + Server identification string, given in the headers when + responding to requests. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>SERVER_PROTOCOL</varname>'</term> + <listitem> + <simpara> + Name and revision of the information protocol via which the + page was requested; i.e. 'HTTP/1.0'; + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>REQUEST_METHOD</varname>'</term> + <listitem> + <simpara> + Which request method was used to access the page; i.e. 'GET', + 'HEAD', 'POST', 'PUT'. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>QUERY_STRING</varname>'</term> + <listitem> + <simpara> + The query string, if any, via which the page was accessed. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>DOCUMENT_ROOT</varname>'</term> + <listitem> + <simpara> + The document root directory under which the current script is + executing, as defined in the server's configuration file. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>HTTP_ACCEPT</varname>'</term> + <listitem> + <simpara> + Contents of the <literal>Accept:</literal> header from the + current request, if there is one. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>HTTP_ACCEPT_CHARSET</varname>'</term> + <listitem> + <simpara> + Contents of the <literal>Accept-Charset:</literal> header + from the current request, if there is one. Example: + 'iso-8859-1,*,utf-8'. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>HTTP_ACCEPT_ENCODING</varname>'</term> + <listitem> + <simpara> + Contents of the <literal>Accept-Encoding:</literal> header + from the current request, if there is one. Example: 'gzip'. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>HTTP_ACCEPT_LANGUAGE</varname>'</term> + <listitem> + <simpara> + Contents of the <literal>Accept-Language:</literal> header + from the current request, if there is one. Example: 'en'. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>HTTP_CONNECTION</varname>'</term> + <listitem> + <simpara> + Contents of the <literal>Connection:</literal> header from + the current request, if there is one. Example: 'Keep-Alive'. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>HTTP_HOST</varname>'</term> + <listitem> + <simpara> + Contents of the <literal>Host:</literal> header from the + current request, if there is one. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>HTTP_REFERER</varname>'</term> + <listitem> + <simpara> + The address of the page (if any) which referred the user + agent to the current page. This is set by the user agent. Not + all user agents will set this, and some provide the ability + to modify <varname>HTTP_REFERER</varname> as a feature. In + short, it cannot really be trusted. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>HTTP_USER_AGENT</varname>'</term> + <listitem> + <simpara> + Contents of the <literal>User_Agent:</literal> header from + the current request, if there is one. This is a string + denoting the user agent being which is accessing the page. A + typical example is: <computeroutput>Mozilla/4.5 [en] (X11; U; + Linux 2.2.9 i586)</computeroutput>. Among other things, you + can use this value with <function>get_browser</function> to + tailor your page's output to the capabilities of the user + agent. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>REMOTE_ADDR</varname>'</term> + <listitem> + <simpara> + The IP address from which the user is viewing the current + page. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>REMOTE_PORT</varname>'</term> + <listitem> + <simpara> + The port being used on the user's machine to communicate with + the web server. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>SCRIPT_FILENAME</varname>'</term> + <listitem> + <simpara> + The absolute pathname of the currently executing script. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>SERVER_ADMIN</varname>'</term> + <listitem> + <simpara> + The value given to the SERVER_ADMIN (for Apache) directive in + the web server configuration file. If the script is running + on a virtual host, this will be the value defined for that + virtual host. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>SERVER_PORT</varname>'</term> + <listitem> + <simpara> + The port on the server machine being used by the web server + for communication. For default setups, this will be '80'; + using SSL, for instance, will change this to whatever your + defined secure HTTP port is. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>SERVER_SIGNATURE</varname>'</term> + <listitem> + <simpara> + String containing the server version and virtual host name + which are added to server-generated pages, if enabled. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>PATH_TRANSLATED</varname>'</term> + <listitem> + <simpara> + Filesystem- (not document root-) based path to the current + script, after the server has done any virtual-to-real + mapping. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>SCRIPT_NAME</varname>'</term> + <listitem> + <simpara> + Contains the current script's path. This is useful for pages + which need to point to themselves. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>REQUEST_URI</varname>'</term> + <listitem> + <simpara> + The URI which was given in order to access this page; for + instance, '/index.html'. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>argv</varname>'</term> + <listitem> + <simpara> + Array of arguments passed to the script. When the script is + run on the command line, this gives C-style access to the + command line parameters. When called via the GET method, this + will contain the query string. + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>argc</varname>'</term> + <listitem> + <simpara> + Contains the number of command line parameters passed to the + script (if run on the command line). + </simpara> + </listitem> + </varlistentry> + + <varlistentry> + <term>'<varname>PHP_SELF</varname>'</term> + <listitem> + <simpara> + The filename of the currently executing script, relative to + the document root. If PHP is running as a command-line + processor, this variable is not available. + </simpara> + </listitem> + </varlistentry> + + </variablelist> + </para> + + </sect2> + + <sect2 id="reserved.variables.environment"> + <title>Environment variables: <varname>$_ENV</varname></title> + + <note> + <simpara> + Introduced in 4.1.0. In earlier versions, use + <varname>$HTTP_ENV_VARS</varname>. + </simpara> + </note> + + <simpara> + These variables are imported into PHP's global namespace from the + environment under which the PHP parser is running. Many are + provided by the shell under which PHP is running and different + systems are likely running different kinds of shells, a + definitive list is impossible. Please see your shell's + documentation for a list of defined environment variables. + </simpara> + + <simpara> + Other environment variables include the CGI variables, placed + there regardless of whether PHP is running as a server module or + CGI processor. + </simpara> + + <simpara> + This is a 'superglobal', or automatic global, variable. This + simply means that it is available in all scopes throughout a + script. You don't need to do a <command>global + $_ENV;</command> to access it within functions or methods, as + you do with <varname>$HTTP_ENV_VARS</varname>. + </simpara> + + <simpara> + <varname>$HTTP_ENV_VARS</varname> contains the same + information, but is not an autoglobal. + </simpara> + + <simpara> + If the <link + linkend="ini.register-globals">register_globals</link> directive + is set, then these variables will also be made available in the + global scope of the script; i.e., separate from the + <varname>$_ENV</varname> and <varname>$HTTP_ENV_VARS</varname> + arrays. For related information, see the security chapter titled + <link linkend="security.registerglobals">Using Register + Globals</link>. These individual globals are not autoglobals. + </simpara> + </sect2> + + <sect2 id="reserved.variables.cookies"> + <title>HTTP Cookies: <varname>$_COOKIE</varname></title> + + <note> + <simpara> + Introduced in 4.1.0. In earlier versions, use + <varname>$HTTP_COOKIE_VARS</varname>. + </simpara> + </note> + + <simpara> + An associative array of variables passed to the current script + via HTTP cookies. Automatically global in any scope. + </simpara> + + <simpara> + This is a 'superglobal', or automatic global, variable. This + simply means that it is available in all scopes throughout a + script. You don't need to do a <command>global + $_COOKIE;</command> to access it within functions or methods, as + you do with <varname>$HTTP_COOKIE_VARS</varname>. + </simpara> + + <simpara> + <varname>$HTTP_COOKIE_VARS</varname> contains the same + information, but is not an autoglobal. + </simpara> + + <simpara> + If the <link + linkend="ini.register-globals">register_globals</link> directive + is set, then these variables will also be made available in the + global scope of the script; i.e., separate from the + <varname>$_COOKIE</varname> and <varname>$HTTP_COOKIE_VARS</varname> + arrays. For related information, see the security chapter titled + <link linkend="security.registerglobals">Using Register + Globals</link>. These individual globals are not autoglobals. + </simpara> + </sect2> + + <sect2 id="reserved.variables.get"> + <title>HTTP GET variables: <varname>$_GET</varname></title> + + <note> + <simpara> + Introduced in 4.1.0. In earlier versions, use + <varname>$HTTP_GET_VARS</varname>. + </simpara> + </note> + + <simpara> + An associative array of variables passed to the current script + via the HTTP GET method. Automatically global in any scope. + </simpara> + + <simpara> + This is a 'superglobal', or automatic global, variable. This + simply means that it is available in all scopes throughout a + script. You don't need to do a <command>global + $_GET;</command> to access it within functions or methods, as + you do with <varname>$HTTP_GET_VARS</varname>. + </simpara> + + <simpara> + <varname>$HTTP_GET_VARS</varname> contains the same + information, but is not an autoglobal. + </simpara> + + <simpara> + If the <link + linkend="ini.register-globals">register_globals</link> directive + is set, then these variables will also be made available in the + global scope of the script; i.e., separate from the + <varname>$_GET</varname> and <varname>$HTTP_GET_VARS</varname> + arrays. For related information, see the security chapter titled + <link linkend="security.registerglobals">Using Register + Globals</link>. These individual globals are not autoglobals. + </simpara> + </sect2> + + <sect2 id="reserved.variables.post"> + <title>HTTP POST variables: <varname>$_POST</varname></title> + + <note> + <simpara> + Introduced in 4.1.0. In earlier versions, use + <varname>$HTTP_POST_VARS</varname>. + </simpara> + </note> + + <simpara> + An associative array of variables passed to the current script + via the HTTP POST method. Automatically global in any scope. + </simpara> + + <simpara> + This is a 'superglobal', or automatic global, variable. This + simply means that it is available in all scopes throughout a + script. You don't need to do a <command>global + $_POST;</command> to access it within functions or methods, as + you do with <varname>$HTTP_POST_VARS</varname>. + </simpara> + + <simpara> + <varname>$HTTP_POST_VARS</varname> contains the same + information, but is not an autoglobal. + </simpara> + + <simpara> + If the <link + linkend="ini.register-globals">register_globals</link> directive + is set, then these variables will also be made available in the + global scope of the script; i.e., separate from the + <varname>$_POST</varname> and <varname>$HTTP_POST_VARS</varname> + arrays. For related information, see the security chapter titled + <link linkend="security.registerglobals">Using Register + Globals</link>. These individual globals are not autoglobals. + </simpara> + </sect2> + + <sect2 id="reserved.variables.files"> + <title>HTTP File upload variables: <varname>$_FILES</varname></title> + + <note> + <simpara> + Introduced in 4.1.0. In earlier versions, use + <varname>$HTTP_POST_FILES</varname>. + </simpara> + </note> + + <simpara> + An associative array of items uploaded to the current script + via the HTTP POST method. Automatically global in any scope. + </simpara> + + <simpara> + This is a 'superglobal', or automatic global, variable. This + simply means that it is available in all scopes throughout a + script. You don't need to do a <command>global + $_FILES;</command> to access it within functions or methods, as + you do with <varname>$HTTP_POST_FILES</varname>. + </simpara> + + <simpara> + <varname>$HTTP_POST_FILES</varname> contains the same + information, but is not an autoglobal. + </simpara> + + <simpara> + If the <link + linkend="ini.register-globals">register_globals</link> directive + is set, then these variables will also be made available in the + global scope of the script; i.e., separate from the + <varname>$_FILES</varname> and <varname>$HTTP_POST_FILES</varname> + arrays. For related information, see the security chapter titled + <link linkend="security.registerglobals">Using Register + Globals</link>. These individual globals are not autoglobals. + </simpara> + </sect2> + + <sect2 id="reserved.variables.request"> + <title>Request variables: <varname>$_REQUEST</varname></title> + + <note> + <simpara> + Introduced in 4.1.0. There is no equivalent array in earlier + versions. + </simpara> + </note> + + <simpara> + An associative array consisting of the contents of + <varname>$_GET</varname>, <varname>$_POST</varname>, + <varname>$_COOKIE</varname>, and <varname>$_FILES</varname>. + </simpara> + + <simpara> + This is a 'superglobal', or automatic global, variable. This + simply means that it is available in all scopes throughout a + script. You don't need to do a <command>global + $_REQUEST;</command> to access it within functions or methods. + </simpara> + + <simpara> + If the <link + linkend="ini.register-globals">register_globals</link> directive + is set, then these variables will also be made available in the + global scope of the script; i.e., separate from the + <varname>$_REQUEST</varname> array. For related information, see + the security chapter titled <link + linkend="security.registerglobals">Using Register + Globals</link>. These individual globals are not autoglobals. + </simpara> + </sect2> + + <sect2 id="reserved.variables.session"> + <title>Session variables: <varname>$_SESSION</varname></title> + + <note> + <simpara> + Introduced in 4.1.0. In earlier versions, use + <varname>$HTTP_SESSION_VARS</varname>. + </simpara> + </note> + + <simpara> + An associative array containing session variables available to + the current script. See the <link linkend="ref.session">Session + functions</link> documentation for more information on how this + is used. + </simpara> + + <simpara> + This is a 'superglobal', or automatic global, variable. This + simply means that it is available in all scopes throughout a + script. You don't need to do a <command>global + $_SESSION;</command> to access it within functions or methods, as + you do with <varname>$HTTP_SESSION_VARS</varname>. + </simpara> + + <simpara> + <varname>$HTTP_SESSION_VARS</varname> contains the same + information, but is not an autoglobal. + </simpara> + + <simpara> + If the <link + linkend="ini.register-globals">register_globals</link> directive + is set, then these variables will also be made available in the + global scope of the script; i.e., separate from the + <varname>$_SESSION</varname> and <varname>$HTTP_SESSION_VARS</varname> + arrays. For related information, see the security chapter titled + <link linkend="security.registerglobals">Using Register + Globals</link>. These individual globals are not autoglobals. + </simpara> + </sect2> + + <sect2 id="reserved.variables.phperrormsg"> + <title>The previous error message: <varname>$php_errormsg</varname></title> + <simpara> + <varname>$php_errormsg</varname> is a variable containing the + text of the last error message generated by PHP. This variable + will only be available within the scope in which the error + occurred, and only if the <link + linkend="ini.track-errors">track_errors</link> configuration + option is turned on (it defaults to off). + </simpara> + </sect2> + </sect1> + + + <sect1 id="reserved.classes"> + <title>Predefined Classes</title> + + <sect2 id="reserved.classes.standard"> + <title>Standard Defined Classes</title> + + <simpara> + These classes are defined in the standard set of functions included + in the PHP build. + </simpara> + + <variablelist> + <varlistentry> + <term><classname>Directory</classname></term> + <listitem> + <simpara> + The class from which <function>dir</function> is instantiated. + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><classname>stdClass</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + </variablelist> + </sect2> + + <sect2 id="reserved.classes.ming"> + <title><link linkend="ref.ming">Ming</link> Defined Classes</title> + + <simpara> + These classes are defined in the + <link linkend="ref.ming">Ming</link> + extension, and will only be available when that extension has either + been compiled into PHP or dynamically loaded at runtime. + </simpara> + + <variablelist> + <varlistentry> + <term><classname>swfshape</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><classname>swffill</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><classname>swfgradient</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><classname>swfbitmap</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><classname>swftext</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><classname>swftextfield</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><classname>swffont</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><classname>swfdisplayitem</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><classname>swfmovie</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><classname>swfbutton</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><classname>swfaction</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><classname>swfmorph</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><classname>swfsprite</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + </variablelist> + </sect2> + + <sect2 id="reserved.classes.oci8"> + <title><link linkend="ref.oci8">Oracle 8</link> Defined Classes</title> + + <simpara> + These classes are defined in the <link + linkend="ref.oci8">Oracle 8</link> extension, and will only be + available when that extension has either been compiled into PHP + or dynamically loaded at runtime. + </simpara> + + <variablelist> + <varlistentry> + <term><classname>OCI-Lob</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><classname>OCI-Collection</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + </variablelist> + </sect2> + + <sect2 id="reserved.classes.qtdom"> + <title><link linkend="ref.qtdom">qtdom</link> Defined Classes</title> + + <simpara> + These classes are defined in the + <link linkend="ref.qtdom">qtdom</link> + extension, and will only be available when that extension has either + been compiled into PHP or dynamically loaded at runtime. + </simpara> + + <variablelist> + <varlistentry> + <term><classname>QDomDocument</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><classname>QDomNode</classname></term> + <listitem> + <simpara> + </simpara> + </listitem> + </varlistentry> + </variablelist> + </sect2> + + </sect1> + + &appendices.reserved.constants; + </appendix> <!-- Keep this comment at the end of the file Index: phpdoc/en/language/constants.xml diff -u phpdoc/en/language/constants.xml:1.23 phpdoc/en/language/constants.xml:1.24 --- phpdoc/en/language/constants.xml:1.23 Wed Dec 12 15:47:37 2001 +++ phpdoc/en/language/constants.xml Mon Mar 11 19:57:46 2002 @@ -1,14 +1,15 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.23 $ --> +<!-- $Revision: 1.24 $ --> <chapter id="language.constants"> <title>Constants</title> <simpara> A constant is a identifier (name) for a simple value. As the name - suggests, that value cannot change during the execution of the script - (the magic constants <constant>__FILE__</constant> and - <constant>__LINE__</constant> are the only exception). A constant - is case-sensitive by default. By convention constants are always + suggests, that value cannot change during the execution of the + script. (The 'magic constants' <constant>__FILE__</constant> and + <constant>__LINE__</constant> appear to be an exception to this, + but they're not actually constants.) A constant is case-sensitive + by default. By convention constant identifiers are always uppercase. </simpara> <para> @@ -27,9 +28,12 @@ characters from 127 through 255 (0x7f-0xff). </simpara> </note> + <simpara> - The scope of a constant is global. + The scope of a constant is global--you can access it anywhere in + your script without regard to scope. </simpara> + <sect1 id="language.constants.syntax"> <title>Syntax</title> <simpara> @@ -67,209 +71,74 @@ you want to know if a constant is set. </simpara> <para> - This are the differences with variables: - <itemizedlist> - <listitem> - <simpara> - Constants do not have a dollar sign (<literal>$</literal>) before them; - </simpara> - </listitem> - <listitem> - <simpara> - Constants may be defined and accessed anywhere without regard to variable - scoping rules; - </simpara> - </listitem> - <listitem> - <simpara> - Constants may not be redefined or undefined once they have - been set; and - </simpara> - </listitem> - <listitem> - <simpara> - Constants may only evaluate to scalar values. - </simpara> - </listitem> - </itemizedlist> - </para> - - <para> - <example> - <title>Defining Constants</title> - <programlisting role="php"> -<![CDATA[ -<?php -define("CONSTANT", "Hello world."); -echo CONSTANT; // outputs "Hello world." -echo Constant; // outputs "Constant" and issues a notice. -?> -]]> - </programlisting> - </example> - - </para> - - </sect1> - - <sect1 id="language.constants.predefined"> - <title>Predefined constants</title> - <para> - The predefined constants (always available) are: - - <variablelist> - - <varlistentry> - <term>__FILE__ (case-insensitive)</term> - <listitem> - <simpara> - The name of the script file presently being parsed. If used - within a file which has been included or required, then the - name of the included file is given, and not the name of the - parent file. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>__LINE__ (case-insensitive)</term> - <listitem> - <simpara> - The number of the line within the current script file which is - being parsed. If used within a file which has been included or - required, then the position within the included file is given. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>PHP_VERSION</term> - <listitem> - <simpara> - The string representation of the version of the PHP parser - presently in use; for example '4.1.0'. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>PHP_OS</term> + These are the differences between constants and variables: + <itemizedlist> <listitem> <simpara> - The name of the operating system on which the PHP parser is - executing;. Possible values may be : - "AIX", "Darwin" (MacOS), "Linux", "SunOS", "WIN32", "WINNT". - Note: other values may be available too. + Constants do not have a dollar sign (<literal>$</literal>) + before them; </simpara> </listitem> - </varlistentry> - - <varlistentry> - <term>&true; (case-insensitive)</term> <listitem> <simpara> - A &true; value (see the <type>boolean</type> type). + Constants may only be defined using the + <function>define</function> function, not by simple assignment; </simpara> </listitem> - </varlistentry> - - <varlistentry> - <term>&false; (case-insensitive)</term> <listitem> <simpara> - A &false; value (see the <type>boolean</type> type). + Constants may be defined and accessed anywhere without regard + to variable scoping rules; </simpara> </listitem> - </varlistentry> - - <varlistentry> - <term>&null; (case-insensitive)</term> <listitem> <simpara> - A &null; value (see the <type>null</type> type). + Constants may not be redefined or undefined once they have been + set; and </simpara> </listitem> - </varlistentry> - - <varlistentry> - <term>E_ERROR</term> <listitem> <simpara> - Denotes an error other than a parsing error from which - recovery is not possible. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>E_WARNING</term> - <listitem> - <simpara> - Denotes a condition where PHP knows something is wrong, but - will continue anyway; these can be caught by the script - itself. An example would be an invalid regexp in - <function>ereg</function>. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>E_PARSE</term> - <listitem> - <simpara> - The parser choked on invalid syntax in the script - file. Recovery is not possible. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>E_NOTICE</term> - <listitem> - <simpara> - Something happened which may or may not be an error. Execution - continues. Examples include using an unquoted string as an array - index, or accessing a variable which has not been set. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>E_ALL</term> - <listitem> - <simpara> - All of the E_* constants rolled into one. If used with - <function>error_reporting</function>, will cause any and all - problems noticed by PHP to be reported. - </simpara> + Constants may only evaluate to scalar values. + </simpara> </listitem> - </varlistentry> - - </variablelist> - </para> + </itemizedlist> + </para> <para> - The <literal>E_*</literal> constants are typically used with the - <function>error_reporting</function> function for setting the - error reporting level. See all these constants at - <link linkend="features.error-handling">Error handling</link>. - <example> - <title>Using __FILE__ and __LINE__</title> + <title>Defining Constants</title> <programlisting role="php"> <![CDATA[ <?php -function report_error($file, $line, $message) -{ - echo "An error occured in $file on line $line: $message."; -} - -report_error(__FILE__, __LINE__, "Something went wrong!"); +define("CONSTANT", "Hello world."); +echo CONSTANT; // outputs "Hello world." +echo Constant; // outputs "Constant" and issues a notice. ?> ]]> </programlisting> </example> + </para> + </sect1> + + <sect1 id="language.constants.predefined"> + <title>Predefined constants</title> + + <simpara> + PHP provides a large number of predefined constants to any script + which it runs. Many of these constants, however, are created by + various extensions, and will only be present when those extensions + are available, either via dynamic loading or because they have + been compiled in. + </simpara> + + <simpara> + A list of predefined constants is available in the section <link + linkend="reserved.constants">Predefined constants</link>. + </simpara> + + </sect1> </chapter> Index: phpdoc/en/language/variables.xml diff -u phpdoc/en/language/variables.xml:1.35 phpdoc/en/language/variables.xml:1.36 --- phpdoc/en/language/variables.xml:1.35 Wed Feb 6 20:21:59 2002 +++ phpdoc/en/language/variables.xml Mon Mar 11 19:57:46 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.35 $ --> +<!-- $Revision: 1.36 $ --> <chapter id="language.variables"> <title>Variables</title> @@ -121,577 +121,10 @@ </simpara> <simpara> - Despite these factors, here is a list of predefined variables - available under a stock installation of PHP 3 running as a module - under a stock installation of <ulink - url="&url.apache;">Apache</ulink> 1.3.6. + A list of many (but not all) of the predefined variables is + available in the section <link + linkend="reserved.variables">Predefined variables</link>. </simpara> - - <simpara> - For a list of all predefined variables (and lots of other useful - information), please see (and use) <function>phpinfo</function>. - </simpara> - - <note> - <simpara> - This list is neither exhaustive nor intended to be. It is simply - a guideline as to what sorts of predefined variables you can - expect to have access to in your script. - </simpara> - </note> - - <sect2 id="language.variables.predefined.apache"> - <title>Apache variables</title> - - <simpara> - These variables are created by the <ulink - url="&url.apache;">Apache</ulink> webserver. If you are running - another webserver, there is no guarantee that it will provide the - same variables; it may omit some, or provide others not listed - here. That said, a large number of these variables are accounted - for in the <ulink url="&url.cgispec;">CGI 1.1 - specification</ulink>, so you should be able to expect those. - </simpara> - <simpara> - Note that few, if any, of these will be available (or indeed have - any meaning) if running PHP on the command line. - </simpara> - - <para> - <variablelist> - <varlistentry> - <term>$GATEWAY_INTERFACE</term> - <listitem> - <simpara> - What revision of the CGI specification the server is using; - i.e. 'CGI/1.1'. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$SERVER_NAME</term> - <listitem> - <simpara> - The name of the server host under which the current script is - executing. If the script is running on a virtual host, this - will be the value defined for that virtual host. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$SERVER_SOFTWARE</term> - <listitem> - <simpara> - Server identification string, given in the headers when - responding to requests. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$SERVER_PROTOCOL</term> - <listitem> - <simpara> - Name and revision of the information protocol via which the - page was requested; i.e. 'HTTP/1.0'; - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$REQUEST_METHOD</term> - <listitem> - <simpara> - Which request method was used to access the page; i.e. 'GET', - 'HEAD', 'POST', 'PUT'. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$QUERY_STRING</term> - <listitem> - <simpara> - The query string, if any, via which the page was accessed. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$DOCUMENT_ROOT</term> - <listitem> - <simpara> - The document root directory under which the current script is - executing, as defined in the server's configuration file. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$HTTP_ACCEPT</term> - <listitem> - <simpara> - Contents of the <literal>Accept:</literal> header from the - current request, if there is one. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$HTTP_ACCEPT_CHARSET</term> - <listitem> - <simpara> - Contents of the <literal>Accept-Charset:</literal> header - from the current request, if there is one. Example: - 'iso-8859-1,*,utf-8'. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$HTTP_ACCEPT_ENCODING</term> - <listitem> - <simpara> - Contents of the <literal>Accept-Encoding:</literal> header - from the current request, if there is one. Example: 'gzip'. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$HTTP_ACCEPT_LANGUAGE</term> - <listitem> - <simpara> - Contents of the <literal>Accept-Language:</literal> header - from the current request, if there is one. Example: 'en'. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$HTTP_CONNECTION</term> - <listitem> - <simpara> - Contents of the <literal>Connection:</literal> header from - the current request, if there is one. Example: 'Keep-Alive'. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$HTTP_HOST</term> - <listitem> - <simpara> - Contents of the <literal>Host:</literal> header from the - current request, if there is one. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$HTTP_REFERER</term> - <listitem> - <simpara> - The address of the page (if any) which referred the browser - to the current page. This is set by the user's browser; not - all browsers will set this. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$HTTP_USER_AGENT</term> - <listitem> - <simpara> - Contents of the <literal>User_Agent:</literal> header from - the current request, if there is one. This is a string - denoting the browser software being used to view the current - page; i.e. <computeroutput>Mozilla/4.5 [en] (X11; U; Linux - 2.2.9 i586)</computeroutput>. Among other things, you can use - this value with <function>get_browser</function> to tailor - your page's functionality to the capabilities of the user's - browser. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$REMOTE_ADDR</term> - <listitem> - <simpara> - The IP address from which the user is viewing the current - page. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$REMOTE_PORT</term> - <listitem> - <simpara> - The port being used on the user's machine to communicate with - the web server. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$SCRIPT_FILENAME</term> - <listitem> - <simpara> - The absolute pathname of the currently executing script. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$SERVER_ADMIN</term> - <listitem> - <simpara> - The value given to the SERVER_ADMIN (for Apache) directive in - the web server configuration file. If the script is running - on a virtual host, this will be the value defined for that - virtual host. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$SERVER_PORT</term> - <listitem> - <simpara> - The port on the server machine being used by the web server - for communication. For default setups, this will be '80'; - using SSL, for instance, will change this to whatever your - defined secure HTTP port is. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$SERVER_SIGNATURE</term> - <listitem> - <simpara> - String containing the server version and virtual host name - which are added to server-generated pages, if enabled. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$PATH_TRANSLATED</term> - <listitem> - <simpara> - Filesystem- (not document root-) based path to the current - script, after the server has done any virtual-to-real - mapping. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$SCRIPT_NAME</term> - <listitem> - <simpara> - Contains the current script's path. This is useful for pages - which need to point to themselves. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$REQUEST_URI</term> - <listitem> - <simpara> - The URI which was given in order to access this page; for - instance, '/index.html'. - </simpara> - </listitem> - </varlistentry> - </variablelist> - </para> - - </sect2> - - <sect2 id="language.variables.predefined.environment"> - <title>Environment variables</title> - - <simpara> - These variables are imported into PHP's global namespace from the - environment under which the PHP parser is running. Many are - provided by the shell under which PHP is running and different - systems are likely running different kinds of shells, a - definitive list is impossible. Please see your shell's - documentation for a list of defined environment variables. - </simpara> - <simpara> - Other environment variables include the CGI variables, placed - there regardless of whether PHP is running as a server module or - CGI processor. - </simpara> - - </sect2> - - <sect2 id="language.variables.predefined.php"> - <title>PHP variables</title> - - <simpara> - These variables are created by PHP itself. The - <varname>$HTTP_*_VARS</varname> variables are available only if - the <link linkend="ini.track-vars">track_vars</link> - configuration is turned on. When enabled, the variables are - always set, even if they are empty arrays. This prevents - a malicious user from spoofing these variables. - </simpara> - - <note> - <para> - As of PHP 4.0.3, <link - linkend="ini.track-vars">track_vars</link> is always turned on, - regardless of the configuration file setting. - </para> - </note> - - <note> - <para> - The new "Superglobals" were added in PHP version 4.1.0. See the - <ulink url="&url.php.release4.1.0;">4.1.0 Release - Announcement</ulink> for more details. These are the - <varname>$_GET</varname>, <varname>$_POST</varname>, - <varname>$_ENV</varname>, <varname>$_SERVER</varname>, - <varname>$_COOKIE</varname>, <varname>$_REQUEST</varname> - <varname>$_FILES</varname>, and <varname>$_SESSION</varname> - arrays, and they are informally known as - <emphasis>Superglobals</emphasis> since they are always - available without regard to scope. These deprecate the older - respective <varname>$HTTP_*_VARS</varname> arrays. - </para> - </note> - - <para> - If the <link - linkend="ini.register-globals">register_globals</link> directive - is set, then these variables will also be made available in the - global scope of the script; i.e., separate from the - <varname>$HTTP_*_VARS</varname> and <varname>$_*</varname> - arrays. For related information, see the security chapter titled - <link linkend="security.registerglobals">Using Register Globals</link>. - </para> - - <para> - <variablelist> - <varlistentry> - <term>$argv</term> - <listitem> - <simpara> - Array of arguments passed to the script. When the script is - run on the command line, this gives C-style access to the - command line parameters. When called via the GET method, this - will contain the query string. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$argc</term> - <listitem> - <simpara> - Contains the number of command line parameters passed to the - script (if run on the command line). - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$PHP_SELF</term> - <listitem> - <simpara> - The filename of the currently executing script, relative to - the document root. If PHP is running as a command-line - processor, this variable is not available. This variable - will include path information if present - (e.g. $PHP_SELF on this address: - "http://example.com/test.php/foo.bar" would be - "/test.php/foo.bar") - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$HTTP_COOKIE_VARS</term> - <listitem> - <simpara> - An associative array of variables passed to the current - script via HTTP cookies. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$_COOKIE</term> - <listitem> - <simpara> - An associative array of variables passed to the current - script via HTTP cookies. Automatically global in any - scope. Introduced in PHP 4.1.0. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$HTTP_GET_VARS</term> - <listitem> - <simpara> - An associative array of variables passed to the current - script via the HTTP GET method. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$_GET</term> - <listitem> - <simpara> - An associative array of variables passed to the current - script via the HTTP GET method. Automatically global in - any scope. Introduced in PHP 4.1.0. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$HTTP_POST_VARS</term> - <listitem> - <simpara> - An associative array of variables passed to the current - script via the HTTP POST method. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$_POST</term> - <listitem> - <simpara> - An associative array of variables passed to the current - script via the HTTP POST method. Automatically global in - any scope. Introduced in PHP 4.1.0. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$HTTP_POST_FILES</term> - <listitem> - <simpara> - An associative array of variables containing information - about files uploaded via the HTTP POST method. See <link - linkend="features.file-upload.post-method">POST method - uploads</link> for information on the contents of - <varname>$HTTP_POST_FILES</varname>. Introduced in 4.0.0. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$_FILES</term> - <listitem> - <simpara> - An associative array of variables containing information - about files uploaded via the HTTP POST method. See <link - linkend="features.file-upload.post-method">POST method - uploads</link> for information on the contents of - <varname>$_FILES</varname>. Automatically global in any scope. - Introduced in PHP 4.1.0. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$HTTP_ENV_VARS</term> - <listitem> - <simpara> - An associative array of variables passed to the current - script via the parent environment. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$_ENV</term> - <listitem> - <simpara> - An associative array of variables passed to the current - script via the parent environment. Automagically global - in any scope. Introduced in PHP 4.1.0. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$HTTP_SERVER_VARS</term> - <listitem> - <simpara> - An associative array of variables passed to the current - script from the HTTP server. These variables are analogous to - the Apache variables described above. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$_SERVER</term> - <listitem> - <simpara> - An associative array of variables passed to the current - script from the HTTP server. These variables are analogous to - the Apache variables described above. Automatically global - in any scope. Introduced in PHP 4.1.0. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$HTTP_SESSION_VARS</term> - <listitem> - <simpara> - An associative array of session variables passed to the current - script. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$_SESSION</term> - <listitem> - <simpara> - An associative array of session variables passed to the - current script. Automatically global in any scope. Creating - new entries in the $_SESSION array will automatically - register them as session variables, as if you called - <function>session_register</function>. Introduced in PHP 4.1.0. - </simpara> - </listitem> - </varlistentry> - - <varlistentry> - <term>$_REQUEST</term> - <listitem> - <simpara> - An associative array merged from the GET, POST, and Cookie variables. - In other words - all the information that is coming from the user, - and that from a security point of view, cannot be trusted. - Automatically global in any scope. Introduced in PHP 4.1.0. - </simpara> - </listitem> - </varlistentry> - - </variablelist> - </para> - - </sect2> </sect1>
« previous php.doc (#969342958) next »