# Faker
[![Code Coverage](https://codecov.io/gh/fzaninotto/Faker/branch/master/graph/badge.svg)](https://codecov.io/gh/fzaninotto/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)
- [Html Lorem](#fakerproviderhtmllorem)
- [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
### Autoloading
Faker supports both `PSR-0` as `PSR-4` autoloaders.
```php
<?php
# When installed via composer
require_once 'vendor/autoload.php';
```
You can also load `Fakers` shipped `PSR-0` autoloader
```php
<?php
# Load Fakers own autoloader
require_once '/path/to/Faker/src/autoload.php';
```
*alternatively, you can use any another PSR-4 compliant autoloader*
### Create fake data
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
// 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
randomDigitNot(5) // 0, 1, 2, 3, 4, 6, 7, 8, or 9
randomDigitNotNull // 5
randomNumber($nbDigits = NULL, $strict = false) // 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}'); // sm0@y8k96a.ej
### `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-026
没有合适的资源?快使用搜索试试~ 我知道了~
云贝连锁V2独立版V2.2.2.zip
共2000个文件
php:6497个
js:5877个
css:1722个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 28 下载量 13 浏览量
2022-06-20
16:49:39
上传
评论 4
收藏 94.8MB ZIP 举报
温馨提示
云贝连锁V2独立版V2.2.2支持微信小程序、支付宝小程序、百度小程序、今日头条小程序、bucket语音小程序 测试环境: 系统环境:CentOS Linux 7.6.1810 (Core)、 运行环境:宝塔 Linux v7.0.3(专业版)、 网站环境:Nginx 1.15.10 + MySQL 5.6.46 + PHP-7.1 / PHP-5.6、 php插件:ionCube ;fileinfo ; redis ; Swoole ; sg11 本次更新内容: 备注:需要重新上传小程序 【新增】餐桌预订 堂食打印机顾客联打印小票 【新增】管理后台新增代理手机号(管理-操作员-手机号列表) 【优化】商户端外卖订单催单列表查询优化 【优化】公众号访问点单页异常 【优化】完善安徽省马鞍山市县市区 【修复】管理后台修改密码后及时不显示 【修复】主门店添加指定用户标签优惠券,子门店不能使用 【修复】快餐取餐号 【修复】设置—员工管理–员工列表:新增多个员工后,修改其中一个员工的排序字段后,其他所有员工消失不显示 【修复】代付不显示收货人 【修复】添加商品选择自定义时间段,商品添加成功会消
资源推荐
资源详情
资源评论
收起资源包目录
云贝连锁V2独立版V2.2.2.zip (2000个子文件)
pimple.c 37KB
symfony_debug.c 7KB
chunk-vendors.5857fd5e.css 487KB
chunk-vendors.067c3889.css 481KB
chunk-vendors.5219b42e.css 481KB
app.288e1c244d22f8dad5103e307283ce55.css 477KB
app.3fa6983e5b3eaad570bfdb512d695ea7.css 477KB
chunk-vendors.4bc76561.css 477KB
app.9af8b3589208e2e9e8f84fb9405c08e3.css 466KB
app.a668528e420acab67bf4778658c75e74.css 466KB
app.5a540058527dbc4191a8a2b9156a6a35.css 459KB
app.0994b4f1228a76eef46d280b043c99b8.css 459KB
app.ca74e2ccc46ce40fc5ec646ddb255d4a.css 455KB
app.d16559e66412d9ac8d8461d5d58632d6.css 455KB
app.0e430c097d3806dcd6b9e3f2962ffb35.css 452KB
app.de3ec83678c0af21f00dffc726f8e9a3.css 452KB
app.0d80595f171fb90bc5ccb492b172d49f.css 452KB
app.d253cc49cf2572dc5b8f5964bb4971ab.css 452KB
elm.css 227KB
chunk-vendors.16da611a.css 204KB
chunk-vendors.767f701c.css 204KB
summernote-bs3.css 149KB
bootstrap.css 143KB
bootstrap.css 143KB
bootstrap.min.css 120KB
bootstrap.min.css 119KB
bootstrap.min.css 119KB
bootstrap.min.css 118KB
bootstrap.min.css 118KB
main.css 115KB
main.css 106KB
style.min.css 97KB
index.f37b29dd.css 93KB
chunk-431ceb8a.412a08fb.css 81KB
chunk-18fe9bbc.412a08fb.css 81KB
chunk-6aaac0c0.412a08fb.css 81KB
chunk-02642180.412a08fb.css 81KB
chunk-1c66d339.412a08fb.css 81KB
chunk-57d5bd3e.412a08fb.css 81KB
chunk-49b2b0bd.412a08fb.css 81KB
ysw-animate.css 79KB
app.dc50c72c.css 47KB
app.98911eed.css 47KB
app.a8547245.css 47KB
app.603b0110.css 47KB
app.a44ecd4d.css 47KB
app.cf370d09.css 47KB
app.cac1a86c.css 47KB
app.ed6d3a5a.css 47KB
app.5ca2ad1b.css 47KB
app.acfdac9c.css 47KB
app.f030f04d.css 47KB
app.54ccfc80.css 47KB
app.5b4702d1.css 47KB
app.6c0fa4cb.css 47KB
app.fff8eda3.css 47KB
animate.min.css 46KB
app.5bf59aaf.css 45KB
ueditor.css 45KB
ueditor_1.css 45KB
app.4386195f.css 41KB
app.ddf20d0e.css 37KB
app.81747d1f.css 37KB
app.fc966173.css 37KB
app.b9af544c.css 37KB
chunk-7d1a99b6.c37f8dee.css 36KB
chunk-7f834b5c.c37f8dee.css 36KB
chunk-3e3075c2.c37f8dee.css 36KB
chunk-25637f52.c37f8dee.css 36KB
chunk-26f000be.c37f8dee.css 36KB
chunk-46124b7c.c37f8dee.css 36KB
chunk-29cb1ee1.c37f8dee.css 36KB
ueditor.min.css 34KB
ueditor.min_1.css 34KB
datepicker3.css 34KB
docs.css 30KB
font-awesome.min.css 28KB
font-awesome.min.css 26KB
ambiance.css 26KB
bootstrap-theme.css 25KB
bootstrap-theme.css 25KB
style.min.css 25KB
docs.min.css 25KB
bootstrap-theme.min.css 23KB
bootstrap-theme.min.css 23KB
video-js.css 22KB
video-js_1.css 22KB
image_1.css 19KB
image.css 19KB
sweetalert.css 18KB
simditor.css 18KB
video_1.css 15KB
video.css 15KB
attachment_1.css 15KB
attachment.css 15KB
layer.css 14KB
jasny-bootstrap.min.css 14KB
public.css 13KB
chosen.css 13KB
dropzone.css 12KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
雨信
- 粉丝: 28
- 资源: 290
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 1111111111111111111111
- 基于Vue和JavaScript的站酷首页设计源码
- 47-陈明杰-《分布式计算课程实训》实训综合报告.docx
- DMG3415UQ-7-VB一款SOT23封装P-Channel场效应MOS管
- WINCC 7.5 SP2在部分WIN11系统中无法安装(SQL无法安装)的解决办法.docx
- DMG3415UFY4-7-VB一款SOT23封装P-Channel场效应MOS管
- 华北电力大学硕士生入学考试初试科目考试大纲
- 基于STM32F405单片机LQFP144封装多轴运动控制器开发板硬件(原理图+PCB)工程文件.zip
- DMG3415U-13-VB一款SOT23封装P-Channel场效应MOS管
- ios1.2.1.ipa
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页