aboutsummaryrefslogtreecommitdiff
path: root/actions/admin/site/unlock_upgrade.php
blob: b73cf7033538684ef05137acd5917fa02a629209 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);