@@ -250,38 +250,35 @@ public function __destruct()
250250 $ this ->WorkingData ->close ();
251251 return ;
252252 }
253- if ($ this ->Using === 'PDO ' ) {
254- $ this ->clearExpiredPDO ();
253+ if (!\is_array ($ this ->WorkingData )) {
255254 return ;
256255 }
257- if (\is_array ($ this ->WorkingData )) {
258- if ($ this ->clearExpired ($ this ->WorkingData )) {
259- $ this ->Modified = true ;
260- }
261- if ($ this ->FFDefault && $ this ->Modified && $ this ->Using === 'FF ' ) {
262- $ Handle = false ;
263- $ Start = \time ();
264- while (true ) {
265- $ Handle = \fopen ($ this ->FFDefault , 'wb ' );
266- if ($ Handle !== false || (\time () - $ Start ) > self ::FLOCK_TIMEOUT ) {
267- break ;
268- }
269- }
270- if ($ Handle === false ) {
271- return ;
272- }
273- $ Locked = false ;
274- while (true ) {
275- if ($ Locked = \flock ($ Handle , \LOCK_EX | \LOCK_NB ) || (\time () - $ Start ) > self ::FLOCK_TIMEOUT ) {
276- break ;
277- }
256+ if ($ this ->clearExpired ($ this ->WorkingData )) {
257+ $ this ->Modified = true ;
258+ }
259+ if ($ this ->FFDefault && $ this ->Modified && $ this ->Using === 'FF ' ) {
260+ $ Handle = false ;
261+ $ Start = \time ();
262+ while (true ) {
263+ $ Handle = \fopen ($ this ->FFDefault , 'wb ' );
264+ if ($ Handle !== false || (\time () - $ Start ) > self ::FLOCK_TIMEOUT ) {
265+ break ;
278266 }
279- if ($ Locked ) {
280- \fwrite ($ Handle , \serialize ($ this ->WorkingData ));
281- \flock ($ Handle , LOCK_UN );
267+ }
268+ if ($ Handle === false ) {
269+ return ;
270+ }
271+ $ Locked = false ;
272+ while (true ) {
273+ if ($ Locked = \flock ($ Handle , \LOCK_EX | \LOCK_NB ) || (\time () - $ Start ) > self ::FLOCK_TIMEOUT ) {
274+ break ;
282275 }
283- \fclose ($ Handle );
284276 }
277+ if ($ Locked ) {
278+ \fwrite ($ Handle , \serialize ($ this ->WorkingData ));
279+ \flock ($ Handle , \LOCK_UN );
280+ }
281+ \fclose ($ Handle );
285282 }
286283 }
287284
0 commit comments