cvs: phpdoc-fr /reference/info/functions php-uname.xml
| From: | Mehdi Achour | Date: | Thu, 25 Sep 2003 07:59:03 +0000 |
| Subject: | cvs: phpdoc-fr /reference/info/functions php-uname.xml | ||
| Groups: | php.doc.fr | ||
| Request: | Send a blank email to doc-fr+get-790@lists.php.net to get a copy of this message | ||
didou Thu Sep 25 03:59:03 2003 EDT
Modified files:
/phpdoc-fr/reference/info/functions php-uname.xml
Log:
sync with en
Index: phpdoc-fr/reference/info/functions/php-uname.xml
diff -u phpdoc-fr/reference/info/functions/php-uname.xml:1.2
phpdoc-fr/reference/info/functions/php-uname.xml:1.3
--- phpdoc-fr/reference/info/functions/php-uname.xml:1.2 Fri May 16 07:35:51 2003
+++ phpdoc-fr/reference/info/functions/php-uname.xml Thu Sep 25 03:59:03 2003
@@ -1,39 +1,87 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- splitted from ./fr/functions/info.xml, last change in rev 1.16 -->
-<!-- last change to 'php-uname' in en/ tree in rev 1.7 -->
- <refentry id="function.php-uname">
- <refnamediv>
- <refname>php_uname</refname>
- <refpurpose>
- Retourne les informations sur le système d'exploitation
- </refpurpose>
- </refnamediv>
- <refsect1>
- <title>Description</title>
- <methodsynopsis>
- <type>string</type><methodname>php_uname</methodname>
- <void/>
- </methodsynopsis>
- <simpara>
- <function>php_uname</function> retourne les informations sur le système
- d'exploitation sur lequel tourne PHP.
- </simpara>
- <para>
- <example>
- <title>Exemple avec <function>php_uname</function></title>
- <programlisting role="php">
+<!-- $Revision: 1.3 $ -->
+<!-- splitted from ./en/functions/info.xml, last change in rev 1.7 -->
+ <refentry id="function.php-uname">
+ <refnamediv>
+ <refname>php_uname</refname>
+ <refpurpose>
+ Retourne les informations sur le système d'exploitation
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <methodsynopsis>
+ <type>string</type><methodname>php_uname</methodname>
+ <void/>
+ </methodsynopsis>
+ <simpara>
+ <function>php_uname</function> retourne une chaîne de
caractères avec des
+ informations 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>.
+ </simpara>
+ <para>
+ <example>
+ <title>Exemples avec <function>php_uname</function></title>
+ <programlisting role="php">
<![CDATA[
<?php
-if (substr(php_uname(), 0, 7) == "Windows") {
- die("Désolé, ce script ne fonctionne pas sous Windows.\n");
+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>
- </refsect1>
- </refentry>
+ </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 :
+ </para>
+ <para>
+ <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
+
+// Win*
+echo DIRECTORY_SEPARATOR; // ;
+echo PHP_SHLIB_SUFFIX; // dll
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ Voir aussi
+ <function>php_version</function>,
+ <function>php_sapi_name</function> et
+ <function>phpinfo</function>.
+ </para>
+ </refsect1>
+ </refentry>
<!-- Keep this comment at the end of the file
Local variables: