Subversion Repositories oidplus

Rev

Rev 698 | Rev 700 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 698 Rev 699
Line 75... Line 75...
75
                                $rev = $params['rev'];
75
                                $rev = $params['rev'];
76
 
76
 
77
                                // Download and unzip
77
                                // Download and unzip
78
 
78
 
79
                                if (function_exists('gzdecode')) {
79
                                if (function_exists('gzdecode')) {
80
                                        $url = sprintf(parse_ini_file(__DIR__.'/consts.ini')['update_package_gz'], $rev-1, $rev);
80
                                        $url = sprintf(OIDplus::getEditionInfo()['update_package_gz'], $rev-1, $rev);
81
                                        $cont = url_get_contents($url);
81
                                        $cont = url_get_contents($url);
82
                                        if ($cont !== false) $cont = @gzdecode($cont);
82
                                        if ($cont !== false) $cont = @gzdecode($cont);
83
                                } else {
83
                                } else {
84
                                        $url = sprintf(parse_ini_file(__DIR__.'/consts.ini')['update_package'], $rev-1, $rev);
84
                                        $url = sprintf(OIDplus::getEditionInfo()['update_package'], $rev-1, $rev);
85
                                        $cont = url_get_contents($url);
85
                                        $cont = url_get_contents($url);
86
                                }
86
                                }
87
 
87
 
88
                                if ($cont === false) throw new OIDplusException(_L("Update %1 could not be downloaded from ViaThinkSoft server. Please try again later.",$rev));
88
                                if ($cont === false) throw new OIDplusException(_L("Update %1 could not be downloaded from ViaThinkSoft server. Please try again later.",$rev));
89
 
89
 
Line 153... Line 153...
153
 
153
 
154
                        $out['text'] .= '<div id="update_versioninfo">';
154
                        $out['text'] .= '<div id="update_versioninfo">';
155
 
155
 
156
                        $out['text'] .= '<p><u>'._L('There are three possibilities how to keep OIDplus up-to-date').':</u></p>';
156
                        $out['text'] .= '<p><u>'._L('There are three possibilities how to keep OIDplus up-to-date').':</u></p>';
157
 
157
 
-
 
158
                        if (isset(OIDplus::getEditionInfo()['gitrepo']) && (OIDplus::getEditionInfo()['gitrepo'] != '')) {
158
                        $out['text'] .= '<p><b>'._L('Method A').'</b>: '._L('Install OIDplus using the subversion tool in your SSH/Linux shell using the command <code>svn co %1</code> and update it regularly with the command <code>svn update</code> . This will automatically download the latest version and check for conflicts. Highly recommended if you have a Shell/SSH access to your webspace!',htmlentities(parse_ini_file(__DIR__.'/consts.ini')['svn']).'/trunk').'</p>';
159
                                $out['text'] .= '<p><b>'._L('Method A').'</b>: '._L('Install OIDplus using the subversion tool in your SSH/Linux shell using the command <code>svn co %1</code> and update it regularly with the command <code>svn update</code> . This will automatically download the latest version and check for conflicts. Highly recommended if you have a Shell/SSH access to your webspace!',htmlentities(OIDplus::getEditionInfo()['svnrepo'])).'</p>';
-
 
160
                        } else {
-
 
161
                                $out['text'] .= '<p><b>'._L('Method A').'</b>: '._L('Distribution via %1 is not possible with this edition of OIDplus','GIT').'</p>';
-
 
162
                        }
159
 
163
 
-
 
164
                        if (isset(OIDplus::getEditionInfo()['svnrepo']) && (OIDplus::getEditionInfo()['svnrepo'] != '')) {
160
                        $out['text'] .= '<p><b>'._L('Method B').'</b>: '._L('Install OIDplus using the Git client in your SSH/Linux shell using the command <code>git clone %1</code> and update it regularly with the command <code>git pull</code> . This will automatically download the latest version and check for conflicts. Highly recommended if you have a Shell/SSH access to your webspace!','https://github.com/danielmarschall/oidplus.git').'</p>';
165
                                $out['text'] .= '<p><b>'._L('Method B').'</b>: '._L('Install OIDplus using the Git client in your SSH/Linux shell using the command <code>git clone %1</code> and update it regularly with the command <code>git pull</code> . This will automatically download the latest version and check for conflicts. Highly recommended if you have a Shell/SSH access to your webspace!',htmlentities(OIDplus::getEditionInfo()['gitrepo'].'.git')).'</p>';
-
 
166
                        } else {
-
 
167
                                $out['text'] .= '<p><b>'._L('Method B').'</b>: '._L('Distribution via %1 is not possible with this edition of OIDplus','SVN').'</p>';
-
 
168
                        }
-
 
169
 
-
 
170
                        if (isset(OIDplus::getEditionInfo()['downloadpage']) && (OIDplus::getEditionInfo()['downloadpage'] != '')) {
-
 
171
                                $out['text'] .= '<p><b>'._L('Method C').'</b>: '._L('Install OIDplus by downloading a TAR.GZ file from %1, which contains an SVN snapshot, and extract it to your webspace. The TAR.GZ file contains a file named ".version.php" which contains the SVN revision of the snapshot. This update-tool will then try to update your files on-the-fly by downloading them from the ViaThinkSoft SVN repository directly into your webspace directory. A change conflict detection is NOT implemented. It is required that the files on your webspace have create/write/delete permissions. Only recommended if you have no access to the SSH/Linux shell.','<a href="'.OIDplus::getEditionInfo()['downloadpage'].'">'.parse_url(OIDplus::getEditionInfo()['downloadpage'])['host'].'</a>').'</p>';
-
 
172
                        } else {
-
 
173
                                $out['text'] .= '<p><b>'._L('Method C').'</b>: '._L('Distribution via %1 is not possible with this edition of OIDplus','Snapshot').'</p>';
-
 
174
                        }
161
 
175
 
162
                        $out['text'] .= '<p><b>'._L('Method C').'</b>: '._L('Install OIDplus by downloading a TAR.GZ file from www.viathinksoft.com, which contains an SVN snapshot, and extract it to your webspace. The TAR.GZ file contains a file named ".version.php" which contains the SVN revision of the snapshot. This update-tool will then try to update your files on-the-fly by downloading them from the ViaThinkSoft SVN repository directly into your webspace directory. A change conflict detection is NOT implemented. It is required that the files on your webspace have create/write/delete permissions. Only recommended if you have no access to the SSH/Linux shell.').'</p>';
-
 
163
 
176
 
164
                        $out['text'] .= '<hr>';
177
                        $out['text'] .= '<hr>';
165
 
178
 
166
                        $installType = OIDplus::getInstallType();
179
                        $installType = OIDplus::getInstallType();
167
 
180
 
Line 213... Line 226...
213
 
226
 
214
                                        $out['text'] .= '<p><input type="button" onclick="OIDplusPageAdminSoftwareUpdate.doUpdateOIDplus('.((int)substr($local_installation,4)+1).', '.substr($newest_version,4).')" value="'._L('Update NOW').'"></p>';
227
                                        $out['text'] .= '<p><input type="button" onclick="OIDplusPageAdminSoftwareUpdate.doUpdateOIDplus('.((int)substr($local_installation,4)+1).', '.substr($newest_version,4).')" value="'._L('Update NOW').'"></p>';
215
 
228
 
216
                                        // TODO: Open "system_file_check" without page reload.
229
                                        // TODO: Open "system_file_check" without page reload.
217
                                        // TODO: Only show link if the plugin is installed
230
                                        // TODO: Only show link if the plugin is installed
218
                                        $out['text'] .= '<p><font color="red">'.strtoupper(_L('Warning')).': '._L('Please make a backup of your files before updating. In case of an error, the OIDplus system (including this update-assistant) might become unavailable. Also, since the web-update does not contain collision-detection, changes you have applied (like adding, removing or modified files) might get reverted/lost! (<a href="%1">Click here to check which files have been modified</a>) In case the update fails, you can download and extract the complete <a href="https://www.viathinksoft.com/projects/oidplus">SVN-Snapshot TAR.GZ file</a> again. Since all your data should lay inside the folder "userdata" and "userdata_pub", this should be safe.','?goto='.urlencode('oidplus:system_file_check')).'</font></p>';
231
                                        $out['text'] .= '<p><font color="red">'.strtoupper(_L('Warning')).': '._L('Please make a backup of your files before updating. In case of an error, the OIDplus system (including this update-assistant) might become unavailable. Also, since the web-update does not contain collision-detection, changes you have applied (like adding, removing or modified files) might get reverted/lost! (<a href="%1">Click here to check which files have been modified</a>) In case the update fails, you can download and extract the complete <a href="%s">SVN-Snapshot TAR.GZ file</a> again. Since all your data should lay inside the folder "userdata" and "userdata_pub", this should be safe.','?goto='.urlencode('oidplus:system_file_check',OIDplus::getEditionInfo()['downloadpage'])).'</font></p>';
219
 
232
 
220
                                        $out['text'] .= '</div>';
233
                                        $out['text'] .= '</div>';
221
 
234
 
222
                                        $out['text'] .= $this->showPreview($local_installation, $newest_version);
235
                                        $out['text'] .= $this->showPreview($local_installation, $newest_version);
223
                                }
236
                                }
Line 253... Line 266...
253
 
266
 
254
        private function showChangelog($local_ver) {
267
        private function showChangelog($local_ver) {
255
 
268
 
256
                try {
269
                try {
257
                        if (is_null($this->releases_ser)) {
270
                        if (is_null($this->releases_ser)) {
258
                                $url = parse_ini_file(__DIR__.'/consts.ini')['revisionlog'];
271
                                $url = OIDplus::getEditionInfo()['revisionlog'];
259
                                $cont = url_get_contents($url);
272
                                $cont = url_get_contents($url);
260
                                if ($cont === false) return false;
273
                                if ($cont === false) return false;
261
                                $this->releases_ser = $cont;
274
                                $this->releases_ser = $cont;
262
                        } else {
275
                        } else {
263
                                $cont = $this->releases_ser;
276
                                $cont = $this->releases_ser;
Line 281... Line 294...
281
        }
294
        }
282
 
295
 
283
        private function getLatestRevision() {
296
        private function getLatestRevision() {
284
                try {
297
                try {
285
                        if (is_null($this->releases_ser)) {
298
                        if (is_null($this->releases_ser)) {
286
                                $url = parse_ini_file(__DIR__.'/consts.ini')['revisionlog'];
299
                                $url = OIDplus::getEditionInfo()['revisionlog'];
287
                                $cont = url_get_contents($url);
300
                                $cont = url_get_contents($url);
288
                                if ($cont === false) return false;
301
                                if ($cont === false) return false;
289
                                $this->releases_ser = $cont;
302
                                $this->releases_ser = $cont;
290
                        } else {
303
                        } else {
291
                                $cont = $this->releases_ser;
304
                                $cont = $this->releases_ser;