From 9b580638bae90524084f4b08d93b8e42f82daac5 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 26 Sep 2017 16:20:52 +0200 Subject: [PATCH] Removed default history truncating --- lib/api/source/deploy.php | 41 +-------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/lib/api/source/deploy.php b/lib/api/source/deploy.php index 57e640d..c54f0ee 100755 --- a/lib/api/source/deploy.php +++ b/lib/api/source/deploy.php @@ -151,46 +151,7 @@ - /* [6] Remove history entries - =========================================================*/ - /* (0) We are done if @sync */ - if( $sync ){ - slog('Post-sync deployment -> no history truncate', 'api:deploy', 'update'); - return 0; - } - - /* (1) Check history entries count */ - if( !isset($arr_r['saved']) || !is_array($arr_r['saved']) ){ - slog('No \'saved\' found in api.response file', 'api:deploy', 'update'); - return 127; - } - - /* (2) Check history count */ - if( !isset($arr_r['saved']['history']) || !is_numeric($arr_r['saved']['history']) ){ - slog('No \'actions\'.\'history\' found in api.response file', 'api:deploy', 'update'); - return 127; - } - - /* (3) Fetch number of entries */ - $saved = intval($arr_r['saved']['history']); - $saved = $saved < 0 ? 0 : $saved; // prevent negative - - /* (4) Truncate the log file */ - $truncated = syscall(SOURCE_DIR."/lib/file/truncate mfrc522 {$saved}"); - - /* (5) Manage error */ - if( $truncated === false ){ - slog('History cannot be truncated', 'api:deploy', 'update'); - return 127; - } - - - slog('History succesfully truncated', 'api:deploy', 'update'); - return 0; - - - - /* [7] Remove features' entries + /* [6] Remove features' entries =========================================================*/ /* (0) We are done if @sync */ if( $sync ){