cvs: peardoc /en/package/http/http-download guesscontenttype.xml http-download.xml send.xml setcontentdisposition.xml setcontenttype.xml setdata.xml
setfile.xml setgzip.xml setlastmodified.xml setparams.xml setresource.xml staticsend.xml
| From: | Michael Wallner | Date: | Sat, 04 Oct 2003 17:35:14 +0000 |
| Subject: | cvs: peardoc /en/package/http/http-download guesscontenttype.xml http-download.xml send.xml setcontentdisposition.xml setcontenttype.xml setdata.xml setfile.xml setgzip.xml setlastmodified.xml setparams.xml setresource.xml staticsend.xml |
||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-1553@lists.php.net to get a copy of this message | ||
mike Sat Oct 4 13:35:14 2003 EDT
Added files:
/peardoc/en/package/http/http-download guesscontenttype.xml
http-download.xml send.xml
setcontentdisposition.xml
setcontenttype.xml
setdata.xml setfile.xml
setgzip.xml
setlastmodified.xml
setparams.xml
setresource.xml
staticsend.xml
Log:
initial import
Index: peardoc/en/package/http/http-download/guesscontenttype.xml +++ peardoc/en/package/http/http-download/guesscontenttype.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.guesscontenttype"> <refnamediv> <refname><function>HTTP_Download::guessContentType</function></refname> <refpurpose>Guess content type of file</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::guessContentType</function> </funcdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.guesscontenttype.desc"> &title.desc; <para> Use only if you send a file. </para> <para> This only works if PHP is installed with ext/magic.mime <emphasis>AND</emphasis> php.ini is setup correct! </para> <para> Otherwise it will result in a FATAL ERROR. </para> <para> <emphasis>So be WARNED!</empasis> </para> <para> Returns PEAR_Error if ext/magic.mime is not installed, or content type couldn't be guessed. </para> </refsect1> <refsect1 id="package.http.http-download.guesscontenttype.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.guesscontenttype.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.guesscontenttype.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/http-download.xml +++ peardoc/en/package/http/http-download/http-download.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.http-download"> <refnamediv> <refname>HTTP_Download::HTTP_Download</refname> <refpurpose>Constructor</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'HTTP/Download.php'; </funcsynopsisinfo> <funcprototype> <funcdef> object <function>new HTTP_Download</function> </funcdef> <paramdef> array <parameter><optional>$params = array()</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.http-download.desc"> &title.desc; <para> Creates an instance of an <classname>HTTP_Download</classname> object and sets supplied parameters. </para> </refsect1> <refsect1 id="package.http.http-download.http-download.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> array <parameter>$params</parameter> - An associative array of parameters: <itemizedlist> <listitem> one of: <itemizedlist> <listitem> <para> <parameter>$params['file']</parameter> - filepath </para> </listitem> <listitem> <para> <parameter>$params['data']</parameter> - raw data </para> </listitem> <listitem> <para> <parameter>$params['resource']</parameter> - resource handle </para> </listitem> </itemizedlist> </listitem> <listitem> and any of: <itemizedlist> <listitem> <para> <parameter>$params['gzip']</parameter> - whether to gzip the download </para> </listitem> <listitem> <para> <parameter>$params['lastmodified']</parameter> - unix timestamp of last modification </para> </listitem> <listitem> <para> <parameter>$params['contenttype']</parameter> - content type </para> </listitem> <listitem> <para> <parameter>$params['contentdisposition']</parameter> - content disposition </para> </listitem> </itemizedlist> </listitem> </itemizedlist> </para> </listitem> </itemizedlist> </para> <para> "Content-Disposition" is not HTTP compliant, but most browsers follow this header, so it was borrowed from MIME standard. It looks like this: "Content-Disposition: attachment; filename=example.tgz". </para> </refsect1> <refsect1 id="package.http.http-download.http-download.see"> &title.see; <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setcontentdisposition"> <function>HTTP_Download::setContentDisposition()</function> </link> </para> <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setparams"> <function>HTTP_Download::setParams()</function> </link> </para> </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/send.xml +++ peardoc/en/package/http/http-download/send.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.send"> <refnamediv> <refname><function>HTTP_Download::send</function></refname> <refpurpose>Send file</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::send</function> </funcdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.send.desc"> &title.desc; <para> Send the download. </para> <para> Returns PEAR_Error if: <itemizedlist> <listitem>HTTP headers were already sent</listitem> <listitem>HTTP Range was invalid</listitem> <listitem>Download was 'not modified since'</listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.send.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.send.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.send.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setcontentdisposition.xml +++ peardoc/en/package/http/http-download/setcontentdisposition.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setcontentdisposition"> <refnamediv> <refname> <function>HTTP_Download::setContentDisposition</function> </refname> <refpurpose> Set content disposition </refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> void <function>HTTP_Download::setContentDisposition</function> </funcdef> <paramdef> string <parameter> <optional>$disposition = HTTP_DOWNLOAD_ATTACHMENT</optional> </parameter> </paramdef> <paramdef> string <parameter> <optional>$file_name = null</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setcontentdisposition.desc"> &title.desc; <para> Set content disposition of the download. </para> <para> "Content-Disposition" is not HTTP compliant, but most browsers follow this header, so it was borrowed from MIME standard. It looks like this: "Content-Disposition: attachment; filename=example.tgz". </para> </refsect1> <refsect1 id="package.http.http-download.setcontentdisposition.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> string <parameter> <optional>$disposition = HTTP_DOWNLOAD_ATTACHMENT</optional> </parameter> - the disposition of the download (either 'attachment' or 'inline') </para> </listitem> <listitem> <para> string <parameter> <optional>$file_name = null</optional> </parameter> - the file name the browser's download window should show </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.setcontentdisposition.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setcontenttype.xml +++ peardoc/en/package/http/http-download/setcontenttype.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setcontenttype"> <refnamediv> <refname> <function>HTTP_Download::setContentType</function> </refname> <refpurpose> Set content type </refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::setContentType</function> </funcdef> <paramdef> string <parameter> <optional>$content_type = 'application/x-octetstream'</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setcontenttype.desc"> &title.desc; <para> Set a reasonable content type for the download. </para> <para> Examples: <itemizedlist> <listitem> <para> application/pdf </para> </listitem> <listitem> <para> application/zip </para> </listitem> <listitem> <para> text/css </para> </listitem> </itemizedlist> </para> <para> Returns PEAR_Error if <varname>$content_type</varname> doesn't seem to be valid. </para> </refsect1> <refsect1 id="package.http.http-download.setcontenttype.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> string <parameter> <optional>$content_type = 'application/x-octetstream'</optional> </parameter> - a reasonable content type </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.setcontenttype.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setcontenttype.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setcontenttype.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setdata.xml +++ peardoc/en/package/http/http-download/setdata.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setdata"> <refnamediv> <refname> <function>HTTP_Download::setData</function> </refname> <refpurpose>Set raw data</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> void <function>HTTP_Download::setData</function> </funcdef> <paramdef> mixed <parameter> <optional>$data = null</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setdata.desc"> &title.desc; <para> Set <varname>$data</varname> to null if you want to unset. </para> <para> Otherwise you can send any arbitrary data ie. from a database BLOB. </para> </refsect1> <refsect1 id="package.http.http-download.setdata.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> mixed <parameter> <optional>$data = null</optional> </parameter> - any arbietrary data as string to send or null to unset </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.setdata.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setfile.xml +++ peardoc/en/package/http/http-download/setfile.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setfile"> <refnamediv> <refname> <function>HTTP_Download::setFile</function> </refname> <refpurpose> Set file path </refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::setFile</function> </funcdef> <paramdef> string <parameter>$file</parameter> </paramdef> <paramdef> bool <parameter> <optional>$send_404 = true</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setfile.desc"> &title.desc; <para> Set the path to the file for the download. </para> </refsect1> <refsect1 id="package.http.http-download.setfile.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> string <parameter>$file</parameter> - file path </para> </listitem> <listitem> <para> bool <parameter> <optional>$send_404 = true</optional> </parameter> - whether to send "HTTP 404 File Not Found", if file couldn't be found </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.setfile.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setfile.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setfile.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setgzip.xml +++ peardoc/en/package/http/http-download/setgzip.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setgzip"> <refnamediv> <refname> <function>HTTP_Download::setGzip</function> </refname> <refpurpose> Whether to gzip the download on the fly or not. (requires ext/zlib) </refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::setGzip</function> </funcdef> <paramdef> bool <parameter> <optional>$gzip = false</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setgzip.desc"> &title.desc; <para> Define whether you want to send the download gzipped or not. </para> <para> Returns a PEAR_Error if ext/zlib is not available. </para> </refsect1> <refsect1 id="package.http.http-download.setgzip.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> bool <parameter> <optional>$gzip = false</optional> </parameter> - whether to gzip the download on the fly </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.setgzip.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setgzip.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setgzip.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setlastmodified.xml +++ peardoc/en/package/http/http-download/setlastmodified.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setlastmodified"> <refnamediv> <refname> <function>HTTP_Download::setLastModified</function> </refname> <refpurpose> Set "Last-Modified" </refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> void <function>HTTP_Download::setLastModified</function> </funcdef> <paramdef> int <parameter>$last_modified</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setlastmodified.desc"> &title.desc; <para> Set the time (unix timestamp) of last modification of the download. </para> <para> This is usually determined by filemtime(<varname>$file</varname>) in <link linkend="package.http.http-download.setfile">setFile</link>(). </para> </refsect1> <refsect1 id="package.http.http-download.setlastmodified.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> int <parameter>$last_modified</parameter> - unix timestamp of last modification time </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.setlastmodified.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setparams.xml +++ peardoc/en/package/http/http-download/setparams.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setparams"> <refnamediv> <refname> <function>HTTP_Download::setParams</function> </refname> <refpurpose>Set various parameters</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::setParams</function> </funcdef> <paramdef> array <parameter>$params</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setparams.desc"> &title.desc; <para> Set the parameters for the download. </para> <para> You can use this method as an alternative to passing the parameters in the <link linkend="package.http.http-download.http-download"> constructor </link> or calling the setter of each parameter. </para> </refsec1> <refsect1 id="package.http.http-download.http-download.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> array <parameter>$params</parameter> - An associative array of parameters: <itemizedlist> <listitem> one of: <itemizedlist> <listitem> <para> <parameter>$params['file']</parameter> - filepath </para> </listitem> <listitem> <para> <parameter>$params['data']</parameter> - raw data </para> </listitem> <listitem> <para> <parameter>$params['resource']</parameter> - resource handle </para> </listitem> </itemizedlist> </listitem> <listitem> and any of: <itemizedlist> <listitem> <para> <parameter>$params['gzip']</parameter> - whether to gzip the download </para> </listitem> <listitem> <para> <parameter>$params['lastmodified']</parameter> - unix timestamp of last modification </para> </listitem> <listitem> <para> <parameter>$params['contenttype']</parameter> - content type </para> </listitem> <listitem> <para> <parameter>$params['contentdisposition']</parameter> - content disposition </para> </listitem> </itemizedlist> </listitem> </itemizedlist> </para> </listitem> </itemizedlist> </para> <para> "Content-Disposition" is not HTTP compliant, but most browsers follow this header, so it was borrowed from MIME standard. </para> <para> It looks like this:<br /> "Content-Disposition: attachment; filename=example.tgz". </para> </refsect1> <refsect1 id="package.http.http-download.http-download.see"> &title.see; <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setfile"> <function>HTTP_Download::setFile()</function> </link> </para> <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setdata"> <function>HTTP_Download::setData()</function> </link> </para> <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setrecource"> <function>HTTP_Download::setResource()</function> </link> </para> <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setgzip"> <function>HTTP_Download::setGzip()</function> </link> </para> <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setcontenttype"> <function>HTTP_Download::setContentType()</function> </link> </para> <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setlastmodified"> <function>HTTP_Download::setLastModified()</function> </link> </para> <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setcontentdisposition"> <function>HTTP_Download::setContentDisposition()</function> </link> </para> </refsect1> <refsect1 id="package.http.http-download.setparams.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setparams.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setparams.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setresource.xml +++ peardoc/en/package/http/http-download/setresource.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setresource"> <refnamediv> <refname><function>HTTP_Download::setResource</function></refname> <refpurpose>Set resource for download</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::setResource</function> </funcdef> <paramdef> mixed <parameter> <optional>$handle = null</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setresource.desc"> &title.desc; <para> Set the resource handle to retrieve the data for the download. </para> <para> The resource handle supplied will be closed after sending the download. </para> <para> Set <varname>$handle</varname> to null if you want to unset. </para> <para> Returns a PEAR_Error if <varname>$handle</varname> is no valid resource or not null. </para> </refsect1> <refsect1 id="package.http.http-download.setresource.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> mixed <parameter> <optional>$handle = null</optional> </parameter> - (int) resource handle or null </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.setresource.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setresource.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setresource.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/staticsend.xml +++ peardoc/en/package/http/http-download/staticsend.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.staticsend"> <refnamediv> <refname> <function>HTTP_Download::staticSend</function> </refname> <refpurpose> Static send </refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::staticSend</function> </funcdef> <paramdef> array <parameter>$params</parameter> </paramdef> <paramdef> bool <parameter> <optional>$guess = false</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.staticsend.desc"> &title.desc; <para> Send a download statically without instantiating an HTTP_Download object. </para> </refsect1> <refsect1 id="package.http.http-download.staticsend.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> array <parameter>$params</parameter> - An associative array of parameters: <itemizedlist> <listitem> one of: <itemizedlist> <listitem> <para> <parameter>$params['file']</parameter> - filepath </para> </listitem> <listitem> <para> <parameter>$params['data']</parameter> - raw data </para> </listitem> <listitem> <para> <parameter>$params['resource']</parameter> - resource handle </para> </listitem> </itemizedlist> </listitem> <listitem> and any of: <itemizedlist> <listitem> <para> <parameter>$params['gzip']</parameter> - whether to gzip the download </para> </listitem> <listitem> <para> <parameter>$params['lastmodified']</parameter> - unix timestamp of last modification </para> </listitem> <listitem> <para> <parameter>$params['contenttype']</parameter> - content type </para> </listitem> <listitem> <para> <parameter>$params['contentdisposition']</parameter> - content disposition </para> </listitem> </itemizedlist> </listitem> </itemizedlist> </para> </listitem> <listitem> <para> bool <parameter> <optional>$guess = false</optional> </parameter> - whether to call <link linkend="package.http.http-download.guesscontenttype">guessContnentType</link>() </para> </listitem> </itemizedlist> </para> <para> "Content-Disposition" is not HTTP compliant, but most browsers follow this header, so it was borrowed from MIME standard. </para> <para> It looks like this:<br /> "Content-Disposition: attachment; filename=example.tgz". </para> </refsect1> <refsect1 id="package.http.http-download.staticsend.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.staticsend.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.staticsend.note"> &title.note; ¬e.canstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
Index: peardoc/en/package/http/http-download/guesscontenttype.xml +++ peardoc/en/package/http/http-download/guesscontenttype.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.guesscontenttype"> <refnamediv> <refname><function>HTTP_Download::guessContentType</function></refname> <refpurpose>Guess content type of file</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::guessContentType</function> </funcdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.guesscontenttype.desc"> &title.desc; <para> Use only if you send a file. </para> <para> This only works if PHP is installed with ext/magic.mime <emphasis>AND</emphasis> php.ini is setup correct! </para> <para> Otherwise it will result in a FATAL ERROR. </para> <para> <emphasis>So be WARNED!</empasis> </para> <para> Returns PEAR_Error if ext/magic.mime is not installed, or content type couldn't be guessed. </para> </refsect1> <refsect1 id="package.http.http-download.guesscontenttype.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.guesscontenttype.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.guesscontenttype.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/http-download.xml +++ peardoc/en/package/http/http-download/http-download.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.http-download"> <refnamediv> <refname>HTTP_Download::HTTP_Download</refname> <refpurpose>Constructor</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'HTTP/Download.php'; </funcsynopsisinfo> <funcprototype> <funcdef> object <function>new HTTP_Download</function> </funcdef> <paramdef> array <parameter><optional>$params = array()</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.http-download.desc"> &title.desc; <para> Creates an instance of an <classname>HTTP_Download</classname> object and sets supplied parameters. </para> </refsect1> <refsect1 id="package.http.http-download.http-download.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> array <parameter>$params</parameter> - An associative array of parameters: <itemizedlist> <listitem> one of: <itemizedlist> <listitem> <para> <parameter>$params['file']</parameter> - filepath </para> </listitem> <listitem> <para> <parameter>$params['data']</parameter> - raw data </para> </listitem> <listitem> <para> <parameter>$params['resource']</parameter> - resource handle </para> </listitem> </itemizedlist> </listitem> <listitem> and any of: <itemizedlist> <listitem> <para> <parameter>$params['gzip']</parameter> - whether to gzip the download </para> </listitem> <listitem> <para> <parameter>$params['lastmodified']</parameter> - unix timestamp of last modification </para> </listitem> <listitem> <para> <parameter>$params['contenttype']</parameter> - content type </para> </listitem> <listitem> <para> <parameter>$params['contentdisposition']</parameter> - content disposition </para> </listitem> </itemizedlist> </listitem> </itemizedlist> </para> </listitem> </itemizedlist> </para> <para> "Content-Disposition" is not HTTP compliant, but most browsers follow this header, so it was borrowed from MIME standard. It looks like this: "Content-Disposition: attachment; filename=example.tgz". </para> </refsect1> <refsect1 id="package.http.http-download.http-download.see"> &title.see; <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setcontentdisposition"> <function>HTTP_Download::setContentDisposition()</function> </link> </para> <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setparams"> <function>HTTP_Download::setParams()</function> </link> </para> </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/send.xml +++ peardoc/en/package/http/http-download/send.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.send"> <refnamediv> <refname><function>HTTP_Download::send</function></refname> <refpurpose>Send file</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::send</function> </funcdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.send.desc"> &title.desc; <para> Send the download. </para> <para> Returns PEAR_Error if: <itemizedlist> <listitem>HTTP headers were already sent</listitem> <listitem>HTTP Range was invalid</listitem> <listitem>Download was 'not modified since'</listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.send.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.send.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.send.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setcontentdisposition.xml +++ peardoc/en/package/http/http-download/setcontentdisposition.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setcontentdisposition"> <refnamediv> <refname> <function>HTTP_Download::setContentDisposition</function> </refname> <refpurpose> Set content disposition </refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> void <function>HTTP_Download::setContentDisposition</function> </funcdef> <paramdef> string <parameter> <optional>$disposition = HTTP_DOWNLOAD_ATTACHMENT</optional> </parameter> </paramdef> <paramdef> string <parameter> <optional>$file_name = null</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setcontentdisposition.desc"> &title.desc; <para> Set content disposition of the download. </para> <para> "Content-Disposition" is not HTTP compliant, but most browsers follow this header, so it was borrowed from MIME standard. It looks like this: "Content-Disposition: attachment; filename=example.tgz". </para> </refsect1> <refsect1 id="package.http.http-download.setcontentdisposition.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> string <parameter> <optional>$disposition = HTTP_DOWNLOAD_ATTACHMENT</optional> </parameter> - the disposition of the download (either 'attachment' or 'inline') </para> </listitem> <listitem> <para> string <parameter> <optional>$file_name = null</optional> </parameter> - the file name the browser's download window should show </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.setcontentdisposition.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setcontenttype.xml +++ peardoc/en/package/http/http-download/setcontenttype.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setcontenttype"> <refnamediv> <refname> <function>HTTP_Download::setContentType</function> </refname> <refpurpose> Set content type </refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::setContentType</function> </funcdef> <paramdef> string <parameter> <optional>$content_type = 'application/x-octetstream'</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setcontenttype.desc"> &title.desc; <para> Set a reasonable content type for the download. </para> <para> Examples: <itemizedlist> <listitem> <para> application/pdf </para> </listitem> <listitem> <para> application/zip </para> </listitem> <listitem> <para> text/css </para> </listitem> </itemizedlist> </para> <para> Returns PEAR_Error if <varname>$content_type</varname> doesn't seem to be valid. </para> </refsect1> <refsect1 id="package.http.http-download.setcontenttype.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> string <parameter> <optional>$content_type = 'application/x-octetstream'</optional> </parameter> - a reasonable content type </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.setcontenttype.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setcontenttype.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setcontenttype.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setdata.xml +++ peardoc/en/package/http/http-download/setdata.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setdata"> <refnamediv> <refname> <function>HTTP_Download::setData</function> </refname> <refpurpose>Set raw data</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> void <function>HTTP_Download::setData</function> </funcdef> <paramdef> mixed <parameter> <optional>$data = null</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setdata.desc"> &title.desc; <para> Set <varname>$data</varname> to null if you want to unset. </para> <para> Otherwise you can send any arbitrary data ie. from a database BLOB. </para> </refsect1> <refsect1 id="package.http.http-download.setdata.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> mixed <parameter> <optional>$data = null</optional> </parameter> - any arbietrary data as string to send or null to unset </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.setdata.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setfile.xml +++ peardoc/en/package/http/http-download/setfile.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setfile"> <refnamediv> <refname> <function>HTTP_Download::setFile</function> </refname> <refpurpose> Set file path </refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::setFile</function> </funcdef> <paramdef> string <parameter>$file</parameter> </paramdef> <paramdef> bool <parameter> <optional>$send_404 = true</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setfile.desc"> &title.desc; <para> Set the path to the file for the download. </para> </refsect1> <refsect1 id="package.http.http-download.setfile.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> string <parameter>$file</parameter> - file path </para> </listitem> <listitem> <para> bool <parameter> <optional>$send_404 = true</optional> </parameter> - whether to send "HTTP 404 File Not Found", if file couldn't be found </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.setfile.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setfile.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setfile.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setgzip.xml +++ peardoc/en/package/http/http-download/setgzip.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setgzip"> <refnamediv> <refname> <function>HTTP_Download::setGzip</function> </refname> <refpurpose> Whether to gzip the download on the fly or not. (requires ext/zlib) </refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::setGzip</function> </funcdef> <paramdef> bool <parameter> <optional>$gzip = false</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setgzip.desc"> &title.desc; <para> Define whether you want to send the download gzipped or not. </para> <para> Returns a PEAR_Error if ext/zlib is not available. </para> </refsect1> <refsect1 id="package.http.http-download.setgzip.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> bool <parameter> <optional>$gzip = false</optional> </parameter> - whether to gzip the download on the fly </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.setgzip.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setgzip.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setgzip.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setlastmodified.xml +++ peardoc/en/package/http/http-download/setlastmodified.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setlastmodified"> <refnamediv> <refname> <function>HTTP_Download::setLastModified</function> </refname> <refpurpose> Set "Last-Modified" </refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> void <function>HTTP_Download::setLastModified</function> </funcdef> <paramdef> int <parameter>$last_modified</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setlastmodified.desc"> &title.desc; <para> Set the time (unix timestamp) of last modification of the download. </para> <para> This is usually determined by filemtime(<varname>$file</varname>) in <link linkend="package.http.http-download.setfile">setFile</link>(). </para> </refsect1> <refsect1 id="package.http.http-download.setlastmodified.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> int <parameter>$last_modified</parameter> - unix timestamp of last modification time </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.setlastmodified.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setparams.xml +++ peardoc/en/package/http/http-download/setparams.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setparams"> <refnamediv> <refname> <function>HTTP_Download::setParams</function> </refname> <refpurpose>Set various parameters</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::setParams</function> </funcdef> <paramdef> array <parameter>$params</parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setparams.desc"> &title.desc; <para> Set the parameters for the download. </para> <para> You can use this method as an alternative to passing the parameters in the <link linkend="package.http.http-download.http-download"> constructor </link> or calling the setter of each parameter. </para> </refsec1> <refsect1 id="package.http.http-download.http-download.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> array <parameter>$params</parameter> - An associative array of parameters: <itemizedlist> <listitem> one of: <itemizedlist> <listitem> <para> <parameter>$params['file']</parameter> - filepath </para> </listitem> <listitem> <para> <parameter>$params['data']</parameter> - raw data </para> </listitem> <listitem> <para> <parameter>$params['resource']</parameter> - resource handle </para> </listitem> </itemizedlist> </listitem> <listitem> and any of: <itemizedlist> <listitem> <para> <parameter>$params['gzip']</parameter> - whether to gzip the download </para> </listitem> <listitem> <para> <parameter>$params['lastmodified']</parameter> - unix timestamp of last modification </para> </listitem> <listitem> <para> <parameter>$params['contenttype']</parameter> - content type </para> </listitem> <listitem> <para> <parameter>$params['contentdisposition']</parameter> - content disposition </para> </listitem> </itemizedlist> </listitem> </itemizedlist> </para> </listitem> </itemizedlist> </para> <para> "Content-Disposition" is not HTTP compliant, but most browsers follow this header, so it was borrowed from MIME standard. </para> <para> It looks like this:<br /> "Content-Disposition: attachment; filename=example.tgz". </para> </refsect1> <refsect1 id="package.http.http-download.http-download.see"> &title.see; <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setfile"> <function>HTTP_Download::setFile()</function> </link> </para> <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setdata"> <function>HTTP_Download::setData()</function> </link> </para> <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setrecource"> <function>HTTP_Download::setResource()</function> </link> </para> <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setgzip"> <function>HTTP_Download::setGzip()</function> </link> </para> <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setcontenttype"> <function>HTTP_Download::setContentType()</function> </link> </para> <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setlastmodified"> <function>HTTP_Download::setLastModified()</function> </link> </para> <para> <emphasis>see</emphasis> <link linkend="package.http.http-download.setcontentdisposition"> <function>HTTP_Download::setContentDisposition()</function> </link> </para> </refsect1> <refsect1 id="package.http.http-download.setparams.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setparams.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setparams.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/setresource.xml +++ peardoc/en/package/http/http-download/setresource.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.setresource"> <refnamediv> <refname><function>HTTP_Download::setResource</function></refname> <refpurpose>Set resource for download</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::setResource</function> </funcdef> <paramdef> mixed <parameter> <optional>$handle = null</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.setresource.desc"> &title.desc; <para> Set the resource handle to retrieve the data for the download. </para> <para> The resource handle supplied will be closed after sending the download. </para> <para> Set <varname>$handle</varname> to null if you want to unset. </para> <para> Returns a PEAR_Error if <varname>$handle</varname> is no valid resource or not null. </para> </refsect1> <refsect1 id="package.http.http-download.setresource.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> mixed <parameter> <optional>$handle = null</optional> </parameter> - (int) resource handle or null </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.http.http-download.setresource.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setresource.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.setresource.note"> &title.note; ¬e.notstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: peardoc/en/package/http/http-download/staticsend.xml +++ peardoc/en/package/http/http-download/staticsend.xml <!-- $Revision: 1.1 $ --> <refentry id="package.http.http-download.staticsend"> <refnamediv> <refname> <function>HTTP_Download::staticSend</function> </refname> <refpurpose> Static send </refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef> mixed <function>HTTP_Download::staticSend</function> </funcdef> <paramdef> array <parameter>$params</parameter> </paramdef> <paramdef> bool <parameter> <optional>$guess = false</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.http.http-download.staticsend.desc"> &title.desc; <para> Send a download statically without instantiating an HTTP_Download object. </para> </refsect1> <refsect1 id="package.http.http-download.staticsend.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> array <parameter>$params</parameter> - An associative array of parameters: <itemizedlist> <listitem> one of: <itemizedlist> <listitem> <para> <parameter>$params['file']</parameter> - filepath </para> </listitem> <listitem> <para> <parameter>$params['data']</parameter> - raw data </para> </listitem> <listitem> <para> <parameter>$params['resource']</parameter> - resource handle </para> </listitem> </itemizedlist> </listitem> <listitem> and any of: <itemizedlist> <listitem> <para> <parameter>$params['gzip']</parameter> - whether to gzip the download </para> </listitem> <listitem> <para> <parameter>$params['lastmodified']</parameter> - unix timestamp of last modification </para> </listitem> <listitem> <para> <parameter>$params['contenttype']</parameter> - content type </para> </listitem> <listitem> <para> <parameter>$params['contentdisposition']</parameter> - content disposition </para> </listitem> </itemizedlist> </listitem> </itemizedlist> </para> </listitem> <listitem> <para> bool <parameter> <optional>$guess = false</optional> </parameter> - whether to call <link linkend="package.http.http-download.guesscontenttype">guessContnentType</link>() </para> </listitem> </itemizedlist> </para> <para> "Content-Disposition" is not HTTP compliant, but most browsers follow this header, so it was borrowed from MIME standard. </para> <para> It looks like this:<br /> "Content-Disposition: attachment; filename=example.tgz". </para> </refsect1> <refsect1 id="package.http.http-download.staticsend.return"> &title.return; <para> <emphasis>return</emphasis> mixed - true on success or PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.staticsend.throws"> &title.throws; <para> <emphasis>throws</emphasis> PEAR_Error </para> </refsect1> <refsect1 id="package.http.http-download.staticsend.note"> &title.note; ¬e.canstatic; </refsect1> </refentry> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->