sapi_windows_set_ctrl_handler() - php 选项信息函数
sapi_windows_set_ctrl_handler()
(PHP 7 >= 7.4.0)
Set or remove a CTRL event handler
说明
sapi_windows_set_ctrl_handler(callable $callable[,bool $add=TRUE
]): boolSets or removes aCTRLevent handler, which allows Windows CLI processes to intercept or ignoreCTRL+CandCTRL+BREAKevents. Note that in multithreaded environments, this is only possible when called from the main thread.
参数
$callableA callback function to set or remove. If set, this function will be called whenever aCTRL+CorCTRL+BREAKevent occurs. The function is supposed to have the following signature:handler(int $event): void$eventTheCTRLevent which has been received;eitherPHP_WINDOWS_EVENT_CTRL_C
orPHP_WINDOWS_EVENT_CTRL_BREAK
.Setting aNULL
$callablecauses the process to ignoreCTRL+Cevents, but notCTRL+BREAKevents.
IfTRUE
, the handler is set.IfFALSE
, the handler is removed.
返回值
成功时返回TRUE
,或者在失败时返回FALSE
。
范例
Basicsapi_windows_set_ctrl_handler()Usage
This example shows how to interceptCTRLevents.
参见
sapi_windows_generate_ctrl_event()
Send a CTRL event to another process
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!