1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-26 00:12:06 +01:00
Files
archived-doc-es/reference/win32service/examples.xml
Yago Ferrer 7d2a367e0d Updating files
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@317559 c90b9560-bf6c-de11-be94-00142212c4b1
2011-09-30 22:26:30 +00:00

79 lines
2.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: a56106f69198dfe88c6084593c78a71c26b24353 Maintainer: seros Status: ready -->
<chapter xml:id="win32service.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<para>
<example>
<title>Registrar un script de PHP para ejecutarlo como un servicio</title>
<programlisting role="php">
<![CDATA[
<?php
win32_create_service(array(
'service' => 'dummyphp', # el nombre de su servicio
'display' => 'ejemplo de servicio PHP', # descripción abreviada
'description' => 'Este es un servicio de Windows creado usando PHP.', # descripción larga
'params' => '"' . __FILE__ . '" run', # ruta del script y parámetros
));
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>Dejar de registrar un servicio</title>
<programlisting role="php">
<![CDATA[
<?php
win32_delete_service('dummyphp');
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>Ejecutar como un servicio</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()) {
# hacer su trabajo aquí.
# intente no tomar más de 30 segundos antes de ejecutar de nuevo
# el bucle
}
}
?>
]]>
</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
-->