mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-20 19:08:54 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@36736 c90b9560-bf6c-de11-be94-00142212c4b1
1240 lines
36 KiB
XML
1240 lines
36 KiB
XML
<reference id="ref.info">
|
|
<title>PHP options & information</title>
|
|
<titleabbrev>PHP options/info</titleabbrev>
|
|
|
|
<refentry id="function.assert">
|
|
<refnamediv>
|
|
<refname>assert</refname>
|
|
<refpurpose>Checks if assertion is false</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>assert</function></funcdef>
|
|
<paramdef>string|bool <parameter>assertion</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
<function>assert</function> will check the given
|
|
<parameter>assertion</parameter> and take appropriate
|
|
action if its result is <literal>false</literal>.
|
|
</para>
|
|
<para>
|
|
If the <parameter>assertion</parameter> is given as a string it
|
|
will be evaluated as PHP code by <function>assert</function>.
|
|
The advantages of a string <parameter>assertion</parameter>
|
|
are less overhead when assertion checking is off and messages
|
|
containing the <parameter>assertion</parameter> expression when
|
|
an assertion failes.
|
|
</para>
|
|
<para>
|
|
Assertion should be used as a debugging feature only. You may
|
|
use them for sanity-checks that test for conditions that should
|
|
always be true and that indicate some programming errors if not
|
|
or to check for the presence of certain features like extension
|
|
functions or certain system limits and features.
|
|
</para>
|
|
<para>
|
|
Assertions should not be used for normal runtime operations
|
|
like input parameter checks. As a rule of thumb your code
|
|
should always be able to work correct if assertion checking
|
|
is not activated.
|
|
</para>
|
|
<para>
|
|
The behavior of <function>assert</function> may be configured
|
|
by <function>assert_options</function> or by .ini-settings
|
|
described in that functions manual page.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.assert-options">
|
|
<refnamediv>
|
|
<refname>assert_options</refname>
|
|
<refpurpose>Set/get the various assert flags</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>mixed <function>assert_options</function></funcdef>
|
|
<paramdef>int <parameter>what</parameter></paramdef>
|
|
<paramdef>mixed
|
|
<parameter><optional>value</optional></parameter>
|
|
</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Using <function>assert_options</function> you may set the various
|
|
<function>assert</function> control options or just query their
|
|
current settings.
|
|
</para>
|
|
<table>
|
|
<title>assert options</title>
|
|
<tgroup cols="4">
|
|
<thead>
|
|
<row>
|
|
<entry>option</entry>
|
|
<entry>ini-parameter</entry>
|
|
<entry>default</entry>
|
|
<entry>description</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>ASSERT_ACTIVE</entry>
|
|
<entry>assert.active</entry>
|
|
<entry>1</entry>
|
|
<entry>enable <function>assert</function> evaluation</entry>
|
|
</row>
|
|
<row>
|
|
<entry>ASSERT_WARNING</entry>
|
|
<entry>assert.warning</entry>
|
|
<entry>1</entry>
|
|
<entry>issue a PHP warning for each failed assertion</entry>
|
|
</row>
|
|
<row>
|
|
<entry>ASSERT_BAIL</entry>
|
|
<entry>assert.bail</entry>
|
|
<entry>0</entry>
|
|
<entry>terminate execution on failed assertions</entry>
|
|
</row>
|
|
<row>
|
|
<entry>ASSERT_QUIET_EVAL</entry>
|
|
<entry>assert.quiet_eval</entry>
|
|
<entry>0</entry>
|
|
<entry>
|
|
disable error_reporting during assertion expression
|
|
evaluation
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>ASSERT_CALLBACK</entry>
|
|
<entry>assert_callback</entry>
|
|
<entry>(null)</entry>
|
|
<entry>user function to call on failed assertions</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
<para>
|
|
<function>assert_options</function> will return the original
|
|
setting of any option or <literal>false</literal> on errors.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.extension-loaded">
|
|
<refnamediv>
|
|
<refname>extension_loaded</refname>
|
|
<refpurpose>find out whether an extension is loaded</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>bool <function>extension_loaded</function></funcdef>
|
|
<paramdef>string <parameter>name</parameter></paramdef>
|
|
</funcprototype>
|
|
</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>
|
|
<para>
|
|
See also <function>phpinfo</function>.
|
|
<note>
|
|
<para>
|
|
This function was added in 3.0.10.
|
|
</para>
|
|
</note>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.dl">
|
|
<refnamediv>
|
|
<refname>dl</refname>
|
|
<refpurpose>load a PHP extension at runtime</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>dl</function></funcdef>
|
|
<paramdef>string <parameter>library</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Loads the PHP extension defined in
|
|
<parameter>library</parameter>. See also the <link
|
|
linkend="ini.extension-dir">extension_dir</link> configuration
|
|
directive.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.getenv">
|
|
<refnamediv>
|
|
<refname>getenv</refname>
|
|
<refpurpose>Get the value of an environment variable</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>string <function>getenv</function></funcdef>
|
|
<paramdef>string <parameter>varname</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Returns the value of the environment variable
|
|
<parameter>varname</parameter>, or false on an error.
|
|
|
|
<informalexample>
|
|
<programlisting>
|
|
$ip = getenv ("REMOTE_ADDR"); // get the ip number of the user
|
|
</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="&url.cgispecs;">CGI
|
|
specification</ulink>, specifically the <ulink
|
|
url="&url.cgispec;">page on
|
|
environmental variables</ulink>.
|
|
<note>
|
|
<para>
|
|
This function does not work in ISAPI mode.
|
|
</para>
|
|
</note>
|
|
</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>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>string <function>get_cfg_var</function></funcdef>
|
|
<paramdef>string <parameter>varname</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<simpara>
|
|
Returns the current value of the PHP configuration variable
|
|
specified by <parameter>varname</parameter>, or false if an error
|
|
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>
|
|
</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>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>string <function>get_current_user</function></funcdef>
|
|
<paramdef>void</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<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>
|
|
</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>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>long <function>get_magic_quotes_gpc</function></funcdef>
|
|
<paramdef>void</paramdef>
|
|
</funcprototype>
|
|
</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>
|
|
<simpara>
|
|
See also <function>get_magic_quotes_runtime</function>,
|
|
<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>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>long
|
|
<function>get_magic_quotes_runtime</function>
|
|
</funcdef>
|
|
<paramdef>void</paramdef>
|
|
</funcprototype>
|
|
</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>
|
|
<simpara>
|
|
See also <function>get_magic_quotes_gpc</function>,
|
|
<function>set_magic_quotes_runtime</function>.
|
|
</simpara>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.getlastmod">
|
|
<refnamediv>
|
|
<refname>getlastmod</refname>
|
|
<refpurpose>Get time of last page modification.</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>getlastmod</function></funcdef>
|
|
<paramdef>void</paramdef>
|
|
</funcprototype>
|
|
</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.
|
|
<example>
|
|
<title>getlastmod() example</title>
|
|
<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>
|
|
<para>
|
|
See alse <function>date</function>,
|
|
<function>getmyuid</function>,
|
|
<function>get_current_user</function>,
|
|
<function>getmyinode</function>, and
|
|
<function>getmypid</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.getmyinode">
|
|
<refnamediv>
|
|
<refname>getmyinode</refname>
|
|
<refpurpose>Get the inode of the current script.</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>getmyinode</function></funcdef>
|
|
<paramdef>void</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<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>
|
|
<note>
|
|
<simpara>
|
|
This function is not supported on Windows systems.
|
|
</simpara>
|
|
</note>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.getmypid">
|
|
<refnamediv>
|
|
<refname>getmypid</refname>
|
|
<refpurpose>Get PHP's process ID.</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>getmypid</function></funcdef>
|
|
<paramdef>void</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Returns the current PHP process ID, or false on error.
|
|
</para>
|
|
<warning>
|
|
<para>
|
|
Process IDs are not unique, thus they are a weak entropy
|
|
source. We recommend against relying on pids in
|
|
security-dependent contexts.
|
|
</para>
|
|
</warning>
|
|
<para>
|
|
See also <function>getmyuid</function>,
|
|
<function>get_current_user</function>,
|
|
<function>getmyinode</function>, and
|
|
<function>getlastmod</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.getmyuid">
|
|
<refnamediv>
|
|
<refname>getmyuid</refname>
|
|
<refpurpose>Get PHP script owner's UID.</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>getmyuid</function></funcdef>
|
|
<paramdef>void</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<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>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.getrusage">
|
|
<refnamediv>
|
|
<refname>getrusage</refname>
|
|
<refpurpose>Get the current resource usages.</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>array <function>getrusage</function></funcdef>
|
|
<paramdef>int
|
|
<parameter><optional>who</optional></parameter>
|
|
</paramdef>
|
|
</funcprototype>
|
|
</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.
|
|
</para>
|
|
<para>
|
|
All entries are accessible by using their documented field names.
|
|
<example>
|
|
<title>Getrusage Example</title>
|
|
<programlisting role="php">
|
|
$dat = getrusage();
|
|
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>
|
|
See your system's man page on getrusage(2) for more details.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.ini-alter">
|
|
<refnamediv>
|
|
<refname>ini_alter</refname>
|
|
<refpurpose>Change the value of a configuration option</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>string <function>ini_alter</function></funcdef>
|
|
<paramdef>string <parameter>varname</parameter></paramdef>
|
|
<paramdef>string <parameter>newvalue</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Changes the value of a configuration option, returns
|
|
<literal>false</literal> on failure, and the previous value of the
|
|
configuration option on success.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
This is an alias of <function>ini_set</function>
|
|
</para>
|
|
</note>
|
|
<para>
|
|
See also <function>ini_get</function>,
|
|
<function>ini_restore</function>,
|
|
<function>ini_set</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.ini-get">
|
|
<refnamediv>
|
|
<refname>ini_get</refname>
|
|
<refpurpose>Get the value of a configuration option</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>string <function>ini_get</function></funcdef>
|
|
<paramdef>string <parameter>varname</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Returns the value of the configuration option on success,
|
|
<literal>false</literal> on failure.
|
|
</para>
|
|
<para>
|
|
See also <function>ini_alter</function>,
|
|
<function>ini_restore</function>,
|
|
<function>ini_set</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.ini-restore">
|
|
<refnamediv>
|
|
<refname>ini_restore</refname>
|
|
<refpurpose>Restore the value of a configuration option</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>string <function>ini_restore</function></funcdef>
|
|
<paramdef>string <parameter>varname</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Restores a given configuration option to its original value.
|
|
</para>
|
|
<para>
|
|
See also <function>ini_alter</function>,
|
|
<function>ini_get</function>,
|
|
<function>ini_set</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.ini-set">
|
|
<refnamediv>
|
|
<refname>ini_set</refname>
|
|
<refpurpose>Set the value of a configuration option</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>string <function>ini_set</function></funcdef>
|
|
<paramdef>string <parameter>varname</parameter></paramdef>
|
|
<paramdef>string <parameter>newvalue</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Sets the value of the given configuration option. Returns the old
|
|
value on success, <literal>false</literal> on failure.
|
|
</para>
|
|
<para>
|
|
See also <function>ini_alter</function>,
|
|
<function>ini_get</function>,
|
|
<function>ini_restore</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.phpcredits">
|
|
<refnamediv>
|
|
<refname>phpcredits</refname>
|
|
<refpurpose>Prints out the credits for PHP.</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>phpcredits</function></funcdef>
|
|
<paramdef>int <parameter>flag</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
This function prints out the credits listing the PHP developers,
|
|
modules, etc. It generates the appropriate HTML codes to insert
|
|
the information in a page. A parameter indicating what will be
|
|
printed (a pre-defined constant flag, see table below) needs
|
|
to be passed. For example to print the general credits, you will
|
|
use somewhere in your code:
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
...
|
|
phpcredits(CREDITS_GENERAL);
|
|
...
|
|
</programlisting>
|
|
</informalexample>
|
|
And if you want to print the core developers and the documentation
|
|
group, in a page of its own, you will use:
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
<?php
|
|
phpcredits(CREDITS_GROUP + CREDITS_DOCS + CREDITS_FULLPAGE);
|
|
?>
|
|
</programlisting>
|
|
</informalexample>
|
|
And if you feel like embedding all the credits in your page, then
|
|
code like the one below will do it:
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
<html>
|
|
<head>
|
|
<title>My credits page</title>
|
|
</head>
|
|
<body>
|
|
<?php
|
|
// some code of your own
|
|
phpcredits(CREDITS_ALL + CREDITS_FULLPAGE);
|
|
// some more code
|
|
?>
|
|
</body>
|
|
</html>
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
<para>
|
|
</para>
|
|
<para>
|
|
<table>
|
|
<title>Pre-defined <function>phpcredits</function> flags</title>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>name</entry>
|
|
<entry>description</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>CREDITS_ALL</entry>
|
|
<entry>
|
|
All the credits, equivalent to using: CREDITS_DOCS + CREDITS_GENERAL +
|
|
CREDITS_GROUP + CREDITS_MODULES + CREDITS_FULLPAGE. It generates a
|
|
complete stand-alone HTML page with the appropriate tags.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>CREDITS_DOCS</entry>
|
|
<entry>The credits for the documentation team</entry>
|
|
</row>
|
|
<row>
|
|
<entry>CREDITS_FULLPAGE</entry>
|
|
<entry>
|
|
Usually used in combination with the other flags.
|
|
Indicates that the a complete stand-alone HTML page
|
|
needs to be printed including the information indicated
|
|
by the other flags.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>CREDITS_GENERAL</entry>
|
|
<entry>
|
|
General credits: Language design and concept, PHP 4.0 authors
|
|
and SAPI module.
|
|
</entry>
|
|
</row>
|
|
<row>
|
|
<entry>CREDITS_GROUP</entry>
|
|
<entry>A list of the core developers</entry>
|
|
</row>
|
|
<row>
|
|
<entry>CREDITS_MODULES</entry>
|
|
<entry>A list of the extension modules for PHP, and their authors</entry>
|
|
</row>
|
|
<row>
|
|
<entry>CREDITS_SAPI</entry>
|
|
<entry>A list of the server API modules for PHP, and their authors</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
</para>
|
|
<para>
|
|
See also <function>phpinfo</function>,
|
|
<function>phpversion</function>,
|
|
<function>php_logo_guid</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.phpinfo">
|
|
<refnamediv>
|
|
<refname>phpinfo</refname>
|
|
<refpurpose>Output lots of PHP information.</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>int <function>phpinfo</function></funcdef>
|
|
<paramdef>int <parameter><optional>what</optional></parameter></paramdef>
|
|
</funcprototype>
|
|
</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 PHP License.
|
|
</para>
|
|
<para>
|
|
The output may be customized by passing one or more of the
|
|
following values ored together in the optional parameter
|
|
<parameter>what</parameter>.
|
|
<itemizedlist>
|
|
<listitem><simpara>INFO_GENERAL</simpara></listitem>
|
|
<listitem><simpara>INFO_CREDITS</simpara></listitem>
|
|
<listitem><simpara>INFO_CONFIGURATION</simpara></listitem>
|
|
<listitem><simpara>INFO_MODULES</simpara></listitem>
|
|
<listitem><simpara>INFO_ENVIRONMENT</simpara></listitem>
|
|
<listitem><simpara>INFO_VARIABLES</simpara></listitem>
|
|
<listitem><simpara>INFO_LICENSE</simpara></listitem>
|
|
<listitem><simpara>INFO_ALL</simpara></listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<para>
|
|
See also <function>phpversion</function>,
|
|
<function>phpcredits</function>,
|
|
<function>php_logo_guid</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.phpversion">
|
|
<refnamediv>
|
|
<refname>phpversion</refname>
|
|
<refpurpose>Get the current PHP version.</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>string <function>phpversion</function></funcdef>
|
|
<paramdef>void</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Returns a string containing the version of the currently running
|
|
PHP parser.
|
|
<example>
|
|
<title>phpversion() example</title>
|
|
<programlisting role="php">
|
|
// prints e.g. 'Current PHP version: 3.0rel-dev'
|
|
echo "Current PHP version: ".phpversion();
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also <function>phpinfo</function>,
|
|
<function>phpcredits</function>,
|
|
<function>php_logo_guid</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.php-logo-guid">
|
|
<refnamediv>
|
|
<refname>php_logo_guid</refname>
|
|
<refpurpose>Get the logo guid</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>string <function>php_logo_guid</function></funcdef>
|
|
<paramdef>void</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
<note>
|
|
<para>
|
|
This funcionality was added in PHP 4 Beta 4.
|
|
</para>
|
|
</note>
|
|
</para>
|
|
<para>
|
|
See also <function>phpinfo</function>.
|
|
<function>phpversion</function>,
|
|
<function>phpcredits</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.php-sapi-name">
|
|
<refnamediv>
|
|
<refname>php_sapi_name</refname>
|
|
<refpurpose>
|
|
Returns the type of interface between web server and PHP
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>string <function>php_sapi_name</function></funcdef>
|
|
<void/>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<simpara>
|
|
<function>Php_sapi_name</function> returns a lowercase string which
|
|
describes the type of interface between web server and PHP
|
|
(Server API, SAPI). In CGI PHP, this string is "cgi", in
|
|
mod_php for Apache, this string is "apache" and so on.
|
|
</simpara>
|
|
<para>
|
|
<example>
|
|
<title><function>Php_sapi_name</function> Example</title>
|
|
<programlisting role="php">
|
|
$sapi_type = php_sapi_name();
|
|
if ($sapi_type == "cgi")
|
|
print "You are using CGI PHP\n";
|
|
else
|
|
print "You are not using CGI PHP\n";
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.php-uname">
|
|
<refnamediv>
|
|
<refname>php_uname</refname>
|
|
<refpurpose>
|
|
Returns information about the operating system PHP was built on
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>string <function>php_uname</function></funcdef>
|
|
<void/>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<simpara>
|
|
<function>php_uname</function> returns a string with a description
|
|
of the operating system PHP is built on.
|
|
</simpara>
|
|
<para>
|
|
<example>
|
|
<title><function>php_uname</function> Example</title>
|
|
<programlisting role="php">
|
|
if (substr(php_uname(), 0, 7) == "Windows") {
|
|
die("Sorry, this script doesn't run on Windows.\n");
|
|
}
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.putenv">
|
|
<refnamediv>
|
|
<refname>putenv</refname>
|
|
<refpurpose>Set the value of an environment variable.</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>putenv</function></funcdef>
|
|
<paramdef>string <parameter>setting</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
Adds <parameter>setting</parameter> to the server environment.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Setting an Environment Variable</title>
|
|
<programlisting role="php">
|
|
putenv ("UNIQID=$uniqid");
|
|
</programlisting>
|
|
</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>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>long
|
|
<function>set_magic_quotes_runtime</function>
|
|
</funcdef>
|
|
<paramdef>int <parameter>new_setting</parameter></paramdef>
|
|
</funcprototype>
|
|
</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>
|
|
<simpara>
|
|
See also <function>get_magic_quotes_gpc</function>,
|
|
<function>get_magic_quotes_runtime</function>.
|
|
</simpara>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.set-time-limit">
|
|
<refnamediv>
|
|
<refname>set_time_limit</refname>
|
|
<refpurpose>limit the maximum execution time</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>void <function>set_time_limit</function></funcdef>
|
|
<paramdef>int <parameter>seconds</parameter></paramdef>
|
|
</funcprototype>
|
|
</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>
|
|
<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>
|
|
|
|
<refentry id="function.zend-logo-guid">
|
|
<refnamediv>
|
|
<refname>zend_logo_guid</refname>
|
|
<refpurpose>Get the zend guid</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>string <function>zend_logo_guid</function></funcdef>
|
|
<paramdef>void</paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
<note>
|
|
<para>
|
|
This funcionality was added in PHP 4 Beta 4.
|
|
</para>
|
|
</note>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.get-loaded-extensions">
|
|
<refnamediv>
|
|
<refname>get_loaded_extensions</refname>
|
|
<refpurpose>
|
|
Returns an array with the names of all modules compiled and
|
|
loaded
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>array <function>get_loaded_extensions</function></funcdef>
|
|
<paramdef>void </paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
This function returns the names of all the modules compiled and
|
|
loaded in the PHP interpreter.
|
|
</para>
|
|
<para>
|
|
For example the line below
|
|
<informalexample>
|
|
<programlisting>
|
|
print_r (get_loaded_extensions());
|
|
</programlisting>
|
|
</informalexample>
|
|
will print a list like:
|
|
<informalexample>
|
|
<programlisting>
|
|
Array
|
|
(
|
|
[0] => xml
|
|
[1] => wddx
|
|
[2] => standard
|
|
[3] => session
|
|
[4] => posix
|
|
[5] => pgsql
|
|
[6] => pcre
|
|
[7] => gd
|
|
[8] => ftp
|
|
[9] => db
|
|
[10] => Calendar
|
|
[11] => bcmath
|
|
)
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
<para>
|
|
See also: <function>get_extension_funcs</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.get-extension-funcs">
|
|
<refnamediv>
|
|
<refname>get_extension_funcs</refname>
|
|
<refpurpose>
|
|
Returns an array with the names of the functions of a module
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>array <function>get_extension_funcs</function></funcdef>
|
|
<paramdef>string <parameter>module_name</parameter></paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
This function returns the names of all the functions defined in
|
|
the module indicated by <parameter>module_name</parameter>.
|
|
</para>
|
|
<para>
|
|
For example the lines below
|
|
<informalexample>
|
|
<programlisting>
|
|
print_r (get_extension_funcs ("xml"));
|
|
print_r (get_extension_funcs ("gd"));
|
|
</programlisting>
|
|
</informalexample>
|
|
will print a list of the functions in the modules
|
|
<varname>xml</varname> and <varname>gd</varname> respectively.
|
|
</para>
|
|
<para>
|
|
See also: <function>get_loaded_extensions</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.get-required-files">
|
|
<refnamediv>
|
|
<refname>get_required_files</refname>
|
|
<refpurpose>
|
|
Returns an array with the names of the files require_once()'d in
|
|
a script
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>array <function>get_required_files</function></funcdef>
|
|
<paramdef>void </paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
This function returns an associtative array of the names of all
|
|
the files that have been loaded into a script using
|
|
<function>require_once</function>. The indexes of the array are
|
|
the file names as used in the <function>require_once</function>
|
|
without the ".php" extension.
|
|
</para>
|
|
<para>
|
|
The example below
|
|
<example>
|
|
<title>Printing the required and included files</title>
|
|
<programlisting>
|
|
<?php
|
|
|
|
require_once ("local.php");
|
|
require_once ("../inc/global.php");
|
|
|
|
for ($i=1; $i<5; $i++)
|
|
include "util".$i."php";
|
|
|
|
echo "Required_once files\n";
|
|
print_r (get_required_files());
|
|
|
|
echo "Included_once files\n";
|
|
print_r (get_included_files());
|
|
?>
|
|
</programlisting>
|
|
</example>
|
|
will generate the following output:
|
|
<informalexample>
|
|
<programlisting>
|
|
Required_once files
|
|
Array
|
|
(
|
|
[local] => local.php
|
|
[../inc/global] => /full/path/to/inc/global.php
|
|
)
|
|
|
|
Included_once files
|
|
Array
|
|
(
|
|
[util1] => util1.php
|
|
[util2] => util2.php
|
|
[util3] => util3.php
|
|
[util4] => util4.php
|
|
)
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
<para>
|
|
<note>
|
|
<para>
|
|
As of PHP 4.0.1pl2 this function assumes that the
|
|
<varname>required_once</varname> files end in the extension
|
|
".php", other extensions do not work.
|
|
</para>
|
|
</note>
|
|
</para>
|
|
<para>
|
|
See also: <function>require_once</function>,
|
|
<function>include_once</function>,
|
|
<function>get_included_files</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<refentry id="function.get-included-files">
|
|
<refnamediv>
|
|
<refname>get_included_files</refname>
|
|
<refpurpose>
|
|
Returns an array with the names of the files include_once()'d in
|
|
a script
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<funcsynopsis>
|
|
<funcprototype>
|
|
<funcdef>array <function>get_included_files</function></funcdef>
|
|
<paramdef>void </paramdef>
|
|
</funcprototype>
|
|
</funcsynopsis>
|
|
<para>
|
|
This function returns an associtative array of the names of all
|
|
the files that have been loaded into a script using
|
|
<function>include_once</function>. The indexes of the array are
|
|
the file names as used in the <function>include_once</function>
|
|
without the ".php" extension.
|
|
</para>
|
|
<para>
|
|
<note>
|
|
<para>
|
|
As of PHP 4.0.1pl2 this function assumes that the
|
|
<varname>include_once</varname> files end in the extension
|
|
".php", other extensions do not work.
|
|
</para>
|
|
</note>
|
|
</para>
|
|
<para>
|
|
See also: <function>require_once</function>,
|
|
<function>include_once</function>,
|
|
<function>get_required_files</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
</reference>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
-->
|