Oss.php 873 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace app\common\library;
  3. use Psr\Log\AbstractLogger;
  4. use think\Hook;
  5. /**
  6. * Oss文件上传
  7. */
  8. class Oss extends AbstractLogger
  9. {
  10. /**
  11. * phpmailer对象
  12. */
  13. protected $mail = null;
  14. /**
  15. * 错误内容
  16. */
  17. protected $error = '';
  18. /**
  19. * 构造函数
  20. * @param array $options
  21. */
  22. public function __construct($options = [])
  23. {
  24. //设置发件人
  25. $this->from($this->options['mail_from'], $this->options['mail_smtp_user']);
  26. }
  27. /**
  28. * Logs with an arbitrary level.
  29. *
  30. * @param mixed $level
  31. * @param string $message
  32. * @param array $context
  33. *
  34. * @return void
  35. *
  36. * @throws \Psr\Log\InvalidArgumentException
  37. */
  38. public function Init($level, $message, array $context = array())
  39. {
  40. \think\Log::write($message);
  41. }
  42. }