Comments (13)
Yeah, not sure about that. The factory will work if you add an autoloaded Provider. But I'm not sure I'll add Yet Another Autoloader - or a dependency to PSR-0 autoloader.
from faker.
You should avoid require()
methods too.
And a PSR-0 autoloader is a standard, I guess you want to follow conventions for this lib :)
Le 15 oct. 2011 à 14:15, Francois [email protected] a écrit :
Yeah, not sure about that. The factory will work if you add an autoloaded Provider. But I'm not sure I'll add Yet Another Autoloader - or a dependency to PSR-0 autoloader.
Reply to this email directly or view it on GitHub:
#5 (comment)
from faker.
Why should I avoid require()? Not way to to otherwise if I don't want to use
an autoloader.
A PSR-0 autoloader is a dependency. For now, this project has none, and
therefore is very easy to install. I'd like to keep that.
Besides, there are a lot of good libs that don't feel obliged to use an
autoloader. See, for instance:
https://github.com/fabpot/yaml
2011/10/15 William DURAND <
[email protected]>
You should avoid
require()
methods too.
And a PSR-0 autoloader is a standard, I guess you want to follow
conventions for this lib :)Le 15 oct. 2011 14:15, Francois [email protected] a
crit :Yeah, not sure about that. The factory will work if you add an autoloaded
Provider. But I'm not sure I'll add Yet Another Autoloader - or a dependency
to PSR-0 autoloader.Reply to this email directly or view it on GitHub:
#5 (comment)Reply to this email directly or view it on GitHub:
#5 (comment)
from faker.
+1 for this.. I can't use this in my Symfony2 application because you don't have the "Faker" directory inside the src/ dir.
from faker.
Btw, the fabpot/yaml library is made for PHP 5.2 not 5.3
from faker.
So now we have a standard directory structure. But do we need an autoloader?
from faker.
If you want to avoid require
and add use
instead, probably yes. Otherwise no but I don't know if it will work fine.
from faker.
We already use use
. And the Factory has some sort of autoloading for Providers with a cascade to default locale, that an autoloader won't allow. So I think we don't need a PSR-0 autoloader, and I think Faker works fine in projects that already have an autoloader.
I'll wait for more feedback, but I'll probably close this one.
from faker.
Mmmmh I meant to avoid this kind of statement: https://github.com/fzaninotto/Faker/blob/master/src/Faker/Factory.php#L5
from faker.
Yes, I got you loud and clear. But require
isn't a bad word per se. There, requires allow any developer to start using the library without installing a third-party autoloader - right away.
from faker.
Why not add a small autoload.php file (like the autoload function in https://wiki.php.net/rfc/splclassloader) for people that doesn't use an autoloader or use a not PSR-0 compatible autoloader ?
It could be a compromise beetween the requires and the dependency to an autoloader...
from faker.
Fixed by #13
from faker.
\o/
from faker.
Related Issues (20)
- How to generate a column data depend on other column data HOT 1
- eCommerce Feature request HOT 1
- Doctrine Populator: Don't clean entity manager HOT 1
- Kz faker random wrong output from getCenturyByYear
- [BUG] dateTimeThisYear method does not generate a properly date with current year
- Got 'Unknown formatter "tollFreePhoneNumber"' using es_ES locale HOT 1
- Unknown formatter secondaryAddress does not exist HOT 1
- Improvement maybe: Fill any object you want.
- Maximum retries of 10000 reached without finding a unique value HOT 1
- Suggestion - Faker method to randomly execute HOT 1
- Feature request: Codes for the representation of names of scripts (ISO 15924)
- dateTimeThisDecade is previous decade HOT 2
- Add zh_CN PhoneNumber TestCase & TollFreePhoneNumber API & E164PhoneNumber API
- Doctrine\Common\Persistence\ is Deprecated in 5.0 Symfony
- Undefined type 'Database\Seeders\Faker\Factory'.intelephense(1009) HOT 1
- buildingNumber is 0, 00, 000 in some locales
- In DatabaseServiceProvider.php line 88: Class 'Faker\Factory' not found HOT 2
- [Feature request] Add profanity and rude words generator HOT 6
- Lorempixel.com is down HOT 2
- Set next as default branch
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faker.