mirror of
https://github.com/php/doc-es.git
synced 2026-03-24 07:22:16 +01:00
79 lines
2.0 KiB
XML
79 lines
2.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: a56106f69198dfe88c6084593c78a71c26b24353 Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: yes Maintainer: Marqitos -->
|
|
|
|
<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 PHP para ejecutar como servicio</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
win32_create_service(array(
|
|
'service' => 'dummyphp', # nombre del servicio
|
|
'display' => 'sample dummy PHP service', # descripción corta
|
|
'description' => 'This is a dummy Windows service created using PHP.', # descripción larga
|
|
'params' => '"' . __FILE__ . '" run', # ruta hacia el script y argumentos
|
|
));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Eliminar un servicio</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
win32_delete_service('dummyphp');
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Ejecutar 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()) {
|
|
# realizar su trabajo aquí.
|
|
# intente no tomar más de 30 segundos antes de volver al
|
|
# inicio del ciclo
|
|
}
|
|
}
|
|
?>
|
|
]]>
|
|
</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
|
|
-->
|