Cosmetics, mostly indentation.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@30438 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Egon Schmid 2000-08-18 12:03:50 +00:00
parent 535a1f95e4
commit d94d48228c
2 changed files with 116 additions and 234 deletions

View file

@ -2,124 +2,6 @@
<title>PHP options &amp; 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.error-log">
<refnamediv>
<refname>error_log</refname>
@ -206,14 +88,14 @@ if (!Ora_Logon($username, $password)) {
// Notify administrator by email if we run out of FOO
if (!($foo = allocate_new_foo()) {
error_log("Big trouble, we're all out of FOOs!", 1,
"operator@mydomain.com");
error_log ("Big trouble, we're all out of FOOs!", 1,
"operator@mydomain.com");
}
// other ways of calling error_log():
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");
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>
@ -340,7 +222,7 @@ error_log("You messed up!", 3, "/var/tmp/my-errors.log");
<informalexample>
<programlisting>
$ip = getenv("REMOTE_ADDR"); // get the ip number of the user
$ip = getenv ("REMOTE_ADDR"); // get the ip number of the user
</programlisting>
</informalexample>
</para>
@ -494,7 +376,7 @@ $ip = getenv("REMOTE_ADDR"); // get the ip number of the user
<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() );
echo "Last modified: ".date ("F d Y H:i:s.", getlastmod());
</programlisting>
</example>
</para>
@ -765,7 +647,7 @@ else
<example>
<title>Setting an Environment Variable</title>
<programlisting role="php">
putenv("UNIQID=$uniqid");
putenv ("UNIQID=$uniqid");
</programlisting>
</example>
</para>
@ -866,9 +748,9 @@ putenv("UNIQID=$uniqid");
<refnamediv>
<refname>get_loaded_extensions</refname>
<refpurpose>
Returns an array with the names of all modules compiled and
loaded
</refpurpose>
Returns an array with the names of all modules compiled and
loaded
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -879,19 +761,19 @@ putenv("UNIQID=$uniqid");
</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_loadedextensions());
</programlisting>
</informalexample>
will print a list like:
<informalexample>
<programlisting>
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_loadedextensions());
</programlisting>
</informalexample>
will print a list like:
<informalexample>
<programlisting>
Array
(
[0] =&gt; xml
@ -907,12 +789,12 @@ Array
[10] =&gt; Calendar
[11] =&gt; bcmath
)
</programlisting>
</informalexample>
</programlisting>
</informalexample>
</para>
<para>
See also: <function>get_extension_funcs</function>.
</para>
<para>
See also: <function>get_extension_funcs</function>
</para>
</refsect1>
</refentry>
@ -920,8 +802,8 @@ Array
<refnamediv>
<refname>get_extension_funcs</refname>
<refpurpose>
Returns an array with the names of the functions of a module
</refpurpose>
Returns an array with the names of the functions of a module
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -932,23 +814,23 @@ Array
</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(&quot;xml&quot;));
print_r(get_extension_funcs(&quot;gd&quot;));
</programlisting>
</informalexample>
will print a list of the functions in the modules <varname>xml</varname>
and <varname>gd</varname> respectively.
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 (&quot;xml&quot;));
print_r (get_extension_funcs (&quot;gd&quot;));
</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>
<para>
See also: <function>get_loaded_extensions</function>
</para>
</refsect1>
</refentry>
@ -956,8 +838,9 @@ print_r(get_extension_funcs(&quot;gd&quot;));
<refnamediv>
<refname>get_required_files</refname>
<refpurpose>
Returns an array with the names of the files require_once()'d in a script
</refpurpose>
Returns an array with the names of the files require_once()'d in
a script
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -968,36 +851,36 @@ print_r(get_extension_funcs(&quot;gd&quot;));
</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
&quot;.php&quot; extension.
</para>
<para>
The example below
<example>
<title>Printing the required and included files</title>
<programlisting>
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 &quot;.php&quot; extension.
</para>
<para>
The example below
<example>
<title>Printing the required and included files</title>
<programlisting>
&lt;?php
require_once(&quot;local.php&quot;);
require_once(&quot;../inc/global.php&quot;);
require_once (&quot;local.php&quot;);
require_once (&quot;../inc/global.php&quot;);
for ($i=1; $i&lt;5; $i++)
include &quot;util&quot;.$i.&quot;php&quot;;
include &quot;util&quot;.$i.&quot;php&quot;;
echo &quot;Required_once files\n&quot;;
print_r(get_required_files());
print_r (get_required_files());
echo &quot;Included_once files\n&quot;;
print_r(get_included_files());
print_r (get_included_files());
?&gt;
</programlisting>
</example>
will generate the following output:
</programlisting>
</example>
will generate the following output:
<informalexample>
<programlisting>
<programlisting>
Required_once files
Array
(
@ -1013,23 +896,23 @@ Array
[util3] =&gt; util3.php
[util4] =&gt; util4.php
)
</programlisting>
</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
&quot;.php&quot;, other extensions do not work.
</para>
</note>
</para>
<para>
See also: <function>require_once</function>,
<para>
<note>
<para>
As of PHP 4.0.1pl2 this function assumes that the
<varname>required_once</varname> files end in the extension
&quot;.php&quot;, 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>
<function>get_included_files</function>
</para>
</refsect1>
</refentry>
@ -1037,8 +920,9 @@ Array
<refnamediv>
<refname>get_included_files</refname>
<refpurpose>
Returns an array with the names of the files include_once()'d in a script
</refpurpose>
Returns an array with the names of the files include_once()'d in
a script
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -1049,31 +933,29 @@ Array
</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
&quot;.php&quot; 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
&quot;.php&quot;, other extensions do not work.
</para>
</note>
</para>
<para>
See also: <function>require_once</function>,
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 &quot;.php&quot; 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
&quot;.php&quot;, 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>
<function>get_required_files</function>
</para>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file

View file

@ -1,5 +1,5 @@
<reference id="ref.math">
<title>Mathematical functions</title>
<title>Mathematical Functions</title>
<titleabbrev>Math.</titleabbrev>
<partintro>
@ -8,7 +8,8 @@
<para>
These math functions will only handle values within the range of
the long and double types on your computer. If you need to
handle bigger numbers, take a look at the <link linkend="ref.bc">arbitrary precision math functions</link>.
handle bigger numbers, take a look at the <link
linkend="ref.bc">arbitrary precision math functions</link>.
</para>
<sect2>
<title>Math constants</title>
@ -307,8 +308,8 @@ $binary = base_convert ($hexadecimal, 16, 2);
get the old behaviour.
</simpara>
<simpara>
See also <function>floor</function> and <function>round</function>
and the <link linkend="warn.float-precision">float precision note</link>.
See also <function>floor</function> and
<function>round</function>.
</simpara>
</refsect1>
</refentry>
@ -478,13 +479,12 @@ $binary = base_convert ($hexadecimal, 16, 2);
get the old behaviour.
</simpara>
<simpara>
See also <function>ceil</function> and <function>round</function>
and the <link linkend="warn.float-precision">float precision note</link>.
See also <function>ceil</function> and
<function>round</function>.
</simpara>
</refsect1>
</refentry>
<refentry id="function.getrandmax">
<refnamediv>
<refname>getrandmax</refname>
@ -956,9 +956,9 @@ $randval = mt_rand();
<funcprototype>
<funcdef>double <function>round</function></funcdef>
<paramdef>double <parameter>val</parameter></paramdef>
<paramdef>
<parameter><optional>int precision</optional></parameter>
</paramdef>
<paramdef>int
<parameter><optional>precision</optional></parameter>
</paramdef>
</funcprototype>
</funcsynopsis>
<para>