mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-27 06:18:56 +00:00

- All id attributes are now xml:id - Add docbook namespace to all root elements - Replace <ulink /> with <link xlink:href /> - Minor markup fixes here and there git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@238160 c90b9560-bf6c-de11-be94-00142212c4b1
132 lines
3.2 KiB
XML
132 lines
3.2 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.6 $ -->
|
|
<!-- Purpose: utilspec.windows -->
|
|
<!-- Membership: pecl -->
|
|
|
|
<reference xml:id="ref.win32service" xmlns="http://docbook.org/ns/docbook">
|
|
<title>win32service Functions</title>
|
|
<titleabbrev>win32service</titleabbrev>
|
|
|
|
<partintro>
|
|
<section xml:id="win32service.intro">
|
|
&reftitle.intro;
|
|
<para>
|
|
The win32service extension is a Windows specific extension that allows PHP
|
|
to communicate with the Service Control Manager to start, stop, register
|
|
and unregister services, and even allows your PHP scripts to run as a
|
|
service.
|
|
</para>
|
|
</section>
|
|
<section xml:id="win32service.requirements">
|
|
&reftitle.required;
|
|
<para>
|
|
Windows NT, Windows 2000, Windows XP or Windows Server 2003. Any version
|
|
of Windows derived from Windows NT should be compatible.
|
|
</para>
|
|
</section>
|
|
<section xml:id="win32service.install">
|
|
&reftitle.install;
|
|
<procedure xml:id="win32service.install-from-pecl">
|
|
<title>Installing from PECL</title>
|
|
<step>
|
|
<para>
|
|
You can download php_win32service.dll from http://snaps.php.net/win32/.
|
|
Choose the PECL_X_X folder that matches you PHP version.
|
|
</para>
|
|
</step>
|
|
<step>
|
|
<para>
|
|
Copy the php_win32service.dll into your <link
|
|
linkend="ini.extension-dir">extension_dir</link>.
|
|
</para>
|
|
</step>
|
|
<step>
|
|
<para>
|
|
Load the extension from your &php.ini;
|
|
<screen>
|
|
<![CDATA[
|
|
extension=php_win32service.dll
|
|
]]>
|
|
</screen>
|
|
</para>
|
|
</step>
|
|
</procedure>
|
|
</section>
|
|
|
|
<section xml:id="win32service.examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Registering a PHP script to run as a service</title>
|
|
<programlisting role='php'>
|
|
<![CDATA[
|
|
<?php
|
|
win32_create_service(array(
|
|
'service' => 'dummyphp', # the name of your service
|
|
'display' => 'sample dummy PHP service', # description
|
|
'params' => 'c:\path\to\script.php run', # path to the script and parameters
|
|
));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Unregistering a service</title>
|
|
<programlisting role='php'>
|
|
<![CDATA[
|
|
<?php
|
|
win32_delete_service('dummyphp');
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Running as a 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()) {
|
|
# do your work here.
|
|
# try not to take up more than 30 seconds before going around the loop
|
|
# again
|
|
}
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</section>
|
|
|
|
&reference.win32service.constants;
|
|
</partintro>
|
|
&reference.win32service.functions;
|
|
</reference>
|
|
|
|
<!-- 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
|
|
-->
|