ConfigService.php 927 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | EasyAdmin
  4. // +----------------------------------------------------------------------
  5. // | PHP交流群: 763822524
  6. // +----------------------------------------------------------------------
  7. // | 开源协议 https://mit-license.org
  8. // +----------------------------------------------------------------------
  9. // | github开源项目:https://github.com/zhongshaofa/EasyAdmin
  10. // +----------------------------------------------------------------------
  11. namespace app\admin\service;
  12. use think\facade\Cache;
  13. class ConfigService
  14. {
  15. public static function getVersion()
  16. {
  17. $version = Cache('version');
  18. if (empty($version)) {
  19. $version = sysconfig('site', 'site_version');
  20. cache('site_version', $version);
  21. Cache::set('version', $version, 3600);
  22. }
  23. return $version;
  24. }
  25. }