21 $processed_upgrades = array_unique($processed_upgrades);
22 return datalist_set(
'processed_upgrades', serialize($processed_upgrades));
35 preg_match(
'/^([0-9]{10})([\.a-z0-9-_]+)?\.(php)$/i',
$filename, $matches);
37 if (isset($matches[1])) {
38 return (
int) $matches[1];
58 $handle = opendir($upgrade_path);
64 $upgrade_files = array();
66 while ($upgrade_file = readdir($handle)) {
68 if (is_dir($upgrade_path .
'$upgrade_file')) {
72 if (!$upgrade_version) {
75 $upgrade_files[] = $upgrade_file;
80 return $upgrade_files;
92 delete_data(
"drop table {$CONFIG->dbprefix}upgrade_lock");
93 elgg_log(
'Upgrade unlocked.',
'NOTICE');
elgg_get_upgrade_files($upgrade_path=null)
Returns a list of upgrade files relative to the $upgrade_path dir.
sanitise_filepath($path, $append_slash=true)
Sanitise file paths ensuring that they begin and end with slashes etc.
delete_data($query)
Remove a row from the database.
datalist_set($name, $value)
Set the value for a datalist element.
elgg_get_root_path()
Get the root directory path for this installation.
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_upgrade_unlock()
Unlocks upgrade.