commit 397c6a99e0ea4038d6ce56a1255b0e6d1b1a59e8
parent 53df510c52b74cb77712efcbb82c7fa255453202
Author: MTRNord <mtrnord1@gmail.com>
Date: Tue, 23 Dec 2014 10:17:00 +0100
hopefully fixed updater
Diffstat:
3 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/core/update/update/update.php b/core/update/update/update.php
@@ -61,12 +61,17 @@ class AutoUpdate {
/*
* Url to the update folder on the server
*/
- public $updateUrl = 'http://media.nordgedanken.de/rpicms/update/server';
+ public $updateUrl = 'http://media.nordgedanken.de/rpicms/update/server/';
/*
* Version filename on the server
*/
- public $updateIni = 'update.ini.stable';
+ public $updateIni = 'update.ini.$this->branch';
+
+ /*
+ * branch on the server
+ */
+ public $branch = 'stable';
/*
* Temporary download directory
@@ -162,7 +167,7 @@ class AutoUpdate {
public function checkUpdate() {
$this->log('Checking for a new update. . .');
- $updateFile = $this->updateUrl.'/update.ini';
+ $updateFile = $this->updateUrl.'/'.$this->updateIni;
$update = @file_get_contents($updateFile);
if ($update === false) {
@@ -205,6 +210,7 @@ class AutoUpdate {
*/
public function downloadUpdate($updateUrl, $updateFile) {
$this->log('Downloading update...');
+ $updateUrl = $updateUrl.$this->branch;
$update = @file_get_contents($updateUrl);
if ($update === false) {
diff --git a/install/generate_configs.php b/install/generate_configs.php
@@ -125,8 +125,18 @@ $filename = '../core/config/variables.config.php';
print "Fertig, in Datei $filename wurde $var_str_bn geschrieben";
print "</br>";
- fclose($handle);
+ $updatebranch = "stable";
+ $var_str_ub = var_export($updatebranch, true);
+ $var_ub = "\$updatebranch = $var_str_ub;\n\n";
+ if (!fwrite($handle, $var_th)) {
+ print "Kann in die Datei $filename nicht schreiben";
+ exit;
+ }
+
+ print "Fertig, in Datei $filename wurde $var_str_ub geschrieben";
+ print "</br>";
+ fclose($handle);
//############################
//# Pass zwischenspeicherung #
diff --git a/themes/jumbotron/update.php b/themes/jumbotron/update.php
@@ -23,13 +23,13 @@ if ($root_3[1] == 'core') {
}else{
$root = $root_1 . '/' . $root_3[1];
}
-
+include($root . '/core/config/variables.config.php');
require($root . '/core/update/update/update.php');
-$branch = "stable";
$update = new AutoUpdate(true);
+$update->branch = $updatebranch;
$update->currentVersion = 1; //Must be an integer - you can't compare strings
-$update->updateUrl = 'http://media.nordgedanken.de/rpicms/server'; //Replace with your server update directory
-$update->updateIni = 'update.ini.'.$branch;
+$update->updateUrl = 'http://media.nordgedanken.de/rpicms/server/'; //Replace with your server update directory
+$update->updateIni = 'update.ini.'.$update->branch;
//Check for a new update
$latest = $update->checkUpdate();