php单独开一个进程导出数据库,php代码有办法实现打开一个进程,写入数据吗?...

php代码有办法实现下面这种情况吗?

在页面上第一次提交用户名和密码,执行一条命令,触发二次验证,触发后,如果不填入验证码,执行那条命令的进程还在

第二次提交验证码,进入到第一次提交的进程,写入验证码,让第一次的进程继续执行

提交的页面如下:

bVbJIWr

以下我的这种写法是实现不了的,因为再执行一次的时候,exec执行的命令会重新发送一次验证码public function save()

{

$account = trim(input('param.account'));

if (!$account) {

$this->error('账号不能为空');

exit;

}

$password = trim(input('param.password'));

if (!$password) {

$this->error('密码不能为空');

exit;

}

$code = trim(input('param.code'));

if (AppIdInfo::check($account)) {

$this->error('账号已存在');

exit;

}

$bundleId = "com.iosdeveloper.test" . gen_uuid();

if (!$code) {

exec("/usr/local/bin/fastlane login user:{$account} pwd:{$password} bundleid:{$bundleId}", $out, $status);

$out = implode(',', $out);

if (stripos('Please enter the 6 digit code', $out) !== false) {

$this->error('需要二次验证,请输入验证码');

exit;

}

} else {

$command = "/usr/local/bin/fastlane login user:{$account} pwd:{$password} bundleid:{$bundleId}";

$fp = @popen($command, "w");

@fputs($fp, $code);

@pclose($fp);

}

$this->success('添加成功!', '/admin/Appid/index');

}

以及这个命令直接在服务器上执行的情况:

bVbJECx

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值