-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathscoper.inc.php
More file actions
54 lines (47 loc) · 1.03 KB
/
scoper.inc.php
File metadata and controls
54 lines (47 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
declare(strict_types=1);
// scoper.inc.php
use Symfony\Component\Finder\Finder;
return [
'finders' => [
Finder::create()
->files()
->exclude([
'bin',
'bamarni',
'nextcloud',
'symfony',
'psr'
])
->in('.'),
],
'patchers' => [
static function (string $filePath, string $prefix, string $content): string {
//
// PHP-Parser patch conditions for file targets
//
if (str_contains($filePath, '/pel/')) {
return preg_replace(
'%([ |<{:,\'](\\\\)?)lsolesen\\\\pel%',
'$1OCA\\\\Replicate\\\\Vendor\\\\lsolesen\\\\pel',
$content
);
}
if (str_contains($filePath, '/getid3/')) {
return preg_replace(
'%\'getid3_\' .%',
'\'OCA\\\\Replicate\\\\Vendor\\\\getid3_\' .',
$content
);
}
return $content;
},
],
'expose-global-functions' => false,
'expose-global-classes' => false,
'expose-global-constants' => false,
];