aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/assets/javascript/installer.js
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/assets/javascript/installer.js')
-rw-r--r--phpBB/assets/javascript/installer.js60
1 files changed, 54 insertions, 6 deletions
diff --git a/phpBB/assets/javascript/installer.js b/phpBB/assets/javascript/installer.js
index d9f446a28d..a11b76b863 100644
--- a/phpBB/assets/javascript/installer.js
+++ b/phpBB/assets/javascript/installer.js
@@ -13,6 +13,7 @@
var currentProgress = 0;
var refreshRequested = false;
var transmissionOver = false;
+ var statusCount = 0;
// Template related variables
var $contentWrapper = $('.install-body').find('.main');
@@ -339,6 +340,57 @@
}
/**
+ * Processes status data
+ *
+ * @param status
+ */
+ function processTimeoutResponse(status) {
+ if (statusCount === 12) { // 1 minute hard cap
+ status = 'fail';
+ }
+
+ if (status === 'continue') {
+ refreshRequested = false;
+ doRefresh();
+ } else if (status === 'running') {
+ statusCount++;
+ $('#loading_indicator').css('display', 'block');
+ setTimeout(queryInstallerStatus, 5000);
+ } else {
+ $('#loading_indicator').css('display', 'none');
+ addMessage('error',
+ [{
+ title: installLang.title,
+ description: installLang.msg
+ }]
+ );
+ }
+ }
+
+ /**
+ * Queries the installer's status
+ */
+ function queryInstallerStatus() {
+ var url = $(location).attr('pathname');
+ var lookUp = 'install/app.php';
+ var position = url.indexOf(lookUp);
+
+ if (position === -1) {
+ lookUp = 'install';
+ position = url.indexOf(lookUp);
+
+ if (position === -1) {
+ return false;
+ }
+ }
+
+ url = url.substring(0, position) + lookUp + '/installer/status';
+ $.getJSON(url, function(data) {
+ processTimeoutResponse(data.status);
+ });
+ }
+
+ /**
* Process updates in streamed response
*
* @param xhReq XHR object
@@ -372,12 +424,8 @@
}
if (timeoutDetected) {
- addMessage('error',
- [{
- title: installLang.title,
- description: installLang.msg
- }]
- );
+ statusCount = 0;
+ queryInstallerStatus();
}
}
}