1 | <?php |
||
19 | class AdminPageFramework_Utility extends AdminPageFramework_Utility_HTMLAttribute { |
||
20 | |||
21 | /** |
||
22 | * @param array $aRequest |
||
23 | * @param boolean $bStripSlashes Whether to fix magic quotes. |
||
24 | * @return array |
||
25 | * @since 3.8.24 |
||
26 | */ |
||
27 | static public function getHTTPRequestSanitized( array $aRequest, $bStripSlashes ) { |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | * @since 3.8.24 |
||
43 | */ |
||
44 | static private $___aObjectCache = array(); |
||
45 | /** |
||
46 | * @param string|array $asName If array, it represents a multi-dimensional keys. |
||
47 | * @param mixed $mValue |
||
48 | * @since 3.8.24 |
||
49 | */ |
||
50 | static public function setObjectCache( $asName, $mValue ) { |
||
53 | |||
54 | /** |
||
55 | * @param array|string $asName |
||
56 | * @since 3.8.24 |
||
57 | */ |
||
58 | static public function unsetObjectCache( $asName ) { |
||
61 | |||
62 | /** |
||
63 | * Caches values in the class property. |
||
64 | * |
||
65 | * @remark The stored data will be gone after the page load. |
||
66 | * @param array|string $asName The key of the object cache array. If an array is given, it represents the multi-dimensional keys. |
||
67 | * @param mixed $mDefault |
||
68 | * @return mixed |
||
69 | * @since 3.8.24 |
||
70 | */ |
||
71 | static public function getObjectCache( $asName, $mDefault=null ) { |
||
74 | |||
75 | /** |
||
76 | * Shows a message for a deprecated item. |
||
77 | * |
||
78 | * Uses the `E_USER_NOTICE` error level so that the message won't be shown if `WP_DEBUG` is `false`. |
||
79 | * |
||
80 | * @remark This method is overridden by the `AdminPageFramework_FrameworkUtility` class. |
||
81 | * @param string $sDeprecated |
||
82 | * @param string $sAlternative |
||
83 | * @param string $sProgramName |
||
84 | * @since 3.8.8 |
||
85 | */ |
||
86 | static public function showDeprecationNotice( $sDeprecated, $sAlternative='', $sProgramName='Admin Page Framework' ) { |
||
98 | |||
99 | /** |
||
100 | * Calls back a user defined function. |
||
101 | * |
||
102 | * This is meant to be used to filter a value using a callback. When a callback is not available, the first parameter element will be returned. |
||
103 | * so set a default return value to the first element of the parameter array. |
||
104 | * |
||
105 | * @since 3.7.0 |
||
106 | * @since 3.8.5 Moved from `AdminPageFramework_Form_Base`. Added the default value to the `$asParameters`second parameter. |
||
107 | * @param callable $oCallable |
||
108 | * @param string|array $asParameters Parameters to pass to the callback function. |
||
109 | * @return mixed |
||
110 | */ |
||
111 | public function callBack( $oCallable, $asParameters=array() ) { |
||
121 | |||
122 | /** |
||
123 | * Checks if the given id (usually a function name) has been called throughout the page load. |
||
124 | * |
||
125 | * This is used to check if a function which needs to be done only once has been already called or not. |
||
126 | * |
||
127 | * @since 3.7.0 |
||
128 | * @param string $sKey The string identifier of the call. |
||
129 | * @return boolean |
||
130 | */ |
||
131 | static public function hasBeenCalled( $sKey ) { |
||
138 | /** |
||
139 | * Stores calls. |
||
140 | * @internal |
||
141 | */ |
||
142 | static private $___aCallStack = array(); |
||
143 | |||
144 | /** |
||
145 | * Captures the output buffer of the given function. |
||
146 | * @since 3.6.3 |
||
147 | * @param callable $cCallable |
||
148 | * @param array $aParameters |
||
149 | * @return string The captured output buffer. |
||
150 | */ |
||
151 | static public function getOutputBuffer( $cCallable, array $aParameters=array() ) { |
||
160 | |||
161 | /** |
||
162 | * Generates brief object information. |
||
163 | * |
||
164 | * @remark Meant to be used for the `__toString()` method. |
||
165 | * @since 3.6.0 |
||
166 | * @param object $oInstance |
||
167 | * @return string |
||
168 | */ |
||
169 | static public function getObjectInfo( $oInstance ) { |
||
176 | |||
177 | |||
178 | /** |
||
179 | * Returns one or the other. |
||
180 | * |
||
181 | * Saves one conditional statement. |
||
182 | * |
||
183 | * @remark Use this only when the performance is not critical. |
||
184 | * @since 3.5.3 |
||
185 | * @param boolean|integer|double|string|array|object|resource|NULL $mValue The value to evaluate. |
||
186 | * @param boolean|integer|double|string|array|object|resource|NULL $mTrue The value to return when the first parameter value yields true. |
||
187 | * @param boolean|integer|double|string|array|object|resource|NULL $mFalse The value to return when the first parameter value yields false. |
||
188 | * @return mixed |
||
189 | */ |
||
190 | static public function getAOrB( $mValue, $mTrue=null, $mFalse=null ) { |
||
193 | |||
194 | } |
||
195 |