philip Tue Jan 25 15:00:28 2005 EDT
Modified files:
/phpdoc/en/reference/misc/functions php-check-syntax.xml
Log:
Rewrote docs. Documented bug #27406, implemented the new doc style, added many
new elements/information such as return values, changelog, and see also. And,
used &example.outputs.similar;.
http://cvs.php.net/diff.php/phpdoc/en/reference/misc/functions/php-check-syntax.xml?r1=1.8&r2=1.9&ty=u
Index: phpdoc/en/reference/misc/functions/php-check-syntax.xml
diff -u phpdoc/en/reference/misc/functions/php-check-syntax.xml:1.8
phpdoc/en/reference/misc/functions/php-check-syntax.xml:1.9
--- phpdoc/en/reference/misc/functions/php-check-syntax.xml:1.8 Wed Nov 10
03:30:32 2004
+++ phpdoc/en/reference/misc/functions/php-check-syntax.xml Tue Jan 25
15:00:24 2005
@@ -1,36 +1,102 @@
<?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.8 $ -->
+<!-- $Revision: 1.9 $ -->
<refentry id="function.php-check-syntax">
<refnamediv>
<refname>php_check_syntax</refname>
<refpurpose>
- Check the PHP syntax of the specified file
+ Check the PHP syntax of (and execute) the specified file
</refpurpose>
</refnamediv>
- <refsect1>
- <title>Description</title>
+ <refsect1 role="description">
+ &reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>php_check_syntax</methodname>
<methodparam><type>string</type><parameter>file_name</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter
role="reference">error_message</parameter></methodparam>
</methodsynopsis>
- <simpara>
- The <function>php_check_syntax</function> function performs a syntax
- (lint) check on the specified <parameter>filename</parameter> testing
- for scripting errors. This is similar to using <command>php -l</command>
- from the <link linkend="features.commandline">commandline</link>.
- </simpara>
- <simpara>
- If the <parameter>error_message</parameter> parameter is used, it will
- contain the error message generated by the syntax check.
<parameter>error_message
- </parameter> is passed by <link linkend="language.references">
- reference</link>.
- </simpara>
- <para>
- The following example shows how this function can be used.
- <example>
- <title><function>php_check_syntax</function> example</title>
- <programlisting role="php">
+ <simpara>
+ The <function>php_check_syntax</function> function performs a syntax
+ (lint) check on the specified <parameter>filename</parameter> testing
+ for scripting errors. This is similar to using <command>php -l</command>
+ from the <link linkend="features.commandline">commandline</link> except
+ <function>php_check_syntax</function> will execute (but not output)
+ the checked <parameter>file_name</parameter>. For example, if a function
+ is defined in <parameter>file_name</parameter>, this defined function will
+ be available to the file that executed
+ <function>php_check_syntax</function>, but output from
+ <parameter>file_name</parameter> will be suppressed.
+ <!-- See PHP bug #27406 for details on this suppression -->
+ </simpara>
+ </refsect1>
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>file_name</parameter></term>
+ <listitem>
+ <para>
+ The name of the file being checked.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>error_message</parameter></term>
+ <listitem>
+ <para>
+ If the <parameter>error_message</parameter> parameter is used, it will
+ contain the error message generated by the syntax check.
+ <parameter>error_message</parameter> is passed by
+ <link linkend="language.references">reference</link>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+ <refsect1 role="returnvalues">
+ &reftitle.returnvalues;
+ <para>
+ Returns &true; if the lint check passed, and &false; if the link check
+ failed or if <parameter>file_name</parameter> cannot be opened.
+ </para>
+ </refsect1>
+ <refsect1 role="changelog">
+ &reftitle.changelog;
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>&Version;</entry>
+ <entry>&Description;</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>5.0.3</entry>
+ <entry>
+ Calling <function>exit</function> after
+ <function>php_check_syntax</function> resulted in a Segfault.
+ </entry>
+ </row>
+ <row>
+ <entry>5.0.1</entry>
+ <entry>
+ <parameter>error_message</parameter> is passed by reference.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><function>php_check_syntax</function> example</title>
+ <programlisting role="php">
<![CDATA[
<?php
@@ -45,19 +111,26 @@
?>
]]>
- </programlisting>
- <simpara>
- The output of the above script could look something like this:
- </simpara>
- <screen>
+ </programlisting>
+ &example.outputs.similar;
+ <screen>
<![CDATA[
Errors were found in the file ./tests.php:
parse error, unexpected T_STRING in /tmp/tests.php on line 81
]]>
- </screen>
- </example>
- </para>
+ </screen>
+ </example>
+ </para>
+ </refsect1>
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>include</function></member>
+ <member><function>is_readable</function></member>
+ </simplelist>
+ </para>
</refsect1>
</refentry>