note 97647 added to ref.win32service
| From: | brian dot ngure at gmail dot com | Date: | Fri, 30 Apr 2010 10:03:51 +0000 |
| Subject: | note 97647 added to ref.win32service | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-168806@lists.php.net to get a copy of this message | ||
An example of how it should be done:
<?php
class TestClass {
private $args;
function __construct($arg) {
$this->args = $arg;
$this->run();
}
private function run() {
if ($this->args == 'run') {
win32_start_service_ctrl_dispatcher('test_service');
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
}
}
}
}
$object = new TestClass($argv[1]);
?>
----
Server IP: 69.147.83.197
Probable Submitter: 212.22.186.170
----
Manual Page -- http://www.php.net/manual/en/ref.win32service.php
Edit -- https://master.php.net/note/edit/97647
Del: integrated -- https://master.php.net/note/delete/97647/integrated
Del: useless -- https://master.php.net/note/delete/97647/useless
Del: bad code -- https://master.php.net/note/delete/97647/bad+code
Del: spam -- https://master.php.net/note/delete/97647/spam
Del: non-english -- https://master.php.net/note/delete/97647/non-english
Del: in docs -- https://master.php.net/note/delete/97647/in+docs
Del: other reasons-- https://master.php.net/note/delete/97647
Reject -- https://master.php.net/note/reject/97647
Search -- https://master.php.net/manage/user-notes.php