21 $processed_upgrades = array_unique($processed_upgrades);
22 return datalist_set(
'processed_upgrades', serialize($processed_upgrades));
34 preg_match(
'/^([0-9]{10})([\.a-z0-9-_]+)?\.(php)$/i',
$filename, $matches);
36 if (isset($matches[1])) {
37 return (
int) $matches[1];
57 $handle = opendir($upgrade_path);
63 $upgrade_files = array();
65 while ($upgrade_file = readdir($handle)) {
67 if (is_dir($upgrade_path .
'$upgrade_file')) {
71 if (!$upgrade_version) {
74 $upgrade_files[] = $upgrade_file;
79 return $upgrade_files;
91 delete_data(
"drop table {$CONFIG->dbprefix}upgrade_lock");
92 elgg_log(
'Upgrade unlocked.',
'NOTICE');
elgg_get_upgrade_files($upgrade_path=null)
Returns a list of upgrade files relative to the $upgrade_path dir.
delete_data($query, array $params=[])
Remove a row from the database.
sanitise_filepath($path, $append_slash=true)
Sanitise file paths ensuring that they begin and end with slashes etc.
datalist_set($name, $value)
Set the value for a datalist element.
elgg global
Pointer to the global context.
elgg_set_processed_upgrades(array $processed_upgrades)
Saves the processed upgrades to a dataset.
elgg_log($message, $level= 'NOTICE')
Display or log a message.
elgg_get_upgrade_file_version($filename)
Returns the version of the upgrade filename.
elgg_get_engine_path()
/path/to/elgg/engine
_elgg_upgrade_unlock()
Unlocks upgrade.