php-doc-en/reference/ftp/functions/ftp-set-option.xml

88 lines
2.9 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/ftp.xml, last change in rev 1.32 -->
<refentry id='function.ftp-set-option'>
<refnamediv>
<refname>ftp_set_option</refname>
<refpurpose>Set miscellaneous runtime FTP options</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>ftp_set_option</methodname>
<methodparam><type>resource</type><parameter>ftp_stream</parameter></methodparam>
<methodparam><type>int</type><parameter>option</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<note>
<para>
This function is only available in CVS.
</para>
</note>
<para>
Returns &true; if the option could be set; &false; if not. A warning
message will be thrown if the <parameter>option</parameter> is not
supported or the passed <parameter>value</parameter> doesn't match the
expected value for the given <parameter>option</parameter>.
</para>
<para>
This function controls various runtime options for the specified FTP
stream. The <parameter>value</parameter> parameter depends on which
<parameter>option</parameter> parameter is chosen to be altered.
Currently, the following options are supported:
<table>
<title>Supported runtime FTP options</title>
<tgroup cols="2">
<tbody>
<row>
<entry>FTP_TIMEOUT_SEC</entry>
<entry>Changes the timeout in seconds used for all network related
functions. Parameter <parameter>value</parameter> has be to of type
<type>int</type> and must be greater than 0. The default timeout is 90
seconds.</entry>
</row>
<row>
<entry>FTP_AUTOSEEK</entry>
<entry>When enabled (which is the default) get/put requests with
a <parameter>resumepos</parameter>/<parameter>startpos</parameter>
parameter will first seek to the wanted position within the stream.
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
<example>
<title><function>ftp_set_option</function> example</title>
<programlisting role="php">
<![CDATA[
// Set the network timeout down to 10 seconds
ftp_set_option($conn_id, FTP_TIMEOUT_SEC, 10);
]]>
</programlisting>
</example>
</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
indent-tabs-mode:nil
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
-->