PluginProbe
WP Crontrol / trunk
WP Crontrol vtrunk
1.21.2 trunk 0.1 0.2 0.3 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.1 1.10.0 1.11.0 1.12.0 1.12.1 1.13.0 1.13.1 1.13.2 1.14.0 1.15.0 1.15.1 1.15.2 1.15.3 1.16.0 1.16.1 1.16.2 All 57 releases
wp-crontrol / src / request.php

request.php in WP Crontrol trunk, at src/request.php

123 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Request handler.
4 */
5
6 namespace Crontrol;
7
8 /**
9 * Class Request
10 */
11 class Request {
12 /**
13 * Description.
14 *
15 * @var string
16 */
17 public $args = '';
18
19 /**
20 * Description.
21 *
22 * @var string
23 */
24 public $next_run_date_local = '';
25
26 /**
27 * Description.
28 *
29 * @var string
30 */
31 public $next_run_date_local_custom_date = '';
32
33 /**
34 * Description.
35 *
36 * @var string
37 */
38 public $next_run_date_local_custom_time = '';
39
40 /**
41 * Description.
42 *
43 * @var string
44 */
45 public $schedule = '';
46
47 /**
48 * Description.
49 *
50 * @var string
51 */
52 public $hookname = '';
53
54 /**
55 * Description.
56 *
57 * @var string
58 */
59 public $hookcode = '';
60
61 /**
62 * Description.
63 *
64 * @var string
65 */
66 public $eventname = '';
67
68 /**
69 * Description.
70 *
71 * @var string
72 */
73 public $url = '';
74
75 /**
76 * Description.
77 *
78 * @var string
79 */
80 public $method = '';
81
82 /**
83 * Description.
84 *
85 * @var string
86 */
87 public $original_hookname = '';
88
89 /**
90 * Description.
91 *
92 * @var string
93 */
94 public $original_sig = '';
95
96 /**
97 * Description.
98 *
99 * @var string
100 */
101 public $original_next_run_utc = '';
102
103 /**
104 * Initializes a Request object from properties.
105 *
106 * @param array<string,mixed> $props Properties.
107 * @return Request A new Request object.
108 */
109 public static function init( array $props ): Request {
110 $request = new self();
111
112 foreach ( $props as $name => $value ) {
113 $prop = (string) preg_replace( '#^crontrol_#', '', $name );
114
115 if ( property_exists( $request, $prop ) ) {
116 $request->$prop = $value;
117 }
118 }
119
120 return $request;
121 }
122 }
123