Gratulacje, kretor Mój egrafik został zakończony. Jeżeli rejestrowałeś się w tym kreatorze, pamiętaj aby kliknąć w link potwierdzający, wysłany na Twój adres email. Jeżeli tego nie zrobisz, nie będziesz mógł się zalogować, a dodane przez Ciebie wpisy nie zostaną opublikowane.
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.
Przykład 1. Registering a PHP script to run as a service
<?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 )); ?>
Przykład 2. Unregistering a service
<?php win32_delete_service('dummyphp'); ?>
Przykład 3. Running as a service
<?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 } } ?>
Poniższe stałe są zdefiniowane w tym rozszerzeniu i stają się dostępne, gdy
rozszerzenie jest dokompilowane do PHP, lub załadowane dynamicznie przy starcie.