@@ -24,34 +24,26 @@ function get_update_information(){
24
24
);
25
25
26
26
// first read CGI config file to determine main file location
27
- $ ccfc =read_cgi_config_file ();
28
- //print_r($ccfc );
27
+ $ ccf =read_cgi_config_file ();
28
+ //print_r($ccf );
29
29
30
30
// read main config file to determine file locations
31
- if (isset ($ ccf ['main_config_file ' ]))
32
- $ mcf =$ ccf ['main_config_file ' ];
33
- else
34
- $ mcf ="" ;
35
- $ mcfc =read_main_config_file ($ mcf );
36
- //print_r($mcfc);
31
+ $ mcf = isset ($ ccf ['main_config_file ' ]) ? $ ccf ['main_config_file ' ] : "" ;
37
32
38
- if (isset ($ mcf ['status_file ' ]))
39
- $ sf =$ mcf ['status_file ' ];
40
- else
41
- $ sf ="" ;
33
+ $ mcf =read_main_config_file ($ mcf );
34
+ //print_r($mcf);
42
35
43
- if (isset ($ mcf ['state_retention_file ' ]))
44
- $ rf =$ mcf ['state_retention_file ' ];
45
- else
46
- $ rf ="" ;
36
+ $ sf = isset ($ mcf ['status_file ' ]) ? $ mcf ['status_file ' ] : "" ;
37
+
38
+ $ rf = isset ($ mcf ['state_retention_file ' ]) ? $ mcf ['state_retention_file ' ] : "" ;
47
39
48
40
49
41
///////////////////////////////////////////////
50
42
// GET PROGRAM VARIABLES FROM MAIN CONFIG FILE
51
43
///////////////////////////////////////////////
52
44
53
45
// are update checks enabled?
54
- if (isset ($ mcfc ['check_for_updates ' ]) && $ mcfc ['check_for_updates ' ]== "0 " )
46
+ if (isset ($ mcf ['check_for_updates ' ]) && $ mcf ['check_for_updates ' ] == "0 " )
55
47
$ updateinfo ["update_checks_enabled " ]=false ;
56
48
57
49
@@ -68,20 +60,17 @@ function get_update_information(){
68
60
if (isset ($ sfc ['info ' ]['last_update_check ' ])){
69
61
$ updateinfo ["last_update_check " ]=$ sfc ['info ' ]['last_update_check ' ];
70
62
$ updateinfo ["found_update_info " ]=true ;
71
- }
63
+ }
72
64
73
65
// update available
74
66
if (isset ($ sfc ['info ' ]['update_available ' ])){
75
- if ($ sfc ['info ' ]['update_available ' ]=="1 " )
76
- $ updateinfo ["update_available " ]=true ;
77
- else
78
- $ updateinfo ["update_available " ]=false ;
79
- }
67
+ $ updateinfo ["update_available " ] = $ sfc ['info ' ]['update_available ' ] == "1 " ;
68
+ }
80
69
81
70
// update version
82
71
if (isset ($ sfc ['info ' ]['new_version ' ])){
83
72
$ updateinfo ["update_version " ]=$ sfc ['info ' ]['new_version ' ];
84
- }
73
+ }
85
74
86
75
// did we find update information in the status file? if so, we're done
87
76
if ($ updateinfo ["found_update_info " ]==true )
@@ -100,29 +89,24 @@ function get_update_information(){
100
89
//exit();
101
90
102
91
// last update time
103
- if (isset ($ rfc ['info ' ]['last_update_check ' ])){
104
- $ updateinfo ["last_update_check " ]= $ rfc ['info ' ]['last_update_check ' ];
105
- $ updateinfo ["found_update_info " ]= true ;
106
- }
92
+ if (isset ($ rfc ['info ' ]['last_update_check ' ])) {
93
+ $ updateinfo ["last_update_check " ] = $ rfc ['info ' ]['last_update_check ' ];
94
+ $ updateinfo ["found_update_info " ] = true ;
95
+ }
107
96
108
97
// update available
109
- if (isset ($ rfc ['info ' ]['update_available ' ])){
110
- if ($ rfc ['info ' ]['update_available ' ]=="1 " )
111
- $ updateinfo ["update_available " ]=true ;
112
- else
113
- $ updateinfo ["update_available " ]=false ;
114
- }
98
+ if (isset ($ rfc ['info ' ]['update_available ' ])) {
99
+ $ updateinfo ["update_available " ] = $ rfc ['info ' ]['update_available ' ] == "1 " ;
100
+ }
115
101
116
102
// update version
117
103
if (isset ($ rfc ['info ' ]['new_version ' ])){
118
104
$ updateinfo ["update_version " ]=$ rfc ['info ' ]['new_version ' ];
119
- }
105
+ }
120
106
121
107
122
108
return $ updateinfo ;
123
- }
124
-
125
-
109
+ }
126
110
127
111
128
112
////////////////////////////////////////////////////////////////////////////////////////////////
0 commit comments