mirror of
https://github.com/phpbb/phpbb.git
synced 2025-10-05 04:01:49 +02:00
Merge pull request #6857 from Derky/ticket/17548
[ticket/17548] Suppress filesize errors and add DISTINCT to storage_track migration
This commit is contained in:
@@ -75,7 +75,7 @@ class storage_track extends container_aware_migration
|
||||
/** @var file_tracker $file_tracker */
|
||||
$file_tracker = $this->container->get('storage.file_tracker');
|
||||
|
||||
$sql = 'SELECT user_avatar
|
||||
$sql = 'SELECT DISTINCT user_avatar
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE user_avatar_type = 'avatar.driver.upload'";
|
||||
$result = $this->db->sql_query($sql);
|
||||
@@ -121,7 +121,7 @@ class storage_track extends container_aware_migration
|
||||
/** @var file_tracker $file_tracker */
|
||||
$file_tracker = $this->container->get('storage.file_tracker');
|
||||
|
||||
$sql = 'SELECT physical_filename, thumbnail
|
||||
$sql = 'SELECT DISTINCT physical_filename, thumbnail
|
||||
FROM ' . ATTACHMENTS_TABLE;
|
||||
$result = $this->db->sql_query($sql);
|
||||
|
||||
@@ -130,14 +130,14 @@ class storage_track extends container_aware_migration
|
||||
{
|
||||
$files[] = [
|
||||
'file_path' => $row['physical_filename'],
|
||||
'filesize' => filesize($this->phpbb_root_path . $this->config['storage\\attachment\\config\\path'] . '/' . $row['physical_filename']),
|
||||
'filesize' => @filesize($this->phpbb_root_path . $this->config['storage\\attachment\\config\\path'] . '/' . $row['physical_filename']),
|
||||
];
|
||||
|
||||
if ($row['thumbnail'] == 1)
|
||||
{
|
||||
$files[] = [
|
||||
'file_path' => 'thumb_' . $row['physical_filename'],
|
||||
'filesize' => filesize($this->phpbb_root_path . $this->config['storage\\attachment\\config\\path'] . '/thumb_' . $row['physical_filename']),
|
||||
'filesize' => @filesize($this->phpbb_root_path . $this->config['storage\\attachment\\config\\path'] . '/thumb_' . $row['physical_filename']),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ class storage_track extends container_aware_migration
|
||||
/** @var file_tracker $file_tracker */
|
||||
$file_tracker = $this->container->get('storage.file_tracker');
|
||||
|
||||
$sql = 'SELECT filename
|
||||
$sql = 'SELECT DISTINCT filename
|
||||
FROM ' . BACKUPS_TABLE;
|
||||
$result = $this->db->sql_query($sql);
|
||||
|
||||
@@ -170,7 +170,7 @@ class storage_track extends container_aware_migration
|
||||
{
|
||||
$files[] = [
|
||||
'file_path' => $row['filename'],
|
||||
'filesize' => filesize($this->phpbb_root_path . $this->config['storage\\backup\\config\\path'] . '/' . $row['filename']),
|
||||
'filesize' => @filesize($this->phpbb_root_path . $this->config['storage\\backup\\config\\path'] . '/' . $row['filename']),
|
||||
];
|
||||
|
||||
if (count($files) >= self::BATCH_SIZE)
|
||||
|
Reference in New Issue
Block a user