PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.13
Timetics – Appointment Booking Calendar & Scheduling v1.0.13
1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 All 62 releases
timetics / core / dummy-data / provider / internet.php

internet.php in Timetics – Appointment Booking Calendar & Scheduling 1.0.13, at core/dummy-data/provider/internet.php

75 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Internet Faker Class
4 *
5 * @package Timetics
6 */
7 namespace Timetics\Core\DummyData\Provider;
8
9 /**
10 * Internet Faker Class
11 */
12 class Internet {
13 /**
14 * Store Internet Free Domain
15 *
16 * @var array
17 */
18 protected static $domains = ['gmail.com', 'yahoo.com', 'hotmail.com'];
19
20 /**
21 * Store random character
22 *
23 * @var string
24 */
25 protected static $str = 'abcdefghijklmnopqrstuvwxyz12345_-.';
26
27 /**
28 * Get username
29 *
30 * @return string
31 */
32 public static function username() {
33 $strLength = strlen( self::$str );
34
35 // Generate a random start position within the valid range
36 $start_pos = mt_rand( 0, max( 0, $strLength - 5 ) );
37
38 // Extract the random substring using substr()
39 $random_substring = substr( self::$str, $start_pos, 5 );
40
41 return $random_substring . '_' . time();
42 }
43
44 /**
45 * Get generated email
46 *
47 * @return string
48 */
49 public static function email() {
50 $email = self::username() . '@' . self::domain();
51
52 return $email;
53 }
54
55 /**
56 * Get generated password
57 *
58 * @return string
59 */
60 public static function password() {
61 $password = uniqid() . '_' . time();
62
63 return $password;
64 }
65
66 /**
67 * Get domain name
68 *
69 * @return string
70 */
71 private static function domain() {
72 return self::$domains[array_rand( self::$domains )];
73 }
74 }
75