mirror of
https://github.com/php/doc-it.git
synced 2026-04-26 08:48:05 +02:00
89a29b7764
git-svn-id: https://svn.php.net/repository/phpdoc/it/trunk@178787 c90b9560-bf6c-de11-be94-00142212c4b1
88 lines
3.1 KiB
XML
88 lines
3.1 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- EN-Revision: 1.15 Maintainer: fernando Status: working -->
|
|
<!-- CREDITS: cortesi -->
|
|
<refentry id="function.exec">
|
|
<refnamediv>
|
|
<refname>exec</refname>
|
|
<refpurpose>Esegue un programma esterno</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>exec</methodname>
|
|
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
|
<methodparam choice="opt"><type>array</type><parameter role="reference">output</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter role="reference">return_var</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>exec</function> esegue il comando passato da
|
|
<parameter>command</parameter>, la funzione non invia nessun output.
|
|
Restituisce semplicemente l'ultima linea dal risultato del comando.
|
|
Se si ha bisogno di eseguire un comando ed avere tutti i dati passati
|
|
direttamente indietro senza alcuna interferenza, usare la funzione <function>passthru</function>.
|
|
</para>
|
|
<para>
|
|
Se l'argomento <parameter>output</parameter> è presente, allora tale vettore specificato
|
|
verrà riempito con ogni linea del output del comando.
|
|
I fine riga, come <literal>\n</literal>non sono inclusi
|
|
in questo array. Notare che se il vettore contiene già degli elementi,
|
|
<function>exec</function> li aggiungerà in coda al vettore.
|
|
Se non si vuole che la funzione aggiunga elementi, eseguire un
|
|
<function>unset</function> sul vettore prima di passarlo ad
|
|
<function>exec</function>.
|
|
</para>
|
|
<para>
|
|
Se viene passato l'argomento <parameter>return_var</parameter>
|
|
assieme all'argomento <parameter>output</parameter>, allora lo stato
|
|
del comando eseguito verrà scritto in questa variabile.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Un <function>exec</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// restituisce la username del proprietario del processo php/httpd attivo
|
|
// (su um sistema con l'eseguibile "whoami" nel path)
|
|
echo exec('whoami');
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
&warn.escapeshell;
|
|
¬e.exec-bg;
|
|
¬e.exec-path;
|
|
&warn.sm.exec;
|
|
<para>
|
|
Vedere anche <function>system</function>,
|
|
<function>passthru</function>, <function>popen</function>,
|
|
<function>escapeshellcmd</function>
|
|
<function>pcntl_exec</function> e <link
|
|
linkend="language.operators.execution">l'operatore backtick</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
|
|
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
|
|
-->
|