Sort backups by date, newest first (Bug #14818)

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9416 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2009-03-30 13:32:57 +00:00
parent 80c597fadf
commit 6d601d3bfc
2 changed files with 53 additions and 42 deletions

View file

@ -132,6 +132,7 @@
<li>[Fix] Add indicator to be used in code if session was created (user visits the site for the first time).</li>
<li>[Fix] Correctly count topic views for guests visiting the website the first time by entering the topic directly (Bug #43445)</li>
<li>[Fix] Fix bug in postgresql db layer for LIMIT ALL clauses (reported by JRSweets)</li>
<li>[Fix] Sort backups by date, newest first (Bug #14818)</li>
<li>[Change] Allow download of conflicting file for later reference in automatic updater</li>
<li>[Change] Default difference view is now 'inline' instead of 'side by side'</li>
<li>[Change] Added new option for merging differences to conflicting files in automatic updater</li>

View file

@ -424,27 +424,37 @@ class acp_database
$dir = $phpbb_root_path . 'store/';
$dh = @opendir($dir);
$backup_files = array();
if ($dh)
{
while (($file = readdir($dh)) !== false)
{
if (preg_match('#^backup_(\d{10,})_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches))
{
$supported = in_array($matches[2], $methods);
if ($supported == 'true')
if (in_array($matches[2], $methods))
{
$template->assign_block_vars('files', array(
'FILE' => $file,
'NAME' => gmdate("d-m-Y H:i:s", $matches[1]),
'SUPPORTED' => $supported
));
$backup_files[gmdate("d-m-Y H:i:s", $matches[1])] = $file;
}
}
}
closedir($dh);
}
if (!empty($backup_files))
{
krsort($backup_files);
foreach ($backup_files as $name => $file)
{
$template->assign_block_vars('files', array(
'FILE' => $file,
'NAME' => $name,
'SUPPORTED' => true,
));
}
}
$template->assign_vars(array(
'U_ACTION' => $this->u_action . '&amp;action=submit'
));