Skip to content

Commit a3b9d0b

Browse files
Vitexusclaude
andcommitted
fix: use system php-league-oauth2-client instead of bundled vendor
- debian/rules: stop copying league/oauth2-client and ralouphie/getallheaders from vendor; only kint remains bundled (no Debian package available) - debian/autoload.php: load League\OAuth2\Client from system autoloader, drop bundled getallheaders.php, simplify Kint spl_autoload_register - debian/control: add php-league-oauth2-client to runtime Depends Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9c9fc23 commit a3b9d0b

3 files changed

Lines changed: 8 additions & 15 deletions

File tree

debian/autoload.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
require_once '/usr/share/php/GuzzleHttp/autoload.php';
1212
require_once '/usr/share/php/Psr/Http/Message/autoload.php';
1313
require_once '/usr/share/php/Psr/Http/Message/factory-autoload.php';
14+
require_once '/usr/share/php/League/OAuth2/Client/autoload.php';
1415

1516
// Bundled vendor helpers (no Debian package available)
16-
require_once '/usr/lib/csas-authorize/vendor/getallheaders.php';
1717
require_once '/usr/lib/csas-authorize/vendor/kint_init.php';
1818

1919
// System CSasAccounts library (SpojeNet\CSas\Accounts\*, SpojeNet\CSas\Modes\*, etc.)
@@ -40,17 +40,11 @@
4040

4141
// Bundled vendor packages (no Debian equivalent)
4242
spl_autoload_register(function (string $class): void {
43-
$map = [
44-
'League\\OAuth2\\Client\\' => '/usr/lib/csas-authorize/vendor/League/OAuth2/Client/',
45-
'Kint\\' => '/usr/lib/csas-authorize/vendor/Kint/',
46-
];
47-
foreach ($map as $prefix => $base) {
48-
if (str_starts_with($class, $prefix)) {
49-
$file = $base . str_replace('\\', '/', substr($class, strlen($prefix))) . '.php';
50-
if (file_exists($file)) {
51-
require $file;
52-
}
53-
return;
43+
if (str_starts_with($class, 'Kint\\')) {
44+
$file = '/usr/lib/csas-authorize/vendor/Kint/'
45+
. str_replace('\\', '/', substr($class, 5)) . '.php';
46+
if (file_exists($file)) {
47+
require $file;
5448
}
5549
}
5650
});

debian/control

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Depends:
2222
php-vitexsoftware-ease-bootstrap5-widgets,
2323
php-vitexsoftware-ease-fluentpdo,
2424
php-spojenet-csas-accountsapi,
25+
php-league-oauth2-client,
2526
php-guzzlehttp-guzzle,
2627
php-guzzlehttp-promises,
2728
php-guzzlehttp-psr7,

debian/rules

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ BUNDLED := debian/csas-authorize/usr/lib/csas-authorize/vendor
1212
override_dh_install:
1313
dh_install
1414
# Bundle vendor packages that have no Debian equivalent
15-
install -d $(BUNDLED)/League/OAuth2
16-
cp -r vendor/league/oauth2-client/src $(BUNDLED)/League/OAuth2/Client
17-
cp vendor/ralouphie/getallheaders/src/getallheaders.php $(BUNDLED)/getallheaders.php
15+
install -d $(BUNDLED)
1816
cp -r vendor/kint-php/kint/src $(BUNDLED)/Kint
1917
cp vendor/kint-php/kint/init.php $(BUNDLED)/kint_init.php
2018
# Install static autoloader

0 commit comments

Comments
 (0)