Blame view

app/Utilities/Info.php 834 Bytes
b7c7a5f6   Alexey Boroda   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
  <?php
  
  namespace App\Utilities;
  
  use DB;
  use App\Models\Common\Company;
  
  class Info
  {
  
      public static function versions()
      {
          $v = array();
  
          $v['akaunting'] = version('short');
  
          $v['php'] = static::phpVersion();
  
          $v['mysql'] = static::mysqlVersion();
  
          return $v;
      }
  
      public static function all()
      {
          $data = static::versions();
  
          $data['token'] = setting('general.api_token');
  
          $data['companies'] = Company::all()->count();
  
          return $data;
      }
  
      public static function phpVersion()
      {
          return phpversion();
      }
    
      public static function mysqlVersion()
      {
          if(env('DB_CONNECTION') === 'mysql')
          {
              return DB::selectOne('select version() as mversion')->mversion;
          }
  
          return "N/A";
      }
  }