Skip to content

Commit 0e199de

Browse files
authored
Merge pull request #6914 from iMattPro/ticket/17595
[ticket/17595] Ext Catalog should use Titania's 4.0 packages repository
2 parents 4ae1f13 + 0d09782 commit 0e199de

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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\migration;
17+
18+
class extensions_composer_4 extends migration
19+
{
20+
public function effectively_installed()
21+
{
22+
return str_contains($this->config['exts_composer_repositories'], 'https://www.phpbb.com/customise/db/composer/40/');
23+
}
24+
25+
public function update_data()
26+
{
27+
$repositories = json_decode($this->config['exts_composer_repositories'], true) ?: [];
28+
$repositories = array_map(function($repo) {
29+
return $repo === 'https://www.phpbb.com/customise/db/composer/'
30+
? 'https://www.phpbb.com/customise/db/composer/40/'
31+
: $repo;
32+
}, $repositories);
33+
34+
return [
35+
['config.update', ['exts_composer_repositories', json_encode($repositories, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)]],
36+
];
37+
}
38+
39+
public static function depends_on()
40+
{
41+
return [
42+
'\phpbb\db\migration\data\v400\extensions_composer',
43+
'\phpbb\db\migration\data\v400\extensions_composer_2',
44+
'\phpbb\db\migration\data\v400\extensions_composer_3'
45+
];
46+
}
47+
}

0 commit comments

Comments
 (0)