# Faker
Faker is a PHP library that generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Faker is for you.
Faker is heavily inspired by Perl's [Data::Faker](http://search.cpan.org/~jasonk/Data-Faker-0.07/), and by ruby's [Faker](https://rubygems.org/gems/faker).
Faker requires PHP >= 5.3.3.
[![Monthly Downloads](https://poser.pugx.org/fzaninotto/faker/d/monthly.png)](https://packagist.org/packages/fzaninotto/faker) [![Build Status](https://travis-ci.org/fzaninotto/Faker.svg?branch=master)](https://travis-ci.org/fzaninotto/Faker) [![SensioLabsInsight](https://insight.sensiolabs.com/projects/eceb78a9-38d4-4ad5-8b6b-b52f323e3549/mini.png)](https://insight.sensiolabs.com/projects/eceb78a9-38d4-4ad5-8b6b-b52f323e3549)
# Table of Contents
- [Installation](#installation)
- [Basic Usage](#basic-usage)
- [Formatters](#formatters)
- [Base](#fakerproviderbase)
- [Lorem Ipsum Text](#fakerproviderlorem)
- [Person](#fakerprovideren_usperson)
- [Address](#fakerprovideren_usaddress)
- [Phone Number](#fakerprovideren_usphonenumber)
- [Company](#fakerprovideren_uscompany)
- [Real Text](#fakerprovideren_ustext)
- [Date and Time](#fakerproviderdatetime)
- [Internet](#fakerproviderinternet)
- [User Agent](#fakerprovideruseragent)
- [Payment](#fakerproviderpayment)
- [Color](#fakerprovidercolor)
- [File](#fakerproviderfile)
- [Image](#fakerproviderimage)
- [Uuid](#fakerprovideruuid)
- [Barcode](#fakerproviderbarcode)
- [Miscellaneous](#fakerprovidermiscellaneous)
- [Biased](#fakerproviderbiased)
- [Modifiers](#modifiers)
- [Localization](#localization)
- [Populating Entities Using an ORM or an ODM](#populating-entities-using-an-orm-or-an-odm)
- [Seeding the Generator](#seeding-the-generator)
- [Faker Internals: Understanding Providers](#faker-internals-understanding-providers)
- [Real Life Usage](#real-life-usage)
- [Language specific formatters](#language-specific-formatters)
- [Third-Party Libraries Extending/Based On Faker](#third-party-libraries-extendingbased-on-faker)
- [License](#license)
## Installation
```sh
composer require fzaninotto/faker
```
## Basic Usage
Use `Faker\Factory::create()` to create and initialize a faker generator, which can generate data by accessing properties named after the type of data you want.
```php
<?php
// 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)
// use the factory to create a Faker\Generator instance
$faker = Faker\Factory::create();
// generate data by accessing properties
echo $faker->name;
// 'Lucy Cechtelar';
echo $faker->address;
// "426 Jordy Lodge
// Cartwrightshire, SC 88120-6700"
echo $faker->text;
// Dolores sit sint laboriosam dolorem culpa et autem. Beatae nam sunt fugit
// et sit et mollitia sed.
// Fuga deserunt tempora facere magni omnis. Omnis quia temporibus laudantium
// sit minima sint.
```
Even if this example shows a property access, each call to `$faker->name` yields a different (random) result. This is because Faker uses `__get()` magic, and forwards `Faker\Generator->$property` calls to `Faker\Generator->format($property)`.
```php
<?php
for ($i=0; $i < 10; $i++) {
echo $faker->name, "\n";
}
// Adaline Reichel
// Dr. Santa Prosacco DVM
// Noemy Vandervort V
// Lexi O'Conner
// Gracie Weber
// Roscoe Johns
// Emmett Lebsack
// Keegan Thiel
// Wellington Koelpin II
// Ms. Karley Kiehn V
```
**Tip**: For a quick generation of fake data, you can also use Faker as a command line tool thanks to [faker-cli](https://github.com/bit3/faker-cli).
## Formatters
Each of the generator properties (like `name`, `address`, and `lorem`) are called "formatters". A faker generator has many of them, packaged in "providers". Here is a list of the bundled formatters in the default locale.
### `Faker\Provider\Base`
randomDigit // 7
randomDigitNotNull // 5
randomNumber($nbDigits = NULL) // 79907610
randomFloat($nbMaxDecimals = NULL, $min = 0, $max = NULL) // 48.8932
numberBetween($min = 1000, $max = 9000) // 8567
randomLetter // 'b'
// returns randomly ordered subsequence of a provided array
randomElements($array = array ('a','b','c'), $count = 1) // array('c')
randomElement($array = array ('a','b','c')) // 'b'
shuffle('hello, world') // 'rlo,h eoldlw'
shuffle(array(1, 2, 3)) // array(2, 1, 3)
numerify('Hello ###') // 'Hello 609'
lexify('Hello ???') // 'Hello wgt'
bothify('Hello ##??') // 'Hello 42jz'
asciify('Hello ***') // 'Hello R6+'
regexify('[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}'); // [email protected]
### `Faker\Provider\Lorem`
word // 'aut'
words($nb = 3, $asText = false) // array('porro', 'sed', 'magni')
sentence($nbWords = 6, $variableNbWords = true) // 'Sit vitae voluptas sint non voluptates.'
sentences($nb = 3, $asText = false) // array('Optio quos qui illo error.', 'Laborum vero a officia id corporis.', 'Saepe provident esse hic eligendi.')
paragraph($nbSentences = 3, $variableNbSentences = true) // 'Ut ab voluptas sed a nam. Sint autem inventore aut officia aut aut blanditiis. Ducimus eos odit amet et est ut eum.'
paragraphs($nb = 3, $asText = false) // array('Quidem ut sunt et quidem est accusamus aut. Fuga est placeat rerum ut. Enim ex eveniet facere sunt.', 'Aut nam et eum architecto fugit repellendus illo. Qui ex esse veritatis.', 'Possimus omnis aut incidunt sunt. Asperiores incidunt iure sequi cum culpa rem. Rerum exercitationem est rem.')
text($maxNbChars = 200) // 'Fuga totam reiciendis qui architecto fugiat nemo. Consequatur recusandae qui cupiditate eos quod.'
### `Faker\Provider\en_US\Person`
title($gender = null|'male'|'female') // 'Ms.'
titleMale // 'Mr.'
titleFemale // 'Ms.'
suffix // 'Jr.'
name($gender = null|'male'|'female') // 'Dr. Zane Stroman'
firstName($gender = null|'male'|'female') // 'Maynard'
firstNameMale // 'Maynard'
firstNameFemale // 'Rachel'
lastName // 'Zulauf'
### `Faker\Provider\en_US\Address`
cityPrefix // 'Lake'
secondaryAddress // 'Suite 961'
state // 'NewMexico'
stateAbbr // 'OH'
citySuffix // 'borough'
streetSuffix // 'Keys'
buildingNumber // '484'
city // 'West Judge'
streetName // 'Keegan Trail'
streetAddress // '439 Karley Loaf Suite 897'
postcode // '17916'
address // '8888 Cummings Vista Apt. 101, Susanbury, NY 95473'
country // 'Falkland Islands (Malvinas)'
latitude($min = -90, $max = 90) // 77.147489
longitude($min = -180, $max = 180) // 86.211205
### `Faker\Provider\en_US\PhoneNumber`
phoneNumber // '201-886-0269 x3767'
tollFreePhoneNumber // '(888) 937-7238'
e164PhoneNumber // '+27113456789'
### `Faker\Provider\en_US\Company`
catchPhrase // 'Monitored regional contingency'
bs // 'e-enable robust architectures'
company // 'Bogan-Treutel'
companySuffix // 'and Sons'
jobTitle // 'Cashier'
### `Faker\Provider\en_US\Text`
realText($maxNbChars = 200,
没有合适的资源?快使用搜索试试~ 我知道了~
商之翼EcshopV4和商之翼EcshopV4.0.6 双版本.zip
共16041个文件
php:5544个
jpg:2651个
gif:2000个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 193 浏览量
2022-06-14
11:06:52
上传
评论
收藏 221.35MB ZIP 举报
温馨提示
安装教程: 1.解压上传压缩包文件到FTP目录下。 使用PHPMyAdmin、Navicat等还原根目录中的xiaojdv4.sql到您的数据库 2.数据库链接 找到data/config.php、mobile/data/config.php文件,修改如下配置 $db_name = “您的当前库名”; $db_user = “您的库所属用户”; $db_pass = “密码”; 3.进入网站后台点右上角清除缓存按钮。 刷新前台页面,正常访问。 后台地址:http://你的域名/admin/ 帐号:admin;密码:www.yunziyuan.com.cn
资源推荐
资源详情
资源评论
收起资源包目录
商之翼EcshopV4和商之翼EcshopV4.0.6 双版本.zip (16041个子文件)
a 0B
artisan 1KB
random_compat.phar.pubkey.asc 488B
user.php.bak 181KB
user.php.bak 109KB
index.dwt.bak 82KB
flow_jm.dwt.bak 67KB
structure.sql.bak 59KB
68ecshop_commin.css.bak 57KB
flow.dwt.bak 55KB
goods.dwt.bak 46KB
category.php.bak 27KB
index.dwt.bak 24KB
supplier.php.bak 22KB
goods.css.bak 20KB
page_headerindex.lbi.bak 15KB
takegoods.php.bak 12KB
public.css.bak 12KB
public.css.bak 12KB
init.php.bak 11KB
init.php.bak 11KB
config.php.bak 10KB
shipping_area_info.htm.bak 10KB
cat_goods.lbi.bak 8KB
goods_ziti.dwt.bak 8KB
user_transaction.dwt.bak 8KB
category_top_xy.dwt.bak 7KB
magiczoom_plus.js.bak 7KB
user_header.lbi.bak 6KB
page_footerindex.lbi.bak 5KB
sms.php.bak 5KB
sms.php.bak 5KB
takegoods.dwt.bak 5KB
user_address.lbi.bak 5KB
common_problem.lbi.bak 5KB
address_list.lbi.bak 4KB
footer_nav.lbi.bak 3KB
goods_gallery.lbi.bak 3KB
address_edit.lbi.bak 3KB
help.css.bak 3KB
user_clips.dwt.bak 3KB
catalog.css.bak 3KB
catalog.css.bak 3KB
help.dwt.bak 2KB
user_order_list.lbi.bak 2KB
user_nav.lbi.bak 2KB
customer_service.lbi.bak 2KB
takegoods_list.lbi.bak 2KB
baozhang.lbi.bak 2KB
pre_baozhang.lbi.bak 2KB
user_address_list.lbi.bak 1KB
cat_goods.lbi.bak 1KB
left_bar.lbi.bak 1KB
help.lbi.bak 963B
order_type.lbi.bak 734B
config.php.bak 556B
config.php.bak 537B
patch_num.bak 7B
patch_num.bak 7B
symfony_debug.c 7KB
verify_sign_acp.cer 2KB
acp_test_enc.cer 2KB
UpopRsaCert.cer 1KB
acp_prod_enc.cer 1KB
acp_test_middle.cer 1KB
EbppRsaCert.cer 1KB
encryptpub.cer 1KB
acp_test_root.cer 1KB
acp_prod_middle.cer 1KB
acp_prod_middle.cer 1KB
acp_prod_root.cer 1KB
acp_prod_root.cer 1KB
fckeditor.cfc 9KB
fckeditor.cfc 9KB
fckeditor.cfc 8KB
spellchecker.cfm 5KB
spellchecker.cfm 5KB
spellchecker.cfm 5KB
CHANGES 7KB
abc.dat.copy 0B
ab.dat.copy 0B
a.dat.copy 0B
ca.crt 1KB
sign2.crt 1KB
encrypt2.crt 1KB
sign.crt 1KB
encrypt.crt 1KB
intermediate.crt 1KB
app.5d21f9d34ad496540764a4742bdafcdf.css 299KB
app.5ce4626d5d9d7d6944a2d7ec96ce3dee.css 299KB
category.css 185KB
category.css 185KB
team_detail0705.css 145KB
team_detail0705.css 145KB
pshow.css 142KB
pshow.css 142KB
pshow.css 137KB
pshow.css 137KB
ecsmart.css 129KB
ecsmart.css 129KB
共 16041 条
- 1
- 2
- 3
- 4
- 5
- 6
- 161
资源评论
智慧浩海
- 粉丝: 1w+
- 资源: 5145
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功