Merge branch '1.0-local' into 1.0

This commit is contained in:
xdrm-brackets 2017-02-23 16:44:32 +01:00
commit d4a38cb5e9
1 changed files with 4 additions and 2 deletions

View File

@ -111,6 +111,7 @@
global $f_accesslog; global $f_accesslog;
/* (5) Update global state */ /* (5) Update global state */
global $f_gstate;
$state = get_gstate(); $state = get_gstate();
// manage error // manage error
@ -210,7 +211,8 @@
/* (2) Update the state file */ /* (2) Update the state file */
$written = @file_put_contents(STATE_CONF, $state); $f_gstate->seek(0);
$written = $f_gstate->fwrite($state);
/* (3) Manage error */ /* (3) Manage error */
if( $written === false ) if( $written === false )
@ -261,7 +263,7 @@
/* (1) Read accesses */ /* (1) Read accesses */
$f_auth = new SplFileObject(AUTH_CONF, 'r'); $f_auth = new SplFileObject(AUTH_CONF, 'r');
$f_actions = new SplFileObject(ACTIONS_CONF, 'r'); $f_actions = new SplFileObject(ACTIONS_CONF, 'r');
$f_gstate = new SplFileObject(STATE_CONF, 'r'); $f_gstate = new SplFileObject(STATE_CONF, 'w');
/* (2) Append accesses (logs) */ /* (2) Append accesses (logs) */
$f_accesslog = new SplFileObject(DEFAULT_DATA, 'a'); $f_accesslog = new SplFileObject(DEFAULT_DATA, 'a');