【发布时间】:2020-07-24 13:52:07
【问题描述】:
我正在处理脚本需要等待的事情,然后执行 childFunc,然后返回 childFunc 的结果,然后,脚本继续。类似 async 和 await 的 JavaScript 代码。
<?php
$loginResponse = $system->login($username, $password);
if ($loginResponse !== null && $loginResponse->isTwoFactorRequired()) {
$twoFactorIdentifier = $loginResponse->TwoFactorInfo()->getTwoFactorIdentifier();
// I need to wait here that myChaildFucn LoadView and get data from user and then after some process retuen result!!!!
$verificationCode = myChaildFucn();
$system->checkTwoFactorLogin($username, $password, $twoFactorIdentifier, $verificationCode,);
}
【问题讨论】:
-
您的脚本将始终等待
myChaildFucn的结果。
标签: php codeigniter authentication