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

PSR-4 Autoloading #741

Closed
marxo opened this issue Dec 6, 2014 · 5 comments
Closed

PSR-4 Autoloading #741

marxo opened this issue Dec 6, 2014 · 5 comments

Comments

@marxo
Copy link

marxo commented Dec 6, 2014

Is there a plan to make F3 compatible with PSR-4 autoloading. It does require namespacing, and I was wondering if anyone is able to work with PSR-4 now?

Thanks.

@ikkez
Copy link
Collaborator

ikkez commented Dec 6, 2014

if you need to adjust the autoloading, you can set a custom PSR-whatever compliant loader function to the AUTOLOAD hive var, check b114c8c

@sgpinkus
Copy link

@ikkez I don't think it is possible for fatfree to be PSR-4 or PSR-0 compliant because there is no "vendor" namespace. PSR spec states:

  1. The fully qualified class name MUST have a top-level namespace name, also known as a "vendor namespace".

@ikkez
Copy link
Collaborator

ikkez commented Jan 23, 2015

The autoloader itself is or can be PSR-X compatible. Maybe F3 lacks on having a vendor name, but when using F3 as application base, i don't see why it should be a problem to load vendor prefixed 3rd party libraries.

@marxo
Copy link
Author

marxo commented Jan 23, 2015

@sam-at-github I think that @ikkez is right, there shouldn't be a problem loading 3rd party libraries with the PSR-x compatible autoloader. The only thing that we're missing is loading the F3 itself as a module, but in terms of PSR-4 compatibility, that's only a matter of namespacing it, which is a trivial task I suppose.

@boussou
Copy link

boussou commented Jan 23, 2015

btw 2/ states:

2/The fully qualified class name MAY have one or more sub-namespace names.

so the top level could be Fatfree. and having a sub-name is optional (MAY)

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

5 participants