@@ -134,6 +134,91 @@ function tempnam_ISOLATION_WRAPPER() {
134
134
fb_rename_function (' tempnam' , ' ORIG_tempnam' );
135
135
fb_rename_function (' tempnam_ISOLATION_WRAPPER' , ' tempnam' );
136
136
137
+ function time_ISOLATION_WRAPPER () {
138
+ static $time ;
139
+ $org_time = ORIG_time ();
140
+ if ($time === null ) {
141
+ $time = $org_time ;
142
+ return $time ;
143
+ }
144
+ if ($time >= $org_time ) {
145
+ ++ $time ;
146
+ } else {
147
+ $time = $org_time ;
148
+ }
149
+ return $time ;
150
+ }
151
+ fb_rename_function (' time' , ' ORIG_time' );
152
+ fb_rename_function (' time_ISOLATION_WRAPPER' , ' time' );
153
+
154
+ function microtime_ISOLATION_WRAPPER (bool $get_as_float = false ) {
155
+ static $time ;
156
+ list ($msec , $sec ) = explode (" " , ORIG_microtime ());
157
+ if ($time === null ) {
158
+ $time = $sec ;
159
+ } else if ($time >= $sec ){
160
+ ++ $time ;
161
+ } else {
162
+ $time = $sec ;
163
+ }
164
+ if ($get_as_float )
165
+ return ((float )$msec + (float )$time );
166
+ else
167
+ return " {$msec} {$time} " ;
168
+ }
169
+ fb_rename_function (' microtime' , ' ORIG_microtime' );
170
+ fb_rename_function (' microtime_ISOLATION_WRAPPER' , ' microtime' );
171
+
172
+ function date_ISOLATION_WRAPPER (?string $format , ?int $timestamp = null ) {
173
+ $timestamp = ($timestamp === null ? time () : $timestamp );
174
+ return ORIG_date ($format , $timestamp );
175
+ }
176
+ fb_rename_function (' date' , ' ORIG_date' );
177
+ fb_rename_function (' date_ISOLATION_WRAPPER' , ' date' );
178
+
179
+ function gmdate_ISOLATION_WRAPPER (?string $format , ?int $timestamp = null ) {
180
+ $timestamp = ($timestamp === null ? time () : $timestamp );
181
+ return ORIG_gmdate ($format , $timestamp );
182
+ }
183
+ fb_rename_function (' gmdate' , ' ORIG_gmdate' );
184
+ fb_rename_function (' gmdate_ISOLATION_WRAPPER' , ' gmdate' );
185
+
186
+ function strftime_ISOLATION_WRAPPER (?string $format , ?int $timestamp = null ) {
187
+ $timestamp = ($timestamp === null ? time () : $timestamp );
188
+ return ORIG_strftime ($format , $timestamp );
189
+ }
190
+ fb_rename_function (' strftime' , ' ORIG_strftime' );
191
+ fb_rename_function (' strftime_ISOLATION_WRAPPER' , ' strftime' );
192
+
193
+ function strtotime_ISOLATION_WRAPPER (?string $time , ?int $now = null ) {
194
+ $now = ($now === null ? time () : $now );
195
+ return ORIG_strtotime ($time , $now );
196
+ }
197
+ fb_rename_function (' strtotime' , ' ORIG_strtotime' );
198
+ fb_rename_function (' strtotime_ISOLATION_WRAPPER' , ' strtotime' );
199
+
200
+ function idate_ISOLATION_WRAPPER (?string $format , ?int $timestamp = null ) {
201
+ $timestamp = ($timestamp === null ? time () : $timestamp );
202
+ return ORIG_idate ($format , $timestamp );
203
+ }
204
+ fb_rename_function (' idate' , ' ORIG_idate' );
205
+ fb_rename_function (' idate_ISOLATION_WRAPPER' , ' idate' );
206
+
207
+ function getdate_ISOLATION_WRAPPER (?int $timestamp = null ) {
208
+ $timestamp = ($timestamp === null ? time () : $timestamp );
209
+ return ORIG_getdate ($timestamp );
210
+ }
211
+ fb_rename_function (' getdate' , ' ORIG_getdate' );
212
+ fb_rename_function (' getdate_ISOLATION_WRAPPER' , ' getdate' );
213
+
214
+ function localtime_ISOLATION_WRAPPER (?int $timestamp = null , bool $is_associative = false ) {
215
+ $timestamp = ($timestamp === null ? time () : $timestamp );
216
+ return ORIG_localtime ($timestamp , $is_associative );
217
+ }
218
+ fb_rename_function (' localtime' , ' ORIG_localtime' );
219
+ fb_rename_function (' localtime_ISOLATION_WRAPPER' , ' localtime' );
220
+
221
+
137
222
// ////////////////////
138
223
// Files - Checking //
139
224
// ////////////////////
0 commit comments