aboutsummaryrefslogtreecommitdiff
path: root/actions/admin
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-07-17 02:46:53 +0200
committerSem <sembrestels@riseup.net>2012-07-17 02:46:53 +0200
commitdce60b43126dcaa38e6845ae45e09db87aa7e229 (patch)
treeddb47e193ed2737c7adf338d0c87813a7ff67fb6 /actions/admin
parent9590b4684d4ff87a5986742bf00ea0a91e061b0c (diff)
downloadelgg-dce60b43126dcaa38e6845ae45e09db87aa7e229.tar.gz
elgg-dce60b43126dcaa38e6845ae45e09db87aa7e229.tar.bz2
Refs #4643. Added unlock upgrade action.
Diffstat (limited to 'actions/admin')
-rw-r--r--actions/admin/site/unlock_upgrade.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/actions/admin/site/unlock_upgrade.php b/actions/admin/site/unlock_upgrade.php
new file mode 100644
index 000000000..b73cf7033
--- /dev/null
+++ b/actions/admin/site/unlock_upgrade.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Unlocks the upgrade script
+ */
+
+// @todo Move this in ElggUpgradeManager::isLocked() when #4682 fixed
+global $CONFIG, $DB_QUERY_CACHE;
+
+$is_locked = count(get_data("show tables like '{$CONFIG->dbprefix}locked'"));
+
+// Invalidate query cache
+if ($DB_QUERY_CACHE) {
+ $DB_QUERY_CACHE->clear();
+ elgg_log("Query cache invalidated", 'NOTICE');
+}
+
+if ($is_locked) {
+ // @todo Move to ElggUpgradeManager::unlock() when #4682 fixed.
+ delete_data("drop table {$CONFIG->dbprefix}locked");
+ error_log('Upgrade unlocks itself');
+}
+system_message(elgg_echo('upgrade:unlock:success'));
+forward(REFERER); \ No newline at end of file