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

Module loading #320

Open
thekid opened this issue Jan 16, 2017 · 2 comments
Open

Module loading #320

thekid opened this issue Jan 16, 2017 · 2 comments

Comments

@thekid
Copy link
Member

thekid commented Jan 16, 2017

Scope of Change

This RFC suggests adding the ability to load modules via class.pth.

Rationale

There is no counterpart for the command line option -m.

Functionality

# Local path and file references
src/main/php/
?vendor/autoload.php

# New: This is a module reference. Its path will be scanned for *.pth files
@../xp/inject/

Security considerations

n/a

Speed impact

Overhead (if not used) is one additional comparison: '@' === $path{0}; not measurable.

Dependencies

Implemented inside XP runners completely, compatible with all XP versions.

Related documents

RFC #318

@thekid
Copy link
Member Author

thekid commented Jan 16, 2017

Running with older XP runners, users will see errors like this:

$ xp -v
Uncaught exception: Exception ([bootstrap] Classpath element [./@../xp/inject/] not found)

@thekid
Copy link
Member Author

thekid commented Jan 16, 2017

💭 Second thought

Not entirely sure about this RFC's usefulness.

➖ Useful when handwiring dependencies; users will typically use Composer, though.
➕ On the other hand, it does create consistency with the command line.
➕ And its implementation only means a couple of lines of code.

@thekid thekid removed the framework label Jan 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant