Allow autoload.json in arbitrary directories, do not require root namespace in path/allow arbitrary path per root namespace. #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Leaving this here for review, mostly.
My use case, that prompted me to make these changes in my fork
The directory structure that I'm working with here is PSR-0-like, but not compatible with PSR-0, because it doesn't use the root namespace in any folders. (Actually, it does use the root namespace in the project's root folder, but there are a couple of directories between the root folder and the folder where autoloaded classes reside.)
My directory structure:
bootstrap.php
which I will include lower with my example of how to useSo, because of the project's special needs, I have edited the \Axel\Module\Library class to be a bit more configurable, and maintaining backwards compatibility by making the new constructor arguments optional.
Here's
/bigdumbogre/Private/bootstrap.php
, as an example of how I'm using it./bigdumbogre/Private/Classes/Configuration/autoload.json
for this projectAnd
/bigdumbogre/index.php
that is able to get an arbitrary class