1
0

ModuleUpdates v4.0 beta, uses installed version information to dynamically determine git location. gallery::VERSION info is wrong though

This commit is contained in:
brentil 2010-11-23 22:50:11 -05:00
parent 17c4c1ea6e
commit 2a7b73a5f5
5 changed files with 15 additions and 14 deletions

View File

@ -45,10 +45,10 @@ class Admin_Moduleupdates_Controller extends Admin_Controller {
$view->content = new View("admin_moduleupdates.html");
$devDebug = false;
$refreshCache = false;
$refreshCache = false;
$cache = unserialize(Cache::instance()->get("moduleupdates_cache"));
$cache_updates = unserialize(Cache::instance()->get("moduleupdates_cache_updates"));
$cache_updates = unserialize(Cache::instance()->get("moduleupdates_cache_updates"));
//---------------------------------------------------------------------------------------------
//echo 'Message 01: ' .$cache_updates . '<br>';
@ -167,6 +167,7 @@ class Admin_Moduleupdates_Controller extends Admin_Controller {
$view->content->csrf = access::csrf_token();
$view->content->Google = $Google;
$view->content->GitHub = $GitHub;
$view->content->Gallery_Version = gallery::VERSION;
print $view;
@ -197,7 +198,7 @@ class Admin_Moduleupdates_Controller extends Admin_Controller {
if ($devDebug == true){
if ($file == null) {
try {
$file = fopen ("http://github.com/brentil/gallery3-contrib/raw/master/3.0/modules/".$module_name."/module.info", "r");
$file = fopen ("http://github.com/brentil/gallery3-contrib/raw/master/". gallery::VERSION ."/modules/".$module_name."/module.info", "r");
if ($file != null) {
$server = '(brentil)';
}
@ -213,7 +214,7 @@ class Admin_Moduleupdates_Controller extends Admin_Controller {
try {
$file = fopen ("http://github.com/gallery/gallery3/raw/master/modules/".$module_name."/module.info", "r");
if ($file != null) {
$server = '(G3)';
$server = '(G)';
}
}
catch (Exception $e) {
@ -224,9 +225,9 @@ class Admin_Moduleupdates_Controller extends Admin_Controller {
//Check the Gallery3 Community Contributions GitHub
if ($file == null) {
try {
$file = fopen ("http://github.com/gallery/gallery3-contrib/raw/master/3.0/modules/".$module_name."/module.info", "r");
$file = fopen ("http://github.com/gallery/gallery3-contrib/raw/master/". gallery::VERSION ."/modules/".$module_name."/module.info", "r");
if ($file != null) {
$server = '(G3CC)';
$server = '(GCC)';
}
}
catch (Exception $e) {

View File

@ -27,4 +27,4 @@ class moduleupdates_event_Core {
->label(t("Module Updates"))
->url(url::site("admin/moduleupdates")));
}
}
}

View File

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

View File

@ -1,3 +1,3 @@
name = "Module Updates"
description = "Compares your installed module version against the ones stored in the GitHub."
version = 3
version = 4

View File

@ -2,7 +2,7 @@
<div id="g-admin-moduleupdates" class="g-block">
<h1> <?= t("Module Updates v2.0") ?> </h1>
<h1> <?= t("Module Updates v4.0") ?> </h1>
<?= t("Compares your installed module version against the ones stored in the GitHub.") ?>
<div class="g-block-content">
@ -25,7 +25,7 @@
<br>
<ul id="g-action-status" class="g-message-block">
<li class="g-warning"><?= t("Versions are compared from the official Gallery3 (G3) and official Gallery3 Community Contributions (G3CC). Versions downloaded from the forums will not be shown.") ?></li>
<li class="g-warning"><?= t("Versions are compared from the official Gallery " . $Gallery_Version . " (G) and official Gallery " . $Gallery_Version . " Community Contributions (GCC). Versions downloaded from the forums will not be shown.") ?></li>
</ul>
<table>
@ -45,4 +45,4 @@
<? endforeach ?>
</table>
</div>
</div>
</div>