Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
increase_avatar_size | |
0.00% |
0 / 9 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
depends_on | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
update_data | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
increase_size | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * |
4 | * This file is part of the phpBB Forum Software package. |
5 | * |
6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
7 | * @license GNU General Public License, version 2 (GPL-2.0) |
8 | * |
9 | * For full copyright and license information, please see |
10 | * the docs/CREDITS.txt file. |
11 | * |
12 | */ |
13 | |
14 | namespace phpbb\db\migration\data\v400; |
15 | |
16 | use phpbb\db\migration\container_aware_migration; |
17 | |
18 | class increase_avatar_size extends container_aware_migration |
19 | { |
20 | public static function depends_on() |
21 | { |
22 | return ['\phpbb\db\migration\data\v400\dev']; |
23 | } |
24 | |
25 | public function update_data() |
26 | { |
27 | return [ |
28 | ['custom', [[$this, 'increase_size']]], |
29 | ]; |
30 | } |
31 | |
32 | public function increase_size(): void |
33 | { |
34 | $this->config->set('avatar_filesize', max(262144, $this->config['avatar_filesize'])); // Increase to 256 KiB |
35 | $this->config->set('avatar_max_height', max('120', $this->config['avatar_max_height'])); // Increase to max 120px height |
36 | $this->config->set('avatar_max_width', max('120', $this->config['avatar_max_width'])); // Increase to max 120px width |
37 | $this->config->set('avatar_min_height', max('40', $this->config['avatar_min_height'])); // Increase to min 40px height |
38 | $this->config->set('avatar_min_width', max('40', $this->config['avatar_min_width'])); // Increase to max 40px width |
39 | } |
40 | } |