mirror of
https://github.com/php/doc-en.git
synced 2026-03-23 23:32:18 +01:00
mailparse: fix XML by converting para to simpara tags via script
This commit is contained in:
@@ -1,40 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
|
||||
<book xml:id="book.mailparse" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="book.mailparse">
|
||||
<?phpdoc extension-membership="pecl" ?>
|
||||
<title>Mailparse</title>
|
||||
|
||||
|
||||
<!-- {{{ preface -->
|
||||
<preface xml:id="intro.mailparse">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
<simpara>
|
||||
Mailparse is an extension for parsing and working with email messages.
|
||||
It can deal with <link xlink:href="&url.rfc;822">RFC 822</link> and <link
|
||||
xlink:href="&url.rfc;2045">RFC 2045</link> (<literal>MIME</literal>) compliant
|
||||
It can deal with <link xlink:href="&url.rfc;822">RFC 822</link> and <link xlink:href="&url.rfc;2045">RFC 2045</link> (<literal>MIME</literal>) compliant
|
||||
messages.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Mailparse is stream based, which means that it does not keep in-memory
|
||||
copies of the files it processes - so it is very resource efficient when
|
||||
dealing with large messages.
|
||||
</para>
|
||||
</simpara>
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
Mailparse requires the <link linkend="book.mbstring">mbstring</link>
|
||||
extension, and mbstring must be loaded before mailparse.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</preface>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
&reference.mailparse.setup;
|
||||
&reference.mailparse.constants;
|
||||
<!-- FIXME: Apparently this is a class.. -->
|
||||
&reference.mailparse.reference;
|
||||
|
||||
</book>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -55,4 +52,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
||||
@@ -1,28 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision$ -->
|
||||
<section xml:id="mailparse.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="mailparse.installation">
|
||||
&reftitle.install;
|
||||
<para xml:id="mailparse.configure">
|
||||
<simpara xml:id="mailparse.configure">
|
||||
&pecl.moved;
|
||||
&pecl.info;
|
||||
<link xlink:href="&url.pecl.package;mailparse">&url.pecl.package;mailparse</link>.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
In order to use these functions you must compile PHP with mailparse support
|
||||
by using the <option role="configure">--enable-mailparse</option> configure
|
||||
by using the <option role="configure">--enable-mailparse</option> configure
|
||||
option.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Windows users will enable <filename>php_mailparse.dll</filename> inside
|
||||
of &php.ini; in order to use these functions.
|
||||
&pecl.windows.download.avail;
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
It is necessary that the <link linkend="ref.mbstring">mbstring</link>
|
||||
extension is loaded before mailparse.
|
||||
</para>
|
||||
</simpara>
|
||||
</section>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
<type>string</type><methodname>mailparse_determine_best_xfer_encoding</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<simpara>
|
||||
Figures out the best way of encoding the content read from the given file
|
||||
pointer.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
@@ -23,9 +23,9 @@
|
||||
<varlistentry>
|
||||
<term><parameter>fp</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid file pointer, which must be seek-able.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -33,10 +33,10 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns one of the character encodings supported by the
|
||||
<link linkend="ref.mbstring">mbstring</link> module.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
<type>resource</type><methodname>mailparse_msg_create</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<simpara>
|
||||
Create a <literal>MIME</literal> mail resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
@@ -23,18 +23,18 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a handle that can be used to parse a message.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
It is recommended to call <function>mailparse_msg_free</function> on the result
|
||||
of this function, when it is no longer needed, to avoid memory leaks.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
<methodparam><type>mixed</type><parameter>filename</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>callable</type><parameter>callbackfunc</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<simpara>
|
||||
Extracts/decodes a message section from the supplied filename.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
The contents of the section will be decoded according to their transfer
|
||||
encoding - base64, quoted-printable and uuencoded text are supported.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
@@ -28,31 +28,31 @@
|
||||
<varlistentry>
|
||||
<term><parameter>mimemail</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>MIME</literal> resource, created with
|
||||
<function>mailparse_msg_create</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>filename</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Can be a file name or a valid stream resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>callbackfunc</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
If set, this must be either a valid callback that will be passed the
|
||||
extracted section, or &null; to make this function return the
|
||||
extracted section.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
If not specified, the contents will be sent to "stdout".
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -60,17 +60,17 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
If <parameter>callbackfunc</parameter> is not &null; returns &true; on
|
||||
success.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
If <parameter>callbackfunc</parameter> is set to &null;, returns the
|
||||
extracted section as a string.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
Returns &false; on error.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
|
||||
@@ -24,23 +24,23 @@
|
||||
<varlistentry>
|
||||
<term><parameter>mimemail</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>MIME</literal> resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>msgbody</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
</para>
|
||||
<simpara>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>callbackfunc</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
</para>
|
||||
<simpara>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -48,9 +48,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.void;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
|
||||
@@ -22,23 +22,23 @@
|
||||
<varlistentry>
|
||||
<term><parameter>mimemail</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>MIME</literal> resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>filename</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
</para>
|
||||
<simpara>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>callbackfunc</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
</para>
|
||||
<simpara>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -46,8 +46,8 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
</para>
|
||||
<simpara>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
<type>bool</type><methodname>mailparse_msg_free</methodname>
|
||||
<methodparam><type>resource</type><parameter>mimemail</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<simpara>
|
||||
Frees a <literal>MIME</literal> resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
@@ -22,11 +22,11 @@
|
||||
<varlistentry>
|
||||
<term><parameter>mimemail</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>MIME</literal> resource allocated by
|
||||
<function>mailparse_msg_create</function> or
|
||||
<function>mailparse_msg_parse_file</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -34,9 +34,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
<varlistentry>
|
||||
<term><parameter>mimemail</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>MIME</literal> resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
@@ -21,16 +21,16 @@
|
||||
<varlistentry>
|
||||
<term><parameter>mimemail</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>MIME</literal> resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>mimesection</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
</para>
|
||||
<simpara>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
<varlistentry>
|
||||
<term><parameter>mimemail</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>MIME</literal> resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
<type>resource</type><methodname>mailparse_msg_parse_file</methodname>
|
||||
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<simpara>
|
||||
Parses a file.
|
||||
This is the optimal way of parsing a mail file that you have on disk.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
@@ -23,15 +23,15 @@
|
||||
<varlistentry>
|
||||
<term><parameter>filename</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
Path to the file holding the message.
|
||||
The file is opened and streamed through the parser.
|
||||
</para>
|
||||
</simpara>
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
The message contained in <parameter>filename</parameter> is supposed to end with a newline
|
||||
(<literal>CRLF</literal>); otherwise the last line of the message will not be parsed.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -40,19 +40,19 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
Returns a <literal>MIME</literal> resource representing the structure, or
|
||||
&false; on error.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
It is recommended to call <function>mailparse_msg_free</function> on the result
|
||||
of this function, when it is no longer needed, to avoid memory leaks.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
<methodparam><type>resource</type><parameter>mimemail</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>data</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<simpara>
|
||||
Incrementally parse data into the supplied mime mail resource.
|
||||
</para>
|
||||
<para>
|
||||
</simpara>
|
||||
<simpara>
|
||||
This function allow you to stream portions of a file at a time, rather
|
||||
than read and parse the whole thing.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
@@ -27,19 +27,19 @@
|
||||
<varlistentry>
|
||||
<term><parameter>mimemail</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid <literal>MIME</literal> resource.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>data</parameter></term>
|
||||
<listitem>
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
The final chunk of <parameter>data</parameter> is supposed to end with a newline
|
||||
(<literal>CRLF</literal>); otherwise the last line of the message will not be parsed.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -48,9 +48,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
<type>array</type><methodname>mailparse_rfc822_parse_addresses</methodname>
|
||||
<methodparam><type>string</type><parameter>addresses</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<simpara>
|
||||
Parses a <link xlink:href="&url.rfc;822">RFC 822</link> compliant recipient
|
||||
list, such as that found in the <literal>To:</literal> header.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
@@ -23,14 +23,14 @@
|
||||
<varlistentry>
|
||||
<term><parameter>addresses</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A string containing addresses, like in:
|
||||
<literal>Wez Furlong <wez@example.com>, doe@example.com</literal>
|
||||
</para>
|
||||
</simpara>
|
||||
<note>
|
||||
<para>
|
||||
<simpara>
|
||||
This string must not include the header name.
|
||||
</para>
|
||||
</simpara>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
<methodparam><type>resource</type><parameter>destfp</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>encoding</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<simpara>
|
||||
Streams data from the source file pointer, apply
|
||||
<parameter>encoding</parameter> and write to the destination file pointer.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
@@ -27,26 +27,26 @@
|
||||
<varlistentry>
|
||||
<term><parameter>sourcefp</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid file handle. The file is streamed through the parser.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>destfp</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The destination file handle in which the encoded data will be written.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>encoding</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
One of the character encodings supported by the
|
||||
<link linkend="ref.mbstring">mbstring</link> module.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -54,9 +54,9 @@
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<simpara>
|
||||
&return.success;
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
<type>array</type><methodname>mailparse_uudecode_all</methodname>
|
||||
<methodparam><type>resource</type><parameter>fp</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<simpara>
|
||||
Scans the data from the given file pointer and extract each embedded
|
||||
uuencoded file into a temporary file.
|
||||
</para>
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
@@ -25,9 +25,9 @@
|
||||
<varlistentry>
|
||||
<term><parameter>fp</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
A valid file pointer.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
@@ -45,9 +45,9 @@
|
||||
<type>string</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<simpara>
|
||||
The default character set.
|
||||
</para>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
@@ -57,11 +57,11 @@
|
||||
<!-- {{{ Resources -->
|
||||
<section xml:id="mailparse.resources">
|
||||
&reftitle.resources;
|
||||
<para>
|
||||
<simpara>
|
||||
Mailparse defines the resource type <literal>mailparse_mail_structure</literal>,
|
||||
which is returned by <function>mailparse_msg_create</function> and
|
||||
<function>mailparse_msg_parse_file</function>.
|
||||
</para>
|
||||
</simpara>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user