Skip to content

Commit

Permalink
Reverted system updater back to before revision 2304 (no external Aut…
Browse files Browse the repository at this point in the history
…omad in cache)
  • Loading branch information
marcantondahmen committed Jun 25, 2018
1 parent 37ecdac commit 8986192
Show file tree
Hide file tree
Showing 11 changed files with 133 additions and 333 deletions.
16 changes: 4 additions & 12 deletions automad/cli/update.php
Expand Up @@ -51,14 +51,8 @@
exit('Can\'t run updates within the development repository!' . PHP_EOL);
}

// Exit on Windows due to file locks.
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
exit('The CLI updater can\'t be used on Windows! Please update Automad by using the dashboard instead!');
}

require AM_BASE_DIR . '/automad/autoload.php';
require AM_BASE_DIR . '/automad/const.php';
require AM_BASE_DIR . '/automad/version.php';

echo 'Automad version ' . AM_VERSION . PHP_EOL;
echo 'Update branch is ' . AM_UPDATE_BRANCH . PHP_EOL;
Expand All @@ -70,12 +64,10 @@
echo 'Updating to version ' . $updateVersion . PHP_EOL;
$output = System\Update::run();

if (!empty($output['success'])) {
echo $output['success'] . PHP_EOL;
}

if (!empty($output['error'])) {
echo $output['error'] . PHP_EOL;
if (!empty($output['cli'])) {
echo $output['cli'] . PHP_EOL;
} else {
echo 'Error! Update has failed!' . PHP_EOL;
}

} else {
Expand Down
5 changes: 4 additions & 1 deletion automad/const.php
Expand Up @@ -200,10 +200,13 @@
Config::set('AM_KEY_NOW', ':now');

// UPDATE
Config::set('AM_UPDATE_ITEMS', '/automad, /lib, /packages/standard, /packages/tutorial');
Config::set('AM_UPDATE_ITEMS', '/automad, /lib, /index.php, /packages/standard, /packages/tutorial');
Config::set('AM_UPDATE_BRANCH', 'default');
Config::set('AM_UPDATE_REPO_URL', 'https://bitbucket.org/marcantondahmen/automad');
Config::set('AM_UPDATE_REPO_RAW_PATH', '/raw');
Config::set('AM_UPDATE_REPO_GET_PATH', '/get');
Config::set('AM_UPDATE_REPO_VERSION_FILE', '/automad/version.php');
Config::set('AM_UPDATE_TEMP', AM_DIR_CACHE . '/update');

// Version number
include AM_BASE_DIR . '/automad/version.php';
8 changes: 0 additions & 8 deletions automad/gui/js/form.js
Expand Up @@ -129,9 +129,6 @@
*
* 5. data.debug
* Outputs debug info to the console.
*
* 6. data.init
* Submit the form again without any data. Just to re-initialize.
*/

var f = Automad.form,
Expand Down Expand Up @@ -162,11 +159,6 @@
Automad.debug.log(handler, data.debug);
}

// Submit again to refresh the form to a clean state.
if (data.init) {
$form.html('').submit();
}

// In case the returned JSON contains a redirect URL, simply redirect the page.
// A redirect might be needed, in case other elements on the page, like the navigation, have to be updated as well.
if (data.redirect) {
Expand Down
24 changes: 24 additions & 0 deletions automad/gui/lang/en.txt
Expand Up @@ -106,6 +106,10 @@ btn_ok: Ok

-

btn_open_log: Open Log

-

btn_remove_selected: Remove Selected

-
Expand Down Expand Up @@ -258,11 +262,27 @@ error_update_connection: Can't connect to the update server! This could typicall

-

error_update_download: Download of update failed!

-

error_update_items: Invalid list of items to be updated!

-

error_update_failed: Update failed! Please restore your installation from a backup.

-

error_update_not_supported: Updates are not supported by your server!
The updater requires **cURL** and **ZIP** libraries to be installed.

-

error_update_permission: Can't run update! Permission denied!

-

error_var_exists: There is already a variable with that name!

-
Expand Down Expand Up @@ -521,6 +541,10 @@ success_remove: Successfully removed

-

success_update: Successfully updated Automad!

-




Expand Down
5 changes: 3 additions & 2 deletions automad/gui/user.php
Expand Up @@ -36,7 +36,6 @@


namespace Automad\GUI;
use Automad\System as System;


defined('AUTOMAD') or die('Direct access not permitted!');
Expand Down Expand Up @@ -125,7 +124,9 @@ public static function changePassword() {

public static function get() {

return System\Session::user();
if (isset($_SESSION['username'])) {
return $_SESSION['username'];
}

}

Expand Down
8 changes: 2 additions & 6 deletions automad/init.php
Expand Up @@ -47,7 +47,6 @@

use Automad\Core as Core;
use Automad\GUI as GUI;
use Automad\System as System;


// Set default timezone if not set.
Expand All @@ -62,10 +61,6 @@
require AM_BASE_DIR . '/automad/const.php';


// Version number
include AM_BASE_DIR . '/automad/version.php';


// Enable full error reporting, when debugging is enabled.
Core\Debug::errorReporting();

Expand All @@ -77,7 +72,8 @@


// Start Session.
System\Session::start();
session_name('Automad-' . md5(AM_BASE_DIR));
session_start();


// Split GUI form regular pages.
Expand Down
79 changes: 0 additions & 79 deletions automad/init_update.php

This file was deleted.

82 changes: 0 additions & 82 deletions automad/system/session.php

This file was deleted.

0 comments on commit 8986192

Please sign in to comment.