vendor: unique composer bootstrap class names

vendor/ was seeded by copying af_readability's tree, so both plugins shipped
ComposerAutoloaderInitb44cc79a… and ComposerStaticInitb44cc79a…. tt-rss's
Preferences page loads every plugin on disk regardless of whether it is enabled,
so the second require redeclared those classes and fataled the request.

tt-rss blames whichever plugin lost the race -- the reported error named
af_readability, which was the innocent party.

Verified both autoloaders now load in the same process and the vendored
Readability and Masterminds classes still resolve.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011sSJdftQx5bW5HZHgUKF3i
This commit is contained in:
Michal
2026-08-30 06:43:56 +01:00
parent 0504f6cc87
commit b297c19090
4 changed files with 30 additions and 9 deletions

View File

@@ -10,3 +10,24 @@ here and recorded below.
$filterFn = null`. Implicitly nullable parameters are deprecated as of PHP 8.4, $filterFn = null`. Implicitly nullable parameters are deprecated as of PHP 8.4,
and the tt-rss app image is on PHP 8.5, so without this every extraction emits a and the tt-rss app image is on PHP 8.5, so without this every extraction emits a
deprecation notice. deprecation notice.
## composer autoloader class name
`vendor/` was seeded by copying `tt-rss-plugin-af-readability`'s tree, so both
plugins shipped the same generated bootstrap classes —
`ComposerAutoloaderInitb44cc79a…` and `ComposerStaticInitb44cc79a…`.
tt-rss's Preferences page (`Pref_Prefs::getPluginsList()` → `PluginHost::load_all()`)
loads **every** plugin on disk, enabled or not. The second `require vendor/autoload.php`
then redeclared those classes and PHP fataled, which tt-rss reports as:
> Plugin af_readability has caused a PHP fatal error so it won't be loaded again
> in this session.
— naming whichever plugin lost the race, not the one at fault.
The hash in `vendor/autoload.php`, `vendor/composer/autoload_real.php` and
`vendor/composer/autoload_static.php` is therefore rewritten to
`affulltext0000000000000000000001`. Regenerating `vendor/` with composer would
also fix it (composer derives the hash per-install); if you ever do, keep the
name distinct from any other tt-rss plugin's.

2
vendor/autoload.php vendored
View File

@@ -19,4 +19,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php'; require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitb44cc79a0eaef9cd9c2f2ac697cbe9c0::getLoader(); return ComposerAutoloaderInitaffulltext0000000000000000000001::getLoader();

View File

@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInitb44cc79a0eaef9cd9c2f2ac697cbe9c0 class ComposerAutoloaderInitaffulltext0000000000000000000001
{ {
private static $loader; private static $loader;
@@ -24,12 +24,12 @@ class ComposerAutoloaderInitb44cc79a0eaef9cd9c2f2ac697cbe9c0
require __DIR__ . '/platform_check.php'; require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInitb44cc79a0eaef9cd9c2f2ac697cbe9c0', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInitaffulltext0000000000000000000001', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitb44cc79a0eaef9cd9c2f2ac697cbe9c0', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInitaffulltext0000000000000000000001', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php'; require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitb44cc79a0eaef9cd9c2f2ac697cbe9c0::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInitaffulltext0000000000000000000001::getInitializer($loader));
$loader->register(true); $loader->register(true);

View File

@@ -4,7 +4,7 @@
namespace Composer\Autoload; namespace Composer\Autoload;
class ComposerStaticInitb44cc79a0eaef9cd9c2f2ac697cbe9c0 class ComposerStaticInitaffulltext0000000000000000000001
{ {
public static $prefixLengthsPsr4 = array ( public static $prefixLengthsPsr4 = array (
'f' => 'f' =>
@@ -94,9 +94,9 @@ class ComposerStaticInitb44cc79a0eaef9cd9c2f2ac697cbe9c0
public static function getInitializer(ClassLoader $loader) public static function getInitializer(ClassLoader $loader)
{ {
return \Closure::bind(function () use ($loader) { return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitb44cc79a0eaef9cd9c2f2ac697cbe9c0::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInitaffulltext0000000000000000000001::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitb44cc79a0eaef9cd9c2f2ac697cbe9c0::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInitaffulltext0000000000000000000001::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitb44cc79a0eaef9cd9c2f2ac697cbe9c0::$classMap; $loader->classMap = ComposerStaticInitaffulltext0000000000000000000001::$classMap;
}, null, ClassLoader::class); }, null, ClassLoader::class);
} }