gabordemooij / redbean

ORM layer that creates models, config and database on the fly
https://www.redbeanphp.com
2.3k stars 279 forks source link

Two classes (Pool and PoolDB) does not comply with psr-4 autoloading standard #905

Closed H0pex closed 1 year ago

H0pex commented 1 year ago

Log from a composer installing package:

composer require gabordemooij/redbean

Using version ^5.7 for gabordemooij/redbean
./composer.json has been updated
Running composer update gabordemooij/redbean
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
  - Locking gabordemooij/redbean (v5.7.3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Downloading gabordemooij/redbean (v5.7.3)
  - Installing gabordemooij/redbean (v5.7.3): Extracting archive
Generating optimized autoload files
Class RedBeanPHP\Plugin\NonStaticBeanHelper located in vendor\gabordemooij\redbean\RedBeanPHP\Plugin\Pool.php does not comply with psr-4 autoloading standard. Skipping.
Class RedBeanPHP\Plugin\PoolDB located in vendor\gabordemooij\redbean\RedBeanPHP\Plugin\Pool.php does not comply with psr-4 autoloading standard. Skipping.
gabordemooij commented 1 year ago

Thanks for reporting. I will have to look into this.

gabordemooij commented 1 year ago

Hi, I investigated the issue for you.

Those classes are experimental and not used by most, so they are not autoloaded and they are also not part of the all-in-one package. In general plugins should not be autoloaded because the quality of the plugins cannot be assured and they have their own loading system (R::ext) that predates composer.

Unfortunately there does not seem to be a way to 'exclude' them from the autoloader check, so you see this annoying warning. There used to be an exclusion mechanism in composer but it only seems to work for standard classmaps, not PSR-4. So, it seems like there is no way to remove this warning, but on the other hand the warning is not relevant and can be ignored safely.

H0pex commented 1 year ago

Thank you for taking the time to answer my question!