mirror of
https://github.com/php/doc-fr.git
synced 2026-03-23 22:52:18 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@317608 c90b9560-bf6c-de11-be94-00142212c4b1
80 lines
2.0 KiB
XML
80 lines
2.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: a56106f69198dfe88c6084593c78a71c26b24353 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<chapter xml:id="win32service.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Enregistre un script PHP pour exécuter en tant que service</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
win32_create_service(array(
|
|
'service' => 'dummyphp', # nom du service
|
|
'display' => 'sample dummy PHP service', # description courte
|
|
'description' => 'This is a dummy Windows service created using PHP.', # description longue
|
|
'params' => '"' . __FILE__ . '" run', # chemin vers le script et paramètres
|
|
));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Efface un service</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
win32_delete_service('dummyphp');
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Exécution d'un service</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
if ($argv[1] == 'run') {
|
|
win32_start_service_ctrl_dispatcher('dummyphp');
|
|
|
|
while (WIN32_SERVICE_CONTROL_STOP != win32_get_last_control_message()) {
|
|
# effectuer votre travail ici.
|
|
# essayez de ne pas prendre plus de 30 secondes avant de retourner au
|
|
# début de la boucle
|
|
}
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</chapter>
|
|
|
|
<!-- 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
|
|
-->
|
|
|