mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 16:32:13 +01:00
Use consistent line terminator. git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@317671 c90b9560-bf6c-de11-be94-00142212c4b1
114 lines
2.8 KiB
XML
114 lines
2.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 96c9d88bad9a7d7d44bfb7f26c226df7ee9ddf26 Maintainer: jesusruiz Status: ready -->
|
|
<refentry xml:id='function.ftp-exec' xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>ftp_exec</refname>
|
|
<refpurpose>Solicita la ejecución de un comando en el servidor FTP</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ftp_exec</methodname>
|
|
<methodparam><type>resource</type><parameter>ftp_stream</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Envía un <parameter>command</parameter> de solicitud SITE EXEC al servidor FTP.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>ftp_stream</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El identificador de enlace de la conexión FTP.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>command</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El comando a ejecutar.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve &true; si el comando se ha realizado correctamente (el servidor envía el código de respuesta:
|
|
<literal>200</literal>); en caso contrario devuelve &false;.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de <function>ftp_exec</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
// inicialización de variable
|
|
$command = 'ls -al >files.txt';
|
|
|
|
// establecer una conexión básica
|
|
$conn_id = ftp_connect($ftp_server);
|
|
|
|
// iniciar sesión con nombre de usuario y contraseña
|
|
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
|
|
|
|
// ejecutar comando
|
|
if (ftp_exec($conn_id, $command)) {
|
|
echo "$command ejecutado con éxito\n";
|
|
} else {
|
|
echo "no se pudo ejecutar $command\n";
|
|
}
|
|
|
|
// cerrar la conexión ftp
|
|
ftp_close($conn_id);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>ftp_raw</function></member>
|
|
</simplelist>
|
|
</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:"~/.phpdoc/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
|
|
-->
|