mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-04-26 10:08:10 +02:00
7d7388a938
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@274183 c90b9560-bf6c-de11-be94-00142212c4b1
184 lines
4.8 KiB
XML
184 lines
4.8 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.20 $ -->
|
|
<!-- EN-Revision: 1.15 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
|
|
<refentry xml:id="function.php-uname" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>php_uname</refname>
|
|
<refpurpose>Retourne les informations sur le système d'exploitation</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>php_uname</methodname>
|
|
<methodparam choice="opt"><type>string</type><parameter>mode</parameter><initializer>"a"</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>php_uname</function> retourne une description sur le système
|
|
d'exploitation sur lequel tourne PHP.
|
|
Si vous voulez juste savoir le nom du système d'exploitation, utilisez
|
|
plutôt la constante <constant>PHP_OS</constant> mais gardez à l'esprit que cette
|
|
constante contient le nom du système sur lequel PHP a été <emphasis>compilé</emphasis>.
|
|
</para>
|
|
<para>
|
|
Sous Unix, la fonction tente d'afficher les informations du système d'exploitation
|
|
sur lequel PHP a été compilé si elle n'arrive pas à déterminer
|
|
le système d'exploitation courant.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>mode</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<parameter>mode</parameter> est un seul caractère qui définit
|
|
quelles seront les informations à retourner :
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>'a'</literal>: par défaut, contient tous les modes
|
|
de la séquence <literal>"s n r v m"</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>'s'</literal>: nom du système d'exploitation.
|
|
Par exemple, <literal>FreeBSD</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>'n'</literal>: nom de l'hôte. Par exemple,
|
|
<literal>localhost.example.com</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>'r'</literal>: nom de la version. Par exemple,
|
|
<literal>5.1.2-RELEASE</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>'v'</literal>: information sur la version.
|
|
Varie énormément suivant le système d'exploitation.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<literal>'m'</literal>: type de la machine.
|
|
Par exemple, <literal>i386</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne la description, sous la forme d'une &string;.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemples avec <function>php_uname</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
echo php_uname();
|
|
echo PHP_OS;
|
|
|
|
/* Affichages possibles :
|
|
Linux localhost 2.4.21-0.13mdk #1 Fri Mar 14 15:08:06 EST 2003 i686
|
|
Linux
|
|
|
|
FreeBSD localhost 3.2-RELEASE #15: Mon Dec 17 08:46:02 GMT 2001
|
|
FreeBSD
|
|
|
|
Windows NT XN1 5.1 build 2600
|
|
WINNT
|
|
*/
|
|
|
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
|
echo 'Le serveur tourne sous Windows !';
|
|
} else {
|
|
echo 'Le serveur ne tourne pas sous Windows !';
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
Il existe aussi des
|
|
<link linkend="language.constants.predefined">constantes PHP
|
|
pré-définies</link> liées qui peuvent s'avérer utiles, par exemple :
|
|
<example>
|
|
<title>Exemples avec quelques constantes liées au système</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// *nix
|
|
echo DIRECTORY_SEPARATOR; // /
|
|
echo PHP_SHLIB_SUFFIX; // so
|
|
echo PATH_SEPARATOR; // :
|
|
|
|
// Win*
|
|
echo DIRECTORY_SEPARATOR; // \
|
|
echo PHP_SHLIB_SUFFIX; // dll
|
|
echo PATH_SEPARATOR; // ;
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>phpversion</function></member>
|
|
<member><function>php_sapi_name</function></member>
|
|
<member><function>phpinfo</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:"../../../../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
|
|
--> |