ModuleUpdates v4.0 beta, uses installed version information to dynamically determine git location. gallery::VERSION info is wrong though
This commit is contained in:
parent
17c4c1ea6e
commit
eecb0a6ad5
@ -45,10 +45,10 @@ class Admin_Moduleupdates_Controller extends Admin_Controller {
|
|||||||
$view->content = new View("admin_moduleupdates.html");
|
$view->content = new View("admin_moduleupdates.html");
|
||||||
|
|
||||||
$devDebug = false;
|
$devDebug = false;
|
||||||
$refreshCache = false;
|
$refreshCache = false;
|
||||||
|
|
||||||
$cache = unserialize(Cache::instance()->get("moduleupdates_cache"));
|
$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>';
|
//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->csrf = access::csrf_token();
|
||||||
$view->content->Google = $Google;
|
$view->content->Google = $Google;
|
||||||
$view->content->GitHub = $GitHub;
|
$view->content->GitHub = $GitHub;
|
||||||
|
$view->content->Gallery_Version = gallery::VERSION;
|
||||||
|
|
||||||
|
|
||||||
print $view;
|
print $view;
|
||||||
@ -197,7 +198,7 @@ class Admin_Moduleupdates_Controller extends Admin_Controller {
|
|||||||
if ($devDebug == true){
|
if ($devDebug == true){
|
||||||
if ($file == null) {
|
if ($file == null) {
|
||||||
try {
|
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) {
|
if ($file != null) {
|
||||||
$server = '(brentil)';
|
$server = '(brentil)';
|
||||||
}
|
}
|
||||||
@ -213,7 +214,7 @@ class Admin_Moduleupdates_Controller extends Admin_Controller {
|
|||||||
try {
|
try {
|
||||||
$file = fopen ("http://github.com/gallery/gallery3/raw/master/modules/".$module_name."/module.info", "r");
|
$file = fopen ("http://github.com/gallery/gallery3/raw/master/modules/".$module_name."/module.info", "r");
|
||||||
if ($file != null) {
|
if ($file != null) {
|
||||||
$server = '(G3)';
|
$server = '(G)';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception $e) {
|
catch (Exception $e) {
|
||||||
@ -224,9 +225,9 @@ class Admin_Moduleupdates_Controller extends Admin_Controller {
|
|||||||
//Check the Gallery3 Community Contributions GitHub
|
//Check the Gallery3 Community Contributions GitHub
|
||||||
if ($file == null) {
|
if ($file == null) {
|
||||||
try {
|
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) {
|
if ($file != null) {
|
||||||
$server = '(G3CC)';
|
$server = '(GCC)';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception $e) {
|
catch (Exception $e) {
|
||||||
|
@ -27,4 +27,4 @@ class moduleupdates_event_Core {
|
|||||||
->label(t("Module Updates"))
|
->label(t("Module Updates"))
|
||||||
->url(url::site("admin/moduleupdates")));
|
->url(url::site("admin/moduleupdates")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ class moduleupdates_installer {
|
|||||||
|
|
||||||
$version = module::get_version("moduleupdates");
|
$version = module::get_version("moduleupdates");
|
||||||
if ($version == 0) {
|
if ($version == 0) {
|
||||||
module::set_version("moduleupdates", 2);
|
module::set_version("moduleupdates", 4);
|
||||||
//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", 2);
|
module::set_version("moduleupdates", 4);
|
||||||
//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
|
||||||
@ -48,4 +48,4 @@ class moduleupdates_installer {
|
|||||||
Cache::instance()->delete("ModuleUpdates");
|
Cache::instance()->delete("ModuleUpdates");
|
||||||
module::delete("moduleupdates");
|
module::delete("moduleupdates");
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,3 +1,3 @@
|
|||||||
name = "Module Updates"
|
name = "Module Updates"
|
||||||
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 = 3
|
version = 4
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div id="g-admin-moduleupdates" class="g-block">
|
<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.") ?>
|
<?= t("Compares your installed module version against the ones stored in the GitHub.") ?>
|
||||||
|
|
||||||
<div class="g-block-content">
|
<div class="g-block-content">
|
||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
<ul id="g-action-status" class="g-message-block">
|
<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>
|
</ul>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
@ -45,4 +45,4 @@
|
|||||||
<? endforeach ?>
|
<? endforeach ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user