Core.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace Log\Lib;
  3. use Dever;
  4. class Core
  5. {
  6. protected function file()
  7. {
  8. return Dever::data() . 'log.php';
  9. }
  10. protected function config()
  11. {
  12. $config = include($this->file());
  13. return $config;
  14. }
  15. protected function input($input)
  16. {
  17. if (!is_array($input)) {
  18. $input = Dever::json_decode($input);
  19. }
  20. //$system = Dever::config('base', 'log')->system;
  21. $input['ua'] = Dever::ua();
  22. $input['ck_wechat'] = Dever::weixin();
  23. $input['ck_mobile'] = Dever::mobile();
  24. $input['ip'] = Dever::ip();
  25. $input['os'] = Dever::os();
  26. $input['browser'] = Dever::browser();
  27. if (!isset($input['source'])) {
  28. $input['source'] = -1;
  29. }
  30. if (!isset($input['uid'])) {
  31. $input['uid'] = -1;
  32. }
  33. if (!isset($input['project'])) {
  34. $input['project'] = -1;
  35. }
  36. if (!isset($input['system'])) {
  37. $input['system'] = -1;
  38. }
  39. return $input;
  40. }
  41. }