WechatSecurityController.php 472 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace console\controllers;
  3. use Yii;
  4. use yii\console\Controller;
  5. /**
  6. * php ./yii wechat-security/run
  7. *
  8. * Class WechatSecurityController
  9. * @package console\controllers
  10. */
  11. class WechatSecurityController extends Controller
  12. {
  13. /**
  14. * 生成配置
  15. */
  16. public function actionRun()
  17. {
  18. $result = Yii::$app->wechat->payment->security->getPublicKey();
  19. file_put_contents(Yii::getAlias('@runtime') . '/public.pem', $result);
  20. }
  21. }
粤ICP备19079148号