Skip to content

Commit

Permalink
upgrade: fix basedir handling on downloaded zip from github. Update r…
Browse files Browse the repository at this point in the history
…evision number

( replace "-master" and also "-version_date" in prefix )
  • Loading branch information
jonsito committed Jan 27, 2022
1 parent 9241513 commit b0784ea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version 4.6.2 20220124_2100
Version 4.6.2 20220127_1030
- Fix zipfile name on upgrade process to properly handle releases download from github
- Support for AccessControlList on competition modules
- Add support for RSCE Seaseon 2022
- Fixes from 4.6.1 (default hidden value for Grado I "/Agility/Jumping/Oder", error on group categories on print )
Expand Down
8 changes: 6 additions & 2 deletions agility/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,12 @@ public function doUpgrade() {
if (! is_resource($zip) ) { $this->logProgress("ERROR: zipfile failed errno: $zip"); return false; }
while ($aF = zip_read($zip) ) {
set_time_limit(ini_get('max_execution_time'));
// get file name and their directory
$file_name = str_replace("AgilityContest-master/","",zip_entry_name($aF));
// get file name and their directory old style
$ext="master";
$file_name = str_replace("AgilityContest-{$ext}/","",zip_entry_name($aF));
// get file name and their directory new style (from github releases)
$ext=$this->getVersionName()."-".$this->getVersionDate();
$file_name = str_replace("AgilityContest-{$ext}/","",zip_entry_name($aF));
$file_size = zip_entry_filesize($aF);
$dir_name = dirname($file_name);
// skip directories in zip file
Expand Down
2 changes: 1 addition & 1 deletion config/system.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ author = "Juan Antonio Martinez"
email = "[email protected]"
license = "GPL"
version_name = "4.6.2"
version_date = "20220124_2100"
version_date = "20220127_1030"
database_name = "agility"
database_host = "localhost"
database_user = "YWdpbGl0eV9vcGVyYXRvcg=="
Expand Down

0 comments on commit b0784ea

Please sign in to comment.