Config.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace App\Services;
  3. use Pongtan\Services\Config as PongtanConfig;
  4. class Config extends PongtanConfig
  5. {
  6. public static function getPublicConfig()
  7. {
  8. return [
  9. "appName" => self::getAppName(),
  10. "version" => self::get("version"),
  11. "baseUrl" => self::get("baseUrl"),
  12. "checkinTime" => self::get("checkinTime"),
  13. "checkinMin" => self::get("checkinMin"),
  14. "checkinMax" => self::get("checkinMax"),
  15. ];
  16. }
  17. public static function getAppName()
  18. {
  19. $appName = DbConfig::get('app-name');
  20. if ($appName == null || $appName == "") {
  21. return self::get("appName");
  22. }
  23. return $appName;
  24. }
  25. public static function getDbConfig()
  26. {
  27. return [
  28. 'driver' => self::get('db_driver'),
  29. 'host' => self::get('db_host'),
  30. 'port' => self::get('db_port'),
  31. 'database' => self::get('db_database'),
  32. 'username' => self::get('db_username'),
  33. 'password' => self::get('db_password'),
  34. 'charset' => self::get('db_charset'),
  35. 'collation' => self::get('db_collation'),
  36. 'prefix' => self::get('db_prefix')
  37. ];
  38. }
  39. public static function getRssConfig()
  40. {
  41. return [
  42. 'enable_rss' => self::get('enable_rss')
  43. ];
  44. }
  45. public static function getStoragePath($dir)
  46. {
  47. return BASE_PATH . '/storage/' . $dir;
  48. }
  49. }