Skip to content

fix: prevent activation fatal when installed without vendor/ - #2

Open
mboss97 wants to merge 1 commit into
CodeDrips:mainfrom
mboss97:fix/missing-autoloader-fatal
Open

fix: prevent activation fatal when installed without vendor/#2
mboss97 wants to merge 1 commit into
CodeDrips:mainfrom
mboss97:fix/missing-autoloader-fatal

Conversation

@mboss97

@mboss97 mboss97 commented Jul 16, 2026

Copy link
Copy Markdown
Member

The bootstrap loaded the PSR-4 AssetDrips\ namespace only through Composer's vendor/autoload.php, guarded by is_readable(). A distributed zip that shipped without a vendor/ directory therefore loaded no classes, and activation fataled:

Uncaught Error: Class "AssetDrips\Db\Schema" not found in assetdrips.php:48

The plugin has no third-party runtime dependencies, so the autoloader's only runtime job is mapping AssetDrips\ -> src/. Register a minimal built-in PSR-4 autoloader as a fallback when vendor/autoload.php is absent, making the plugin self-contained regardless of how it is packaged.

Fixes #1

What does this PR do?

Related issue

Type of change

  • Bug fix
  • New feature
  • Refactor / internal
  • Documentation
  • Other:

Checklist

  • composer test passes locally
  • composer lint is clean for the code I changed
  • I added/updated tests (a bug fix includes a test that fails before the fix)
  • Any file-modifying/removing behaviour is reversible (quarantine or verified backup)
  • I updated docs / CHANGELOG where relevant

Notes for reviewers

The bootstrap loaded the PSR-4 AssetDrips\ namespace only through Composer's
vendor/autoload.php, guarded by is_readable(). A distributed zip that shipped
without a vendor/ directory therefore loaded no classes, and activation fataled:

    Uncaught Error: Class "AssetDrips\Db\Schema" not found in assetdrips.php:48

The plugin has no third-party runtime dependencies, so the autoloader's only
runtime job is mapping AssetDrips\ -> src/. Register a minimal built-in PSR-4
autoloader as a fallback when vendor/autoload.php is absent, making the plugin
self-contained regardless of how it is packaged.

Fixes CodeDrips#1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fatal error upon install

1 participant