Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer caching the relative path to a class in the ClassLoader #140

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

LukeTowers
Copy link
Member

@LukeTowers LukeTowers commented Feb 3, 2023

Adds Filesystem->isAbsolutePath() and changes the ClassLoader->autoloadPackage() logic to prefer storing a relative path to a class file over an absolute one.

This solves an issue that occurs when deploying using an atomic deployment strategy on a server where the storage folder is shared between deployments.

Adds Filesystem->isAbsolutePath() and changes the ClassLoader->autoloadPackage() logic to prefer storing a relative path to a class file over an absolute one.
@LukeTowers LukeTowers added this to the v1.2.2 milestone Feb 3, 2023
@what-the-diff
Copy link

what-the-diff bot commented Feb 3, 2023

  • Added a new method to the Filesystem class that determines if a path is absolute
  • Updated ClassLoader::resolvePath() so it uses this new method instead of its own implementation
  • Updated ClassLoaderTest::testResolvePath() with some additional test cases for resolving paths relative to the base path and also added tests for autoloading packages using an absolute or relative path (previously only supported loading from within the base directory)

@LukeTowers LukeTowers merged commit 642260e into develop Feb 3, 2023
@LukeTowers LukeTowers deleted the fix/cache-relative-class-paths branch February 3, 2023 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant