PHP
downloads | documentation | faq | getting help | mailing lists | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Fonctions win32service> <Constantes pré-définies
Last updated: Fri, 14 Nov 2008

view this page in

Exemples

Exemple #1 Enregistre un script PHP pour exécuter en tant que service

<?php
win32_create_service
(array(
    
'service' => 'dummyphp',                 # le nom de votre service
    
'display' => 'sample dummy PHP service'# description
    
'params' => 'c:\path\to\script.php run'# chemin au script et paramètres
));
?>

Exemple #2 Efface un service

<?php
win32_delete_service
('dummyphp');
?>

Exemple #3 Exécution d'un service

<?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
  
}
}
?>



add a note add a note User Contributed Notes
Exemples
There are no user contributed notes for this page.

Fonctions win32service> <Constantes pré-définies
Last updated: Fri, 14 Nov 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites