Merge branch '1.0-local' into 1.0
This commit is contained in:
commit
74cedbd331
|
@ -36,8 +36,6 @@
|
|||
$state = preg_replace('@^\s+@', '', $state);
|
||||
$state = preg_replace('@\s+$@', '', $state);
|
||||
|
||||
var_dump($state);
|
||||
|
||||
/* (3) Check data */
|
||||
if( strlen($state) < 1 )
|
||||
return false;
|
||||
|
@ -115,6 +113,10 @@
|
|||
/* (5) Update global state */
|
||||
$state = get_gstate();
|
||||
|
||||
// manage error
|
||||
if( $state === false )
|
||||
return false;
|
||||
|
||||
|
||||
/* [2] Manage timeout
|
||||
=========================================================*/
|
||||
|
@ -298,18 +300,13 @@
|
|||
/* [3] Check global state
|
||||
=========================================================*/
|
||||
/* (1) Check file */
|
||||
$gstate = $f_gstate->current();
|
||||
$gstate = get_gstate();
|
||||
|
||||
if( !$gstate )
|
||||
/* (2) Manage error */
|
||||
if( $gstate === false )
|
||||
return 127;
|
||||
|
||||
/* (3) Remove surrounding spaces */
|
||||
$gstate = preg_replace('@^\s+@', '', $gstate);
|
||||
$gstate = preg_replace('@\s+$@', '', $gstate);
|
||||
|
||||
/* (4) Manage error */
|
||||
if( strlen($gstate) < 1 )
|
||||
return 127;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -329,6 +326,13 @@
|
|||
/* (2) Caches */
|
||||
global $actions;
|
||||
|
||||
/* (3) Get global state */
|
||||
$gstate = get_gstate();
|
||||
|
||||
// Manage error
|
||||
if( $gstate === false )
|
||||
return false;
|
||||
|
||||
|
||||
|
||||
/* [1] Wait for rfid card
|
||||
|
@ -394,10 +398,10 @@
|
|||
|
||||
// {2} If not updated -> error //
|
||||
if( !$updateds )
|
||||
slog("Cannot update chips to '".get_gstate()."'", 'mfrc522:loop');
|
||||
slog("Cannot update chips to '{$gstate}'", 'mfrc522:loop');
|
||||
// {3} If updated -> success //
|
||||
else
|
||||
slog("Chips updated to ".get_gstate()."'", 'mfrc522:loop');
|
||||
slog("Chips updated to '{$gstate}'", 'mfrc522:loop');
|
||||
|
||||
/* (3) If not performed -> log error */
|
||||
}else
|
||||
|
|
Loading…
Reference in New Issue