mirror of
https://github.com/php/doc-fr.git
synced 2026-03-29 18:42:07 +02:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@158354 c90b9560-bf6c-de11-be94-00142212c4b1
94 lines
2.6 KiB
XML
94 lines
2.6 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.8 $ -->
|
|
<!-- EN-Revision: 1.9 Maintainer: dams Status: ready -->
|
|
<refentry id="function.system">
|
|
<refnamediv>
|
|
<refname>system</refname>
|
|
<refpurpose>
|
|
Exécute un programme externe et affiche le résultat
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>system</methodname>
|
|
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>return_var</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>system</function> est la version &php; de la fonction C
|
|
qui exécute la commande <parameter>command</parameter> et
|
|
retourne le résultat. Si une variable est fournie comme
|
|
second argument <parameter>return_var</parameter>, alors
|
|
le code de statut de la commande y sera placé.
|
|
</para>
|
|
&warn.escapeshell;
|
|
¬e.exec-bg;
|
|
<para>
|
|
<function>system</function> retourne la dernière ligne du
|
|
retour, en cas de succès, et &false; en
|
|
cas d'échec.
|
|
</para>
|
|
<para>
|
|
Si vous devez exécuter une commande et
|
|
récupérer tout le résultat sans aucune
|
|
intervention, utilisez la fonction <function>passthru</function>.
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>system</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
echo '<pre>';
|
|
|
|
// Affiche le résultat de la commande "ls" et retourne
|
|
// la dernière lignes dans $last_line. Stocke la valeur retournée
|
|
// par la commande shelle dans $retval.
|
|
$last_line = system('ls', $retval);
|
|
|
|
// Affichage d'autres informations
|
|
echo '
|
|
</pre>
|
|
<hr />La dernière ligne lue : ' . $last_line . '
|
|
<hr />Valeur retournée : ' . $retval;
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
¬e.exec-path;
|
|
&warn.sm.exec;
|
|
<para>
|
|
Voir aussi
|
|
<function>exec</function>,
|
|
<function>pcntl_exec</function>,
|
|
<function>passthru</function>,
|
|
<function>popen</function>,
|
|
<function>escapeshellcmd</function> et
|
|
les <link linkend="language.operators.execution">opérateurs de 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
|
|
-->
|