Deprecated: Optional parameter $keys declared before required parameter $cms_id is implicitly treated as a required parameter in /home/www/dev/work/class/blog/CmsKey.php on line 75

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$title is deprecated in /home/www/dev/work/website/lvesu/class/controller/blog/php.php on line 28

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$outlink is deprecated in /home/www/dev/work/website/lvesu/template/blog/cms/php.manual.tpl on line 2

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$status is deprecated in /home/www/dev/work/website/lvesu/template/blog/index.head.php on line 2
PHP - Manual: win32service 函数 - 互联网笔记

略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: win32service 函数

2025-05-11

win32service 函数

目录

添加备注

用户贡献的备注 1 note

up
1
brian dot ngure at gmail dot com
14 years ago
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]);

?>

官方地址:https://www.php.net/manual/en/ref.win32service.php

冷却塔厂家 广告
中文GPT4.0无需注册 广告
北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3