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

[3.0] better autoloading with PSR-4 #521

Closed
panique opened this issue Nov 3, 2014 · 2 comments
Closed

[3.0] better autoloading with PSR-4 #521

panique opened this issue Nov 3, 2014 · 2 comments

Comments

@panique
Copy link
Owner

panique commented Nov 3, 2014

The current standard in autoloading is probably to do it via Composer's PSR-4 autoloader.

More here: https://getcomposer.org/doc/04-schema.md#autoload

The most simply implementation would be (in composer.json):

{
    "autoload": {
        "psr-4": { "": "src/" }
    }
}

This would always look into src/ folder for any files. To have the autoloader look into multiple folders, the syntax would be:

        "psr-4": { "": ["src/", "lib/"] }
@panique
Copy link
Owner Author

panique commented Dec 1, 2014

Better: Namespace!
"psr-4": { "Mini\\": "Mini/" }

@panique panique changed the title [feature][3.0] better autoloading with PSR-4 [3.0] better autoloading with PSR-4 Dec 1, 2014
@panique panique added this to the 3.0 milestone Dec 1, 2014
@panique
Copy link
Owner Author

panique commented Dec 27, 2014

Done in develop branch. Better version will come !

@panique panique closed this as completed Dec 27, 2014
npuichigoB added a commit to npuichigoB/panique2 that referenced this issue Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant