mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
Revert "fix(dependencies): Migrate to PHP scoper"
This commit is contained in:
parent
fa7b7afeac
commit
7a7593ca48
7 changed files with 452 additions and 926 deletions
3
.github/dependabot.yml
vendored
3
.github/dependabot.yml
vendored
|
|
@ -66,8 +66,7 @@ updates:
|
||||||
directories:
|
directories:
|
||||||
- "/tests/integration"
|
- "/tests/integration"
|
||||||
- "/vendor-bin/csfixer"
|
- "/vendor-bin/csfixer"
|
||||||
- "/vendor-bin/openapi-extractor"
|
- "/vendor-bin/mozart"
|
||||||
- "/vendor-bin/php-scoper"
|
|
||||||
- "/vendor-bin/phpunit"
|
- "/vendor-bin/phpunit"
|
||||||
- "/vendor-bin/psalm"
|
- "/vendor-bin/psalm"
|
||||||
- "/vendor-bin/rector"
|
- "/vendor-bin/rector"
|
||||||
|
|
|
||||||
2
Makefile
2
Makefile
|
|
@ -88,7 +88,6 @@ appstore:
|
||||||
--exclude=jest.config.js \
|
--exclude=jest.config.js \
|
||||||
--exclude=jest.global.setup.js \
|
--exclude=jest.global.setup.js \
|
||||||
--exclude=.l10nignore \
|
--exclude=.l10nignore \
|
||||||
--exclude=lib-vendor-organizer.php \
|
|
||||||
--exclude=mkdocs.yml \
|
--exclude=mkdocs.yml \
|
||||||
--exclude=Makefile \
|
--exclude=Makefile \
|
||||||
--exclude=node_modules \
|
--exclude=node_modules \
|
||||||
|
|
@ -101,7 +100,6 @@ appstore:
|
||||||
--exclude=.readthedocs.yaml \
|
--exclude=.readthedocs.yaml \
|
||||||
--exclude=/recording \
|
--exclude=/recording \
|
||||||
--exclude=/redocly.yaml \
|
--exclude=/redocly.yaml \
|
||||||
--exclude=/scoper.inc.php \
|
|
||||||
--exclude=/site \
|
--exclude=/site \
|
||||||
--exclude=/src \
|
--exclude=/src \
|
||||||
--exclude=.stylelintignore \
|
--exclude=.stylelintignore \
|
||||||
|
|
|
||||||
|
|
@ -29,17 +29,13 @@
|
||||||
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
|
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
|
||||||
"post-install-cmd": [
|
"post-install-cmd": [
|
||||||
"@composer bin all install --ansi",
|
"@composer bin all install --ansi",
|
||||||
"vendor/bin/php-scoper add-prefix --force # Scope our dependencies",
|
"\"vendor/bin/mozart\" compose",
|
||||||
"@php lib-vendor-organizer.php lib/Vendor/ OCA\\\\Talk\\\\Vendor",
|
"composer dump-autoload"
|
||||||
"composer dump-autoload -o"
|
|
||||||
],
|
],
|
||||||
"post-update-cmd": [
|
"post-update-cmd": [
|
||||||
"@composer bin all update --ansi",
|
"@composer bin all update --ansi",
|
||||||
"vendor/bin/php-scoper add-prefix --force # Scope our dependencies",
|
"\"vendor/bin/mozart\" compose",
|
||||||
"rm -Rf lib/Vendor && mv build lib/Vendor",
|
"composer dump-autoload"
|
||||||
"find lib/Vendor/ -maxdepth 1 -mindepth 1 -type d | cut -d '/' -f3 | xargs -I {} rm -Rf vendor/{} # Remove origins",
|
|
||||||
"@php lib-vendor-organizer.php lib/Vendor/ OCA\\\\Talk\\\\Vendor",
|
|
||||||
"composer dump-autoload -o"
|
|
||||||
],
|
],
|
||||||
"test:unit": "vendor/bin/phpunit -c tests/php/phpunit.xml --colors=always --fail-on-warning --fail-on-risky"
|
"test:unit": "vendor/bin/phpunit -c tests/php/phpunit.xml --colors=always --fail-on-warning --fail-on-risky"
|
||||||
},
|
},
|
||||||
|
|
@ -51,5 +47,17 @@
|
||||||
"bamarni/composer-bin-plugin": "^1.8",
|
"bamarni/composer-bin-plugin": "^1.8",
|
||||||
"cuyz/valinor": "^1.14",
|
"cuyz/valinor": "^1.14",
|
||||||
"firebase/php-jwt": "^6.10"
|
"firebase/php-jwt": "^6.10"
|
||||||
|
},
|
||||||
|
"extra": {
|
||||||
|
"mozart": {
|
||||||
|
"dep_namespace": "OCA\\Talk\\Vendor\\",
|
||||||
|
"dep_directory": "/lib/Vendor/",
|
||||||
|
"classmap_directory": "/lib/autoload/",
|
||||||
|
"classmap_prefix": "NEXTCLOUDTALK_",
|
||||||
|
"packages": [
|
||||||
|
"firebase/php-jwt",
|
||||||
|
"cuyz/valinor"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,83 +0,0 @@
|
||||||
#!/usr/bin/env php
|
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
|
||||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
||||||
*/
|
|
||||||
|
|
||||||
$sourceDirectory = $argv[1];
|
|
||||||
$sourceDirectory = rtrim($sourceDirectory, '/') . '/';
|
|
||||||
|
|
||||||
if (!str_starts_with('/', $sourceDirectory)) {
|
|
||||||
$sourceDirectory = getcwd() . '/' . $sourceDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
$stripNamespacePrefix = $argv[2] ?? '';
|
|
||||||
if ($stripNamespacePrefix) {
|
|
||||||
printf("Namespace Prefix to strip from destination dir is %s%s", $stripNamespacePrefix, PHP_EOL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!file_exists($sourceDirectory) || !is_dir($sourceDirectory)) {
|
|
||||||
print("Directory not found");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
$organizationList = [];
|
|
||||||
foreach(scandir($sourceDirectory) as $file) {
|
|
||||||
if (!is_dir($sourceDirectory . $file) || $file === '.' || $file === '..') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$organizationList[] = $sourceDirectory . $file . '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
$projectList = [];
|
|
||||||
foreach($organizationList as $organizationDir) {
|
|
||||||
foreach(scandir($organizationDir) as $file) {
|
|
||||||
if (!is_dir($organizationDir . $file) || $file === '.' || $file === '..') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$projectList[] = $organizationDir . $file . '/';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($projectList as $projectDir) {
|
|
||||||
if (!file_exists($projectDir . 'composer.json')) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$projectInfo = json_decode(file_get_contents($projectDir . 'composer.json'), true);
|
|
||||||
if (!isset($projectInfo['autoload']['psr-4'])) {
|
|
||||||
printf("No supported autoload configuration in %s" . PHP_EOL, $projectDir);
|
|
||||||
exit(2);
|
|
||||||
}
|
|
||||||
foreach ($projectInfo['autoload']['psr-4'] as $namespace => $codeDir) {
|
|
||||||
if ($stripNamespacePrefix !== '' && strpos($namespace, $stripNamespacePrefix) === 0) {
|
|
||||||
$namespace = str_replace($stripNamespacePrefix, '', $namespace);
|
|
||||||
}
|
|
||||||
$destination = $sourceDirectory . str_replace('\\', '/', $namespace);
|
|
||||||
if (file_exists($destination)) {
|
|
||||||
rmdir_recursive($destination);
|
|
||||||
}
|
|
||||||
mkdir($destination, 0777, true);
|
|
||||||
if (!rename($projectDir . $codeDir, $destination)) {
|
|
||||||
printf("Failed to move %s to %s" . PHP_EOL, $projectDir . $codeDir, $destination);
|
|
||||||
exit(3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($organizationList as $organizationDir) {
|
|
||||||
rmdir_recursive($organizationDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
function rmdir_recursive($dir) {
|
|
||||||
foreach(scandir($dir) as $file) {
|
|
||||||
if ('.' === $file || '..' === $file) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (is_dir("$dir/$file")) {
|
|
||||||
rmdir_recursive("$dir/$file");
|
|
||||||
} else {
|
|
||||||
unlink("$dir/$file");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rmdir($dir);
|
|
||||||
}
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
/**
|
|
||||||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
|
||||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
||||||
*/
|
|
||||||
|
|
||||||
use Isolated\Symfony\Component\Finder\Finder;
|
|
||||||
|
|
||||||
// You can do your own things here, e.g. collecting symbols to expose dynamically
|
|
||||||
// or files to exclude.
|
|
||||||
// However, beware that this file is executed by PHP-Scoper, hence if you are using
|
|
||||||
// the PHAR it will be loaded by the PHAR. So it is highly recommended to avoid
|
|
||||||
// to autoload any code here: it can result in a conflict or even corrupt
|
|
||||||
// the PHP-Scoper analysis.
|
|
||||||
|
|
||||||
return [
|
|
||||||
// For more see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#prefix
|
|
||||||
'prefix' => 'OCA\\Talk\\Vendor',
|
|
||||||
'output-dir' => 'lib/Vendor',
|
|
||||||
|
|
||||||
// For more see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#finders-and-paths
|
|
||||||
'finders' => [
|
|
||||||
Finder::create()->files()
|
|
||||||
->exclude([
|
|
||||||
'test',
|
|
||||||
'composer',
|
|
||||||
'bin',
|
|
||||||
])
|
|
||||||
->notName('autoload.php')
|
|
||||||
->in('vendor/cuyz'),
|
|
||||||
Finder::create()->files()
|
|
||||||
->exclude([
|
|
||||||
'test',
|
|
||||||
'composer',
|
|
||||||
'bin',
|
|
||||||
])
|
|
||||||
->notName('autoload.php')
|
|
||||||
->in('vendor/psr/simple-cache'),
|
|
||||||
Finder::create()->files()
|
|
||||||
->exclude([
|
|
||||||
'test',
|
|
||||||
'composer',
|
|
||||||
'bin',
|
|
||||||
])
|
|
||||||
->notName('autoload.php')
|
|
||||||
->in('vendor/firebase'),
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
@ -6,6 +6,6 @@
|
||||||
"sort-packages": true
|
"sort-packages": true
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"humbug/php-scoper": "^0.18.7"
|
"coenjacobs/mozart": "^0.7.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue