xp-framework / core

The XP Framework is an all-purpose, object oriented PHP framework.
Other
19 stars 6 forks source link

Class "lang\ClassLoader" not found #333

Closed thekid closed 1 year ago

thekid commented 1 year ago

Once upgrading to 11.8.0:

$ xp -v
Uncaught exception: Error (Class "lang\ClassLoader" not found)
  at <source> [line 3 of ./vendor/xp-framework/ast/src/main/php/autoload.php]
  at <main>('xp.runtime.Version') [line 0 of class-main.php]
  at <main>::require() [line 71 of autoload_real.php]
  at <main>::composerRequire03f113f3b3724916be38d3c1beba671e() [line 61 of autoload_real.php]
  at ComposerAutoloaderInit03f113f3b3724916be38d3c1beba671e::getLoader() [line 7 of autoload.php]
  at <main>::require('/.../vendor/autoload.php') [line 327 of class-main.php]
thekid commented 1 year ago

Reason: Now that 11.8.0 "require-dev"s xp-framework/test, which requires xp-framework/reflection, which requires xp-framework/ast, the autoloader tries to load these before the framework, and then fails with this error.

Here's the relevant part from vendor/composer/autoload_files.php:

return array(
    '407dbeaed57b1581d54fe3cb3c58c6fb' => $vendorDir . '/xp-framework/ast/src/main/php/autoload.php',
    'cd8d8a07898ee5f3694fc0eacf2817b4' => $vendorDir . '/xp-framework/reflection/src/main/php/autoload.php',
    'e10b8a64ae213e1e51e9f30ed2055b84' => $vendorDir . '/xp-framework/test/src/main/php/autoload.php',
    '6527753939c5a03150118bb2a1dfd1c8' => $vendorDir . '/xp-framework/core/src/main/php/__xp.php',
    // ...
thekid commented 1 year ago

Workaround for the moment:

$ composer up --no-dev