toplan / phpsms

:iphone::rocket:Probably the most intelligent, elegant sms send library in php
MIT License
641 stars 129 forks source link

为什么唯独Log Scheme 发送失败 #139

Open tradzero opened 7 years ago

tradzero commented 7 years ago

是这样的 在代码中 使用的是alidayu的scheme, 可以正常使用, 在写测试用例的时候 使用

Config::set('phpsms.scheme', ['Log']);

指定scheme 默认为Log 避免真的发送短信 但是问题来了 在代码环境中使用alidayu代码都能正常运作 甚至注释了Config这段代码 都可以正常运行,唯独在上述代码运作时 返回的success结果为false 这是为什么呢
附上日志及代码
使用send发送回来的结果dump后结果是

array:3 [
  "success" => false
  "time" => array:2 [
    "started_at" => "0.12025000 1504518904"
    "finished_at" => "0.12125500 1504518904"
  ]
  "logs" => array:1 [
    0 => array:4 [
      "driver" => "Log"
      "time" => array:2 [
        "started_at" => "0.12028900 1504518904"
        "finished_at" => "0.12123700 1504518904"
      ]
      "success" => false
      "result" => array:2 [
        "info" => null
        "code" => 0
      ]
    ]
  ]
]

发送的代码

$result = PhpSms::make()
            ->template($template)
            ->to($phone)
            ->data($data)
            ->send();

$template['Alidayu' => env('SMS_ALI_VERIFY_TEMPLATE')] $datacompact('code')