Cosmetic changes here also.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@19035 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Egon Schmid 2000-02-01 07:57:37 +00:00
parent d79da8e1b3
commit de75166ea7

View file

@ -13,8 +13,12 @@
<funcdef>int <function>error_log</function></funcdef>
<paramdef>string <parameter>message</parameter></paramdef>
<paramdef>int <parameter>message_type</parameter></paramdef>
<paramdef>string <parameter><optional>destination</optional></parameter></paramdef>
<paramdef>string <parameter><optional>extra_headers</optional></parameter></paramdef>
<paramdef>string
<parameter><optional>destination</optional></parameter>
</paramdef>
<paramdef>string
<parameter><optional>extra_headers</optional></parameter>
</paramdef>
</funcsynopsis>
<para>
Sends an error message to the web server's error log, a
@ -32,7 +36,8 @@
<entry>
<parameter>message</parameter> is sent to PHP's system
logger, using the Operating System's system logging
mechanism or a file, depending on what the <link linkend="ini.error-log">error_log</link> configuration
mechanism or a file, depending on what the <link
linkend="ini.error-log">error_log</link> configuration
directive is set to.
</entry>
</row>
@ -70,7 +75,7 @@
</tgroup>
</table></para>
<para>
<example>
<example role="php">
<title><function>error_log</function> examples</title>
<programlisting role="php">
// Send notification through the server log if we can not
@ -89,8 +94,9 @@ if (!($foo = allocate_new_foo()) {
error_log("You messed up!", 2, "127.0.0.1:7000");
error_log("You messed up!", 2, "loghost");
error_log("You messed up!", 3, "/var/tmp/my-errors.log");
</programlisting>
</example></para>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
@ -103,7 +109,9 @@ error_log("You messed up!", 3, "/var/tmp/my-errors.log");
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>error_reporting</function></funcdef>
<paramdef>int <parameter><optional>level</optional></parameter></paramdef>
<paramdef>int
<parameter><optional>level</optional></parameter>
</paramdef>
</funcsynopsis>
<para>
Sets PHP's error reporting level and returns the old level. The
@ -121,31 +129,44 @@ error_log("You messed up!", 3, "/var/tmp/my-errors.log");
<tbody>
<row>
<entry>1</entry>
<entry><link linkend="internal.e-error">E_ERROR</link></entry>
<entry>
<link linkend="internal.e-error">E_ERROR</link>
</entry>
</row>
<row>
<entry>2</entry>
<entry><link linkend="internal.e-warning">E_WARNING</link></entry>
<entry>
<link linkend="internal.e-warning">E_WARNING</link>
</entry>
</row>
<row>
<entry>4</entry>
<entry><link linkend="internal.e-parse">E_PARSE</link></entry>
<entry>
<link linkend="internal.e-parse">E_PARSE</link>
</entry>
</row>
<row>
<entry>8</entry>
<entry><link linkend="internal.e-notice">E_NOTICE</link></entry>
<entry>
<link linkend="internal.e-notice">E_NOTICE</link>
</entry>
</row>
<row>
<entry>16</entry>
<entry><link linkend="internal.e-core-error">E_CORE_ERROR</link></entry>
<entry>
<link linkend="internal.e-core-error">E_CORE_ERROR</link>
</entry>
</row>
<row>
<entry>32</entry>
<entry><link linkend="internal.e-core-warning">E_CORE_WARNING</link></entry>
<entry>
<link linkend="internal.e-core-warning">E_CORE_WARNING</link>
</entry>
</row>
</tbody>
</tgroup>
</table></para>
</table>
</para>
</refsect1>
</refentry>
@ -161,16 +182,18 @@ error_log("You messed up!", 3, "/var/tmp/my-errors.log");
<paramdef>string <parameter>name</parameter></paramdef>
</funcsynopsis>
<simpara>
Returns true if the extension identified by <parameter>name</parameter>
is loaded. You can see the names of various extensions by using
<function>phpinfo</function>.</simpara>
Returns true if the extension identified by
<parameter>name</parameter> is loaded. You can see the names of
various extensions by using <function>phpinfo</function>.
</simpara>
<para>
See also <function>phpinfo</function>.
<note>
<para>
This function was added in 3.0.10.</para>
</note></para>
<note>
<para>
This function was added in 3.0.10.
</para>
</note>
</para>
</refsect1>
</refentry>
@ -185,30 +208,33 @@ error_log("You messed up!", 3, "/var/tmp/my-errors.log");
<funcdef>string <function>getenv</function></funcdef>
<paramdef>string <parameter>varname</parameter></paramdef>
</funcsynopsis>
<para>
Returns the value of the environment variable
<parameter>varname</parameter>, or false on an error.
<informalexample><programlisting>
<informalexample>
<programlisting>
$ip = getenv("REMOTE_ADDR"); // get the ip number of the user
</programlisting></informalexample></para>
</programlisting>
</informalexample>
</para>
<para>
You can see a list of all the environmental variables
by using <function>phpinfo</function>. You can find
out what many of them mean by taking a look at the
<ulink url="http://hoohoo.ncsa.uiuc.edu/cgi/">CGI
specification</ulink>, specifically the <ulink url="http://hoohoo.ncsa.uiuc.edu/cgi/env.html">page on environmental
variables</ulink>.</para>
You can see a list of all the environmental variables by using
<function>phpinfo</function>. You can find out what many of them
mean by taking a look at the <ulink url="&url.cgispecs;">CGI
specification</ulink>, specifically the <ulink
url="&url.cgispec;">page on
environmental variables</ulink>.
</para>
</refsect1>
</refentry>
<refentry id="function.get-cfg-var">
<refnamediv>
<refname>get_cfg_var</refname>
<refpurpose>Get the value of a PHP configuration option.</refpurpose>
<refpurpose>
Get the value of a PHP configuration option.
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -216,28 +242,32 @@ $ip = getenv("REMOTE_ADDR"); // get the ip number of the user
<funcdef>string <function>get_cfg_var</function></funcdef>
<paramdef>string <parameter>varname</parameter></paramdef>
</funcsynopsis>
<simpara>
Returns the current value of the PHP configuration variable
specified by <parameter>varname</parameter>, or false if an error
occurs.</simpara>
occurs.
</simpara>
<simpara>
It will not return configuration information set when the PHP was
compiled, or read from an Apache configuration file (using the
php3_configuration_option directives).</simpara>
<simpara>
To check whether the system is using a <link linkend="configuration.file">configuration file</link>,
try retrieving the value of the cfg_file_path configuration
setting. If this is available, a configuration file is being used.</simpara>
It will not return configuration information set when the PHP was
compiled, or read from an Apache configuration file (using the
php3_configuration_option directives).
</simpara>
<simpara>
To check whether the system is using a <link
linkend="configuration.file">configuration file</link>, try
retrieving the value of the cfg_file_path configuration
setting. If this is available, a configuration file is being
used.
</simpara>
</refsect1>
</refentry>
<refentry id="function.get-current-user">
<refnamediv>
<refname>get_current_user</refname>
<refpurpose>Get the name of the owner of the current PHP script.</refpurpose>
<refpurpose>
Get the name of the owner of the current PHP script.
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -245,22 +275,23 @@ $ip = getenv("REMOTE_ADDR"); // get the ip number of the user
<funcdef>string <function>get_current_user</function></funcdef>
<paramdef>void</paramdef>
</funcsynopsis>
<simpara>
Returns the name of the owner of the current PHP script.</simpara>
Returns the name of the owner of the current PHP script.
</simpara>
<simpara>
See also <function>getmyuid</function>,
<function>getmypid</function>, <function>getmyinode</function>,
and <function>getlastmod</function>.</simpara>
and <function>getlastmod</function>.
</simpara>
</refsect1>
</refentry>
<refentry id="function.get-magic-quotes-gpc">
<refnamediv>
<refname>get_magic_quotes_gpc</refname>
<refpurpose>Get the current active configuration setting of magic quotes gpc.</refpurpose>
<refpurpose>
Get the current active configuration setting of magic quotes gpc.
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -268,38 +299,43 @@ $ip = getenv("REMOTE_ADDR"); // get the ip number of the user
<funcdef>long <function>get_magic_quotes_gpc</function></funcdef>
<paramdef>void</paramdef>
</funcsynopsis>
<simpara>
Returns the current active configuration setting of
<link linkend="ini.magic-quotes-gpc">magic_quotes_gpc</link>.
(0 for off, 1 for on)</simpara>
(0 for off, 1 for on).
</simpara>
<simpara>
See also <function>get_magic_quotes_runtime</function>,
<function>set_magic_quotes_runtime</function>.</simpara>
<function>set_magic_quotes_runtime</function>.
</simpara>
</refsect1>
</refentry>
<refentry id="function.get-magic-quotes-runtime">
<refnamediv>
<refname>get_magic_quotes_runtime</refname>
<refpurpose>Get the current active configuration setting of magic_quotes_runtime.</refpurpose>
<refpurpose>
Get the current active configuration setting of
magic_quotes_runtime.
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>long <function>get_magic_quotes_runtime</function></funcdef>
<funcdef>long
<function>get_magic_quotes_runtime</function>
</funcdef>
<paramdef>void</paramdef>
</funcsynopsis>
<simpara>
Returns the current active configuration setting of
<link linkend="ini.magic-quotes-runtime">magic_quotes_runtime</link>.
(0 for off, 1 for on)</simpara>
(0 for off, 1 for on).
</simpara>
<simpara>
See also <function>get_magic_quotes_gpc</function>,
<function>set_magic_quotes_runtime</function>.</simpara>
<function>set_magic_quotes_runtime</function>.
</simpara>
</refsect1>
</refentry>
@ -314,28 +350,25 @@ $ip = getenv("REMOTE_ADDR"); // get the ip number of the user
<funcdef>int <function>getlastmod</function></funcdef>
<paramdef>void</paramdef>
</funcsynopsis>
<para>
Returns the time of the last modification of the current
page. The value returned is a Unix timestamp, suitable for
feeding to <function>date</function>. Returns
false on error.
feeding to <function>date</function>. Returns false on error.
<example>
<title>getlastmod() example</title>
<programlisting>
<programlisting role="php">
// outputs e.g. 'Last modified: March 04 1998 20:43:59.'
echo "Last modified: ".date( "F d Y H:i:s.", getlastmod() );
</programlisting>
</example></para>
</example>
</para>
<para>
See alse <function>date</function>,
<function>getmyuid</function>,
<function>get_current_user</function>,
<function>getmyinode</function>, and
<function>getmypid</function>.</para>
<function>getmypid</function>.
</para>
</refsect1>
</refentry>
@ -350,16 +383,15 @@ echo "Last modified: ".date( "F d Y H:i:s.", getlastmod() );
<funcdef>int <function>getmyinode</function></funcdef>
<paramdef>void</paramdef>
</funcsynopsis>
<para>
Returns the current script's inode, or false on error.</para>
Returns the current script's inode, or false on error.
</para>
<para>
See also <function>getmyuid</function>,
<function>get_current_user</function>,
<function>getmypid</function>, and
<function>getlastmod</function>.</para>
<function>getlastmod</function>.
</para>
</refsect1>
</refentry>
@ -374,20 +406,19 @@ echo "Last modified: ".date( "F d Y H:i:s.", getlastmod() );
<funcdef>int <function>getmypid</function></funcdef>
<paramdef>void</paramdef>
</funcsynopsis>
<para>
Returns the current PHP process ID, or false on error.</para>
Returns the current PHP process ID, or false on error.
</para>
<para>
Note that when running as a server module, separate invocations
of the script are not guaranteed to have distinct pids.</para>
of the script are not guaranteed to have distinct pids.
</para>
<para>
See also <function>getmyuid</function>,
<function>get_current_user</function>,
<function>getmyinode</function>, and
<function>getlastmod</function>.</para>
<function>getlastmod</function>.
</para>
</refsect1>
</refentry>
@ -402,16 +433,15 @@ echo "Last modified: ".date( "F d Y H:i:s.", getlastmod() );
<funcdef>int <function>getmyuid</function></funcdef>
<paramdef>void</paramdef>
</funcsynopsis>
<simpara>
Returns the user ID of the current script, or false on error.</simpara>
Returns the user ID of the current script, or false on error.
</simpara>
<simpara>
See also <function>getmypid</function>,
<function>get_current_user</function>,
<function>getmyinode</function>, and
<function>getlastmod</function>.</simpara>
<function>getlastmod</function>.
</simpara>
</refsect1>
</refentry>
@ -424,16 +454,17 @@ echo "Last modified: ".date( "F d Y H:i:s.", getlastmod() );
<title>Description</title>
<funcsynopsis>
<funcdef>array <function>getrusage</function></funcdef>
<paramdef>int <parameter><optional>who</optional></parameter></paramdef>
<paramdef>int
<parameter><optional>who</optional></parameter>
</paramdef>
</funcsynopsis>
<para>
This is an interface to getrusage(2). It returns an associative array
containing the data returned from the system call. If who is 1, getrusage
will be called with RUSAGE_CHILDREN.
This is an interface to getrusage(2). It returns an associative
array containing the data returned from the system call. If who
is 1, getrusage will be called with RUSAGE_CHILDREN.
</para>
<para>
All entries are accessible by using their documented field names.
<example>
<title>Getrusage Example</title>
<programlisting role="php">
@ -442,13 +473,13 @@ echo $dat["ru_nswap"]; # number of swaps
echo $dat["ru_majflt"]; # number of page faults
echo $dat["ru_utime.tv_sec"]; # user time used (seconds)
echo $dat["ru_utime.tv_usec"]; # user time used (microseconds)
</programlisting></example>
</programlisting>
</example>
See your system's man page for more details.
</para>
</refsect1>
</refentry>
<refentry id="function.phpinfo">
<refnamediv>
<refname>phpinfo</refname>
@ -460,18 +491,17 @@ echo $dat["ru_utime.tv_usec"]; # user time used (microseconds)
<funcdef>int <function>phpinfo</function></funcdef>
<paramdef>void</paramdef>
</funcsynopsis>
<para>
Outputs a large amount of information about the current state of
PHP. This includes information about PHP compilation options and
extensions, the PHP version, server information and environment
(if compiled as a module), the PHP environment, OS version
information, paths, master and local values of configuration
options, HTTP headers, and the GNU Public License.</para>
options, HTTP headers, and the GNU Public License.
</para>
<para>
See also <function>phpversion</function>.</para>
See also <function>phpversion</function>.
</para>
</refsect1>
</refentry>
@ -486,22 +516,20 @@ echo $dat["ru_utime.tv_usec"]; # user time used (microseconds)
<funcdef>string <function>phpversion</function></funcdef>
<paramdef>void</paramdef>
</funcsynopsis>
<para>
Returns a string containing the version of the currently running
PHP parser.
<example>
<title>phpversion() example</title>
<programlisting>
<programlisting role="php">
// prints e.g. 'Current PHP version: 3.0rel-dev'
echo "Current PHP version: ".phpversion();
</programlisting>
</example></para>
</example>
</para>
<para>
See also <function>phpinfo</function>.</para>
See also <function>phpinfo</function>.
</para>
</refsect1>
</refentry>
@ -537,40 +565,45 @@ echo "Current PHP version: ".phpversion();
<funcdef>void <function>putenv</function></funcdef>
<paramdef>string <parameter>setting</parameter></paramdef>
</funcsynopsis>
<para>
Adds <parameter>setting</parameter> to the environment.</para>
Adds <parameter>setting</parameter> to the environment.
</para>
<para>
<example>
<title>Setting an Environment Variable</title>
<programlisting>
<programlisting role="php">
putenv("UNIQID=$uniqid");
</programlisting>
</example></para>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.set-magic-quotes-runtime">
<refnamediv>
<refname>set_magic_quotes_runtime</refname>
<refpurpose>Set the current active configuration setting of magic_quotes_runtime.</refpurpose>
<refpurpose>
Set the current active configuration setting of
magic_quotes_runtime.
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>long <function>set_magic_quotes_runtime</function></funcdef>
<funcdef>long
<function>set_magic_quotes_runtime</function>
</funcdef>
<paramdef>int <parameter>new_setting</parameter></paramdef>
</funcsynopsis>
<simpara>
Set the current active configuration setting of
<link linkend="ini.magic-quotes-runtime">magic_quotes_runtime</link>.
(0 for off, 1 for on)</simpara>
Set the current active configuration setting of <link
linkend="ini.magic-quotes-runtime">magic_quotes_runtime</link>.
(0 for off, 1 for on)
</simpara>
<simpara>
See also <function>get_magic_quotes_gpc</function>,
<function>get_magic_quotes_runtime</function>.</simpara>
<function>get_magic_quotes_runtime</function>.
</simpara>
</refsect1>
</refentry>
@ -587,26 +620,25 @@ putenv("UNIQID=$uniqid");
</funcsynopsis>
<simpara>
Set the number of seconds a script is allowed to run. If this is
reached, the script returns a fatal error. The default limit is 30
seconds or, if it exists, the max_execution_time value defined in
the <link linkend="configuration.file">configuration file</link>.
If seconds is set to zero, no time limit is imposed.</simpara>
reached, the script returns a fatal error. The default limit is
30 seconds or, if it exists, the max_execution_time value defined
in the <link linkend="configuration.file">configuration
file</link>. If seconds is set to zero, no time limit is
imposed.
</simpara>
<simpara>
When called, <function>set_time_limit</function> restarts the timeout
counter from zero. In other words, if the timeout is the default 30
seconds, and 25 seconds into script execution a call such as
set_time_limit(20) is made, the script will run for a total of
45 seconds before timing out.
</simpara>
<simpara>
Note that <function>set_time_limit</function> has no effect when
PHP is running in safe mode. There is no workaround other than
turning off safe mode or changing the time limit in the
<link linkend="configuration.file">configuration file</link>.
</simpara>
When called, <function>set_time_limit</function> restarts the
timeout counter from zero. In other words, if the timeout is the
default 30 seconds, and 25 seconds into script execution a call
such as set_time_limit(20) is made, the script will run for a
total of 45 seconds before timing out.
</simpara>
<simpara>
Note that <function>set_time_limit</function> has no effect when
PHP is running in safe mode. There is no workaround other than
turning off safe mode or changing the time limit in the <link
linkend="configuration.file">configuration file</link>.
</simpara>
</refsect1>
</refentry>