Subversion Repositories oidplus

Rev

Rev 1442 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1442 Rev 1446
Line 113... Line 113...
113
                        do {
113
                        do {
114
                                // Download and unzip
114
                                // Download and unzip
115
 
115
 
116
                                $cont = false;
116
                                $cont = false;
117
                                $basename = 'changescript_'.$ver.'.txt';
117
                                $basename = 'changescript_'.$ver.'.txt';
-
 
118
                                $url = '';
118
                                for ($retry=1; $retry<=3; $retry++) {
119
                                for ($retry=1; $retry<=3; $retry++) {
-
 
120
                                        $update_packages_candidates = OIDplus::getEditionInfo()['update_packages'];
-
 
121
                                        if (!is_array($update_packages_candidates)) $update_packages_candidates = [ $update_packages_candidates ];
-
 
122
 
-
 
123
                                        foreach ($update_packages_candidates as $update_packages_candidate) {
119
                                        if (function_exists('gzdecode')) {
124
                                                if (function_exists('gzdecode')) {
120
                                                $url = OIDplus::getEditionInfo()['update_packages'].$basename.'.gz';
125
                                                        $url = $update_packages_candidate.$basename.'.gz';
121
                                                $cont = url_get_contents($url);
126
                                                        $cont = url_get_contents($url);
122
                                                if ($cont !== false) $cont = @gzdecode($cont);
127
                                                        if ($cont !== false) $cont = @gzdecode($cont);
123
                                        } else {
128
                                                } else {
124
                                                $url = OIDplus::getEditionInfo()['update_packages'].$basename;
129
                                                        $url = $update_packages_candidate.$basename;
125
                                                $cont = url_get_contents($url);
130
                                                        $cont = url_get_contents($url);
126
                                        }
131
                                                }
-
 
132
 
127
                                        if ($cont !== false) {
133
                                                if ($cont !== false) {
128
                                                break;
134
                                                        break 2;
129
                                        } else {
-
 
130
                                                sleep(1);
-
 
131
                                        }
135
                                                }
132
                                }
136
                                        }
-
 
137
 
-
 
138
                                        sleep(1);
-
 
139
                                }
133
                                if ($cont === false) throw new OIDplusException(_L("Update %1 could not be downloaded from the remote server (%2). Please try again later.",$ver,$url));
140
                                if ($cont === false) throw new OIDplusException(_L("Update %1 could not be downloaded from the remote server (%2). Please try again later.",$ver,$url));
134
 
141
 
135
                                // Check signature...
142
                                // Check signature...
136
 
143
 
137
                                if (function_exists('openssl_verify')) {
144
                                if (function_exists('openssl_verify')) {