Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

README example should show PSR-4 autoloader instead of PSR-0 #1657

Closed
prahladyeri opened this issue Feb 5, 2019 · 5 comments
Closed

README example should show PSR-4 autoloader instead of PSR-0 #1657

prahladyeri opened this issue Feb 5, 2019 · 5 comments
Assignees

Comments

@prahladyeri
Copy link

prahladyeri commented Feb 5, 2019

I've observed that in composer.json you have configured auto-loader to PSR-4 standard, yet the comment in README.md example suggests using PSR-0 compliant autoloader:

// require the Faker autoloader
require_once '/path/to/Faker/src/autoload.php';
// alternatively, use another PSR-0 compliant autoloader (like the Symfony2 ClassLoader for instance)

Perhaps, the require should read something like this in case of PSR-4?

require_once 'vendor/autoload.php';

@prahladyeri prahladyeri changed the title README example should show PSR-4 example instead of PSR-0 README example should show PSR-4 autoloader instead of PSR-0 Feb 5, 2019
@Dzhuneyt
Copy link
Contributor

Your request is not quite clear. Could you elaborate?

@prahladyeri
Copy link
Author

Its too old, I've almost forgotten PHP since then lol! But from what I remember, there are different PSR standards for importing the auto-loader classes (PSR-0 & PSR-4 are most common). I think the one standard you are actually using in code differs from what you've provided in the example in README.md page (or at least did in February when I'd raised that bug).

But as I said, I may have mistaken. I've moved on to Python since then, so don't quite recall about this bug.

@Dzhuneyt
Copy link
Contributor

The readme now states:

// require the Faker autoloader
require_once '/path/to/Faker/src/autoload.php';
// alternatively, use another PSR-4 compliant autoloader

So I think this issue is no longer valid. Could be closed @fzaninotto @webr.

@pimjansen
Copy link
Contributor

Lets review the docs since it should explain both. Its recommended overall to load the composer autoloader but both should be possible

@pimjansen pimjansen self-assigned this Aug 24, 2019
@pimjansen
Copy link
Contributor

pimjansen commented Aug 27, 2019

#1780

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants