ar_JO
5 years ago
ar_SA
5 years ago
at_AT
5 years ago
bg_BG
5 years ago
bn_BD
5 years ago
cs_CZ
5 years ago
da_DK
5 years ago
de_AT
5 years ago
de_CH
5 years ago
de_DE
5 years ago
el_CY
5 years ago
el_GR
5 years ago
en_AU
5 years ago
en_CA
5 years ago
en_GB
5 years ago
en_HK
5 years ago
en_IN
5 years ago
en_NG
5 years ago
en_NZ
5 years ago
en_PH
5 years ago
en_SG
5 years ago
en_UG
5 years ago
en_US
5 years ago
en_ZA
5 years ago
es_AR
5 years ago
es_ES
5 years ago
es_PE
5 years ago
es_VE
5 years ago
et_EE
5 years ago
fa_IR
5 years ago
fi_FI
5 years ago
fr_BE
5 years ago
fr_CA
5 years ago
fr_CH
5 years ago
fr_FR
5 years ago
he_IL
5 years ago
hr_HR
5 years ago
hu_HU
5 years ago
hy_AM
5 years ago
id_ID
5 years ago
is_IS
5 years ago
it_CH
5 years ago
it_IT
5 years ago
ja_JP
5 years ago
ka_GE
5 years ago
kk_KZ
5 years ago
ko_KR
5 years ago
lt_LT
5 years ago
lv_LV
5 years ago
me_ME
5 years ago
mn_MN
5 years ago
ms_MY
5 years ago
nb_NO
5 years ago
ne_NP
5 years ago
nl_BE
5 years ago
nl_NL
5 years ago
pl_PL
5 years ago
pt_BR
5 years ago
pt_PT
5 years ago
ro_MD
5 years ago
ro_RO
5 years ago
ru_RU
5 years ago
sk_SK
5 years ago
sl_SI
5 years ago
sr_Cyrl_RS
5 years ago
sr_Latn_RS
5 years ago
sr_RS
5 years ago
sv_SE
5 years ago
th_TH
5 years ago
tr_TR
5 years ago
uk_UA
5 years ago
vi_VN
5 years ago
zh_CN
5 years ago
zh_TW
5 years ago
Address.php
5 years ago
Barcode.php
5 years ago
Base.php
5 years ago
Biased.php
5 years ago
Color.php
5 years ago
Company.php
5 years ago
DateTime.php
5 years ago
File.php
5 years ago
HtmlLorem.php
5 years ago
Image.php
5 years ago
Internet.php
5 years ago
Lorem.php
5 years ago
Miscellaneous.php
5 years ago
Payment.php
5 years ago
Person.php
5 years ago
PhoneNumber.php
5 years ago
Text.php
5 years ago
UserAgent.php
5 years ago
Uuid.php
5 years ago
Internet.php
372 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Faker\Provider; |
| 4 | |
| 5 | class Internet extends Base |
| 6 | { |
| 7 | protected static $freeEmailDomain = array('gmail.com', 'yahoo.com', 'hotmail.com'); |
| 8 | protected static $tld = array('com', 'com', 'com', 'com', 'com', 'com', 'biz', 'info', 'net', 'org'); |
| 9 | |
| 10 | protected static $userNameFormats = array( |
| 11 | '{{lastName}}.{{firstName}}', |
| 12 | '{{firstName}}.{{lastName}}', |
| 13 | '{{firstName}}##', |
| 14 | '?{{lastName}}', |
| 15 | ); |
| 16 | protected static $emailFormats = array( |
| 17 | '{{userName}}@{{domainName}}', |
| 18 | '{{userName}}@{{freeEmailDomain}}', |
| 19 | ); |
| 20 | protected static $urlFormats = array( |
| 21 | 'http://www.{{domainName}}/', |
| 22 | 'http://{{domainName}}/', |
| 23 | 'http://www.{{domainName}}/{{slug}}', |
| 24 | 'http://www.{{domainName}}/{{slug}}', |
| 25 | 'https://www.{{domainName}}/{{slug}}', |
| 26 | 'http://www.{{domainName}}/{{slug}}.html', |
| 27 | 'http://{{domainName}}/{{slug}}', |
| 28 | 'http://{{domainName}}/{{slug}}', |
| 29 | 'http://{{domainName}}/{{slug}}.html', |
| 30 | 'https://{{domainName}}/{{slug}}.html', |
| 31 | ); |
| 32 | |
| 33 | /** |
| 34 | * @example 'jdoe@acme.biz' |
| 35 | */ |
| 36 | public function email() |
| 37 | { |
| 38 | $format = static::randomElement(static::$emailFormats); |
| 39 | |
| 40 | return $this->generator->parse($format); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * @example 'jdoe@example.com' |
| 45 | */ |
| 46 | final public function safeEmail() |
| 47 | { |
| 48 | return preg_replace('/\s/u', '', $this->userName() . '@' . static::safeEmailDomain()); |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * @example 'jdoe@gmail.com' |
| 53 | */ |
| 54 | public function freeEmail() |
| 55 | { |
| 56 | return preg_replace('/\s/u', '', $this->userName() . '@' . static::freeEmailDomain()); |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * @example 'jdoe@dawson.com' |
| 61 | */ |
| 62 | public function companyEmail() |
| 63 | { |
| 64 | return preg_replace('/\s/u', '', $this->userName() . '@' . $this->domainName()); |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * @example 'gmail.com' |
| 69 | */ |
| 70 | public static function freeEmailDomain() |
| 71 | { |
| 72 | return static::randomElement(static::$freeEmailDomain); |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * @example 'example.org' |
| 77 | */ |
| 78 | final public static function safeEmailDomain() |
| 79 | { |
| 80 | $domains = array( |
| 81 | 'example.com', |
| 82 | 'example.org', |
| 83 | 'example.net' |
| 84 | ); |
| 85 | |
| 86 | return static::randomElement($domains); |
| 87 | } |
| 88 | /** |
| 89 | * @example 'jdoe' |
| 90 | */ |
| 91 | public function userName() |
| 92 | { |
| 93 | $format = static::randomElement(static::$userNameFormats); |
| 94 | $username = static::bothify($this->generator->parse($format)); |
| 95 | |
| 96 | $username = strtolower(static::transliterate($username)); |
| 97 | |
| 98 | // check if transliterate() didn't support the language and removed all letters |
| 99 | if (trim($username, '._') === '') { |
| 100 | throw new \Exception('userName failed with the selected locale. Try a different locale or activate the "intl" PHP extension.'); |
| 101 | } |
| 102 | |
| 103 | // clean possible trailing dots from first/last names |
| 104 | $username = str_replace('..', '.', $username); |
| 105 | $username = rtrim($username, '.'); |
| 106 | |
| 107 | return $username; |
| 108 | } |
| 109 | /** |
| 110 | * @example 'fY4èHdZv68' |
| 111 | */ |
| 112 | public function password($minLength = 6, $maxLength = 20) |
| 113 | { |
| 114 | $pattern = str_repeat('*', $this->numberBetween($minLength, $maxLength)); |
| 115 | |
| 116 | return $this->asciify($pattern); |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * @example 'tiramisu.com' |
| 121 | */ |
| 122 | public function domainName() |
| 123 | { |
| 124 | return $this->domainWord() . '.' . $this->tld(); |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * @example 'faber' |
| 129 | */ |
| 130 | public function domainWord() |
| 131 | { |
| 132 | $lastName = $this->generator->format('lastName'); |
| 133 | |
| 134 | $lastName = strtolower(static::transliterate($lastName)); |
| 135 | |
| 136 | // check if transliterate() didn't support the language and removed all letters |
| 137 | if (trim($lastName, '._') === '') { |
| 138 | throw new \Exception('domainWord failed with the selected locale. Try a different locale or activate the "intl" PHP extension.'); |
| 139 | } |
| 140 | |
| 141 | // clean possible trailing dot from last name |
| 142 | $lastName = rtrim($lastName, '.'); |
| 143 | |
| 144 | return $lastName; |
| 145 | } |
| 146 | |
| 147 | /** |
| 148 | * @example 'com' |
| 149 | */ |
| 150 | public function tld() |
| 151 | { |
| 152 | return static::randomElement(static::$tld); |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * @example 'http://www.runolfsdottir.com/' |
| 157 | */ |
| 158 | public function url() |
| 159 | { |
| 160 | $format = static::randomElement(static::$urlFormats); |
| 161 | |
| 162 | return $this->generator->parse($format); |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * @example 'aut-repellat-commodi-vel-itaque-nihil-id-saepe-nostrum' |
| 167 | */ |
| 168 | public function slug($nbWords = 6, $variableNbWords = true) |
| 169 | { |
| 170 | if ($nbWords <= 0) { |
| 171 | return ''; |
| 172 | } |
| 173 | if ($variableNbWords) { |
| 174 | $nbWords = (int) ($nbWords * mt_rand(60, 140) / 100) + 1; |
| 175 | } |
| 176 | $words = $this->generator->words($nbWords); |
| 177 | |
| 178 | return join('-', $words); |
| 179 | } |
| 180 | |
| 181 | /** |
| 182 | * @example '237.149.115.38' |
| 183 | */ |
| 184 | public function ipv4() |
| 185 | { |
| 186 | return long2ip(mt_rand(0, 1) == 0 ? mt_rand(-2147483648, -2) : mt_rand(16777216, 2147483647)); |
| 187 | } |
| 188 | |
| 189 | /** |
| 190 | * @example '35cd:186d:3e23:2986:ef9f:5b41:42a4:e6f1' |
| 191 | */ |
| 192 | public function ipv6() |
| 193 | { |
| 194 | $res = array(); |
| 195 | for ($i=0; $i < 8; $i++) { |
| 196 | $res []= dechex(mt_rand(0, "65535")); |
| 197 | } |
| 198 | |
| 199 | return join(':', $res); |
| 200 | } |
| 201 | |
| 202 | /** |
| 203 | * @example '10.1.1.17' |
| 204 | */ |
| 205 | public static function localIpv4() |
| 206 | { |
| 207 | if (static::numberBetween(0, 1) === 0) { |
| 208 | // 10.x.x.x range |
| 209 | return long2ip(static::numberBetween(ip2long("10.0.0.0"), ip2long("10.255.255.255"))); |
| 210 | } |
| 211 | |
| 212 | // 192.168.x.x range |
| 213 | return long2ip(static::numberBetween(ip2long("192.168.0.0"), ip2long("192.168.255.255"))); |
| 214 | } |
| 215 | |
| 216 | /** |
| 217 | * @example '32:F1:39:2F:D6:18' |
| 218 | */ |
| 219 | public static function macAddress() |
| 220 | { |
| 221 | for ($i=0; $i<6; $i++) { |
| 222 | $mac[] = sprintf('%02X', static::numberBetween(0, 0xff)); |
| 223 | } |
| 224 | $mac = implode(':', $mac); |
| 225 | |
| 226 | return $mac; |
| 227 | } |
| 228 | |
| 229 | protected static function transliterate($string) |
| 230 | { |
| 231 | if (0 === preg_match('/[^A-Za-z0-9_.]/', $string)) { |
| 232 | return $string; |
| 233 | } |
| 234 | |
| 235 | $transId = 'Any-Latin; Latin-ASCII; NFD; [:Nonspacing Mark:] Remove; NFC;'; |
| 236 | if (class_exists('Transliterator', false) && $transliterator = \Transliterator::create($transId)) { |
| 237 | $transString = $transliterator->transliterate($string); |
| 238 | } else { |
| 239 | $transString = static::toAscii($string); |
| 240 | } |
| 241 | |
| 242 | return preg_replace('/[^A-Za-z0-9_.]/u', '', $transString); |
| 243 | } |
| 244 | |
| 245 | protected static function toAscii($string) |
| 246 | { |
| 247 | static $arrayFrom, $arrayTo; |
| 248 | |
| 249 | if (empty($arrayFrom)) { |
| 250 | $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'C', |
| 338 | 'Ш'=>'S', 'Щ'=>'S', 'Ы'=>'Y', 'Э'=>'E', 'Ю'=>'Y', 'Я'=>'Y', |
| 339 | 'а'=>'A', 'б'=>'B', 'в'=>'V', 'г'=>'G', 'д'=>'D', 'е'=>'E', |
| 340 | 'ё'=>'E', 'ж'=>'Z', 'з'=>'Z', 'и'=>'I', 'й'=>'I', 'к'=>'K', |
| 341 | 'л'=>'L', 'м'=>'M', 'н'=>'N', 'о'=>'O', 'п'=>'P', 'р'=>'R', |
| 342 | 'с'=>'S', 'т'=>'T', 'у'=>'U', 'ф'=>'F', '� |
| 343 | '=>'K', 'ц'=>'T', |
| 344 | 'ч'=>'C', 'ш'=>'S', 'щ'=>'S', 'ы'=>'Y', 'э'=>'E', 'ю'=>'Y', |
| 345 | 'я'=>'Y', 'ð'=>'d', 'Ð'=>'D', 'þ'=>'t', 'Þ'=>'T', 'ა'=>'a', |
| 346 | 'ბ'=>'b', 'გ'=>'g', 'დ'=>'d', 'ე'=>'e', 'ვ'=>'v', 'ზ'=>'z', |
| 347 | 'თ'=>'t', 'ი'=>'i', 'კ'=>'k', 'ლ'=>'l', 'მ'=>'m', 'ნ'=>'n', |
| 348 | 'ო'=>'o', 'პ'=>'p', 'ჟ'=>'z', 'რ'=>'r', 'ს'=>'s', 'ტ'=>'t', |
| 349 | 'უ'=>'u', 'ფ'=>'p', 'ქ'=>'k', 'ღ'=>'g', 'ყ'=>'q', 'შ'=>'s', |
| 350 | 'ჩ'=>'c', 'ც'=>'t', 'ძ'=>'d', 'წ'=>'t', 'ჭ'=>'c', 'ხ'=>'k', |
| 351 | 'ჯ'=>'j', 'ჰ'=>'h', 'ţ'=>'t', 'ʼ'=>"'", '̧'=>'', 'ḩ'=>'h', |
| 352 | '‘'=>"'", '’'=>"'", 'ừ'=>'u', '/'=>'', 'ế'=>'e', 'ả'=>'a', |
| 353 | 'ị'=>'i', 'ậ'=>'a', 'ệ'=>'e', 'ỉ'=>'i', 'ồ'=>'o', 'ề'=>'e', |
| 354 | 'ơ'=>'o', 'ạ'=>'a', 'ẵ'=>'a', 'ư'=>'u', 'ằ'=>'a', 'ầ'=>'a', |
| 355 | 'ḑ'=>'d', 'Ḩ'=>'H', 'Ḑ'=>'D', 'ș'=>'s', 'ț'=>'t', 'ộ'=>'o', |
| 356 | 'ắ'=>'a', 'ş'=>'s', "'"=>'', 'ու'=>'u', 'ա'=>'a', 'բ'=>'b', |
| 357 | 'գ'=>'g', 'դ'=>'d', 'ե'=>'e', 'զ'=>'z', 'է'=>'e', 'ը'=>'y', |
| 358 | 'թ'=>'t', 'ժ'=>'zh', 'ի'=>'i', 'լ'=>'l', 'խ'=>'kh', 'ծ'=>'ts', |
| 359 | 'կ'=>'k', 'հ'=>'h', 'ձ'=>'dz', 'ղ'=>'gh', 'ճ'=>'ch', 'մ'=>'m', |
| 360 | 'յ'=>'y', 'ն'=>'n', 'շ'=>'sh', 'ո'=>'o', 'չ'=>'ch', 'պ'=>'p', |
| 361 | 'ջ'=>'j', 'ռ'=>'r', 'ս'=>'s', 'վ'=>'v', 'տ'=>'t', 'ր'=>'r', |
| 362 | 'ց'=>'ts', 'փ'=>'p', 'ք'=>'q', 'և'=>'ev', '� |
| 363 | '=>'o', 'ֆ'=>'f', |
| 364 | ); |
| 365 | $arrayFrom = array_keys($transliterationTable); |
| 366 | $arrayTo = array_values($transliterationTable); |
| 367 | } |
| 368 | |
| 369 | return str_replace($arrayFrom, $arrayTo, $string); |
| 370 | } |
| 371 | } |
| 372 |