1
0

Fix for 3.0.3 upgrade.

This commit is contained in:
dmolavi 2012-04-21 23:05:20 -04:00
parent 632275a198
commit fc6125aa91
3 changed files with 49 additions and 29 deletions

View File

@ -186,7 +186,9 @@ class Admin_Moduleupdates_Controller extends Admin_Controller {
log::success("moduleupdates", t("Completed checking remote GitHub for modules updates.")); log::success("moduleupdates", t("Completed checking remote GitHub for modules updates."));
} }
if(is_file('gm.ini'))
unlink('gm.ini'); unlink('gm.ini');
if(is_file('gm_core.ini'))
unlink('gm_core.ini'); unlink('gm_core.ini');
$view->content->vars = $cache; $view->content->vars = $cache;
@ -301,7 +303,6 @@ class Admin_Moduleupdates_Controller extends Admin_Controller {
case "GH": case "GH":
//Parse ini file from GalleryModules.com //Parse ini file from GalleryModules.com
try { try {
$this_gm_repo = str_replace(".","",substr_replace(gallery::VERSION,"",strpos(gallery::VERSION," ")));
if(file_exists('gm.ini')) { if(file_exists('gm.ini')) {
$file = 1; $file = 1;
} }
@ -317,14 +318,33 @@ class Admin_Moduleupdates_Controller extends Admin_Controller {
} }
if ($file != null) { if ($file != null) {
//Search in the GM listing
if ($server_location == "GH"){ if ($server_location == "GH"){
if($this_gm_repo == "30") { //Search if this is a Gallery 3.0 module
if(array_key_exists($module_name,$gm_array)){
if(array_key_exists('g3',$gm_array[$module_name])){
$version = $gm_array[$module_name]['g3']; $version = $gm_array[$module_name]['g3'];
} else { }
if($version == ''){
if(array_key_exists('g31',$gm_array[$module_name])){
$version = $gm_array[$module_name]['g31']; $version = $gm_array[$module_name]['g31'];
} }
}
if($version == ''){
if(array_key_exists('codex',$gm_array[$module_name])){
$version = $gm_array[$module_name]['codex'];
}
}
} else { //Module not found
$version = '';
}
//Search in the Core listing
} else { } else {
if(array_key_exists($module_name,$gm_core_array)){
$version = $gm_core_array[$module_name]['version']; $version = $gm_core_array[$module_name]['version'];
} else { //Module not found
$version = '';
}
} }
} }

View File

@ -24,7 +24,7 @@ class moduleupdates_installer {
$version = module::get_version("moduleupdates"); $version = module::get_version("moduleupdates");
if ($version < 1) { if ($version < 1) {
module::set_version("moduleupdates", 10); module::set_version("moduleupdates", 11);
//Remove the ModuleUpdates cache entry 'JIC' //Remove the ModuleUpdates cache entry 'JIC'
Cache::instance()->delete("ModuleUpdates"); Cache::instance()->delete("ModuleUpdates");
//create the blank ModuleUpdates cache entry with an expiration of 0 days //create the blank ModuleUpdates cache entry with an expiration of 0 days
@ -34,7 +34,7 @@ class moduleupdates_installer {
} }
static function upgrade($version) { static function upgrade($version) {
module::set_version("moduleupdates", 10); module::set_version("moduleupdates", 11);
//Remove the ModuleUpdates cache entry 'JIC' //Remove the ModuleUpdates cache entry 'JIC'
Cache::instance()->delete("ModuleUpdates"); Cache::instance()->delete("ModuleUpdates");
//Empty the ModuleUpdates cache entry so our new version starts from scratch //Empty the ModuleUpdates cache entry so our new version starts from scratch

View File

@ -1,6 +1,6 @@
name = "ModuleUpdates" name = "ModuleUpdates"
description = "Compares your installed module version against the ones stored in the GitHub." description = "Compares your installed module version against the ones stored in the GitHub."
version = 10 version = 11
author_name = "brentil" author_name = "brentil"
author_url = "http://gallery.menalto.com/user/153736" author_url = "http://gallery.menalto.com/user/153736"
info_url = "http://codex.gallery2.org/Gallery3:Modules:moduleupdates" info_url = "http://codex.gallery2.org/Gallery3:Modules:moduleupdates"