Subversion Repositories vnag

Rev

Rev 87 | Rev 89 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 87 Rev 88
Line 9... Line 9...
9
        \ V / | | (_| || | | | | | | | | |   <  ___) | (_) |  _| |_
9
        \ V / | | (_| || | | | | | | | | |   <  ___) | (_) |  _| |_
10
         \_/  |_|\__,_||_| |_| |_|_|_| |_|_|\_\|____/ \___/|_|  \__|
10
         \_/  |_|\__,_||_| |_| |_|_|_| |_|_|\_\|____/ \___/|_|  \__|
11
 
11
 
12
      Developed by Daniel Marschall             www.viathinksoft.com
12
      Developed by Daniel Marschall             www.viathinksoft.com
13
      Licensed under the terms of the Apache 2.0 license
13
      Licensed under the terms of the Apache 2.0 license
14
      Revision 2023-10-13
14
      Revision 2023-11-05
15
 
15
 
16
*/
16
*/
17
 
17
 
18
/****************************************************************************************************
18
/****************************************************************************************************
19
 
19
 
Line 42... Line 42...
42
        // Returns true for '' or null. Does not return true for value 0 or '0' (like empty() does)
42
        // Returns true for '' or null. Does not return true for value 0 or '0' (like empty() does)
43
        return is_null($x) || (trim($x) == '');
43
        return is_null($x) || (trim($x) == '');
44
}
44
}
45
 
45
 
46
abstract class VNag {
46
abstract class VNag {
47
        /*public*/ const VNAG_VERSION = '2023-10-13';
47
        /*public*/ const VNAG_VERSION = '2023-11-05';
48
 
48
 
49
        // Status 0..3 for STATUSMODEL_SERVICE (the default status model):
49
        // Status 0..3 for STATUSMODEL_SERVICE (the default status model):
50
        # The guideline states: "Higher-level errors (such as name resolution errors, socket timeouts, etc) are outside of the control of plugins and should generally NOT be reported as UNKNOWN states."
50
        # The guideline states: "Higher-level errors (such as name resolution errors, socket timeouts, etc) are outside of the control of plugins and should generally NOT be reported as UNKNOWN states."
51
        # We choose 4 as exitcode. The plugin developer is free to return any other status.
51
        # We choose 4 as exitcode. The plugin developer is free to return any other status.
52
        /*public*/ const STATUS_OK       = 0;
52
        /*public*/ const STATUS_OK       = 0;
Line 780... Line 780...
780
                                                        throw new VNagSignatureException(VNagLang::$signature_invalid);
780
                                                        throw new VNagSignatureException(VNagLang::$signature_invalid);
781
                                                }
781
                                                }
782
                                        }
782
                                        }
783
 
783
 
784
                                        $payload = @json_decode($payload,true);
784
                                        $payload = @json_decode($payload,true);
785
                                        if (!$payload) {
785
                                        if ($payload === null) {
786
                                                throw new VNagWebInfoException(VNagLang::$payload_not_json);
786
                                                throw new VNagWebInfoException(VNagLang::$payload_not_json);
787
                                        }
787
                                        }
788
 
788
 
789
                                        if ($payload['id'] == $this->id) {
789
                                        if ($payload['id'] == $this->id) {
790
                                                return $payload;
790
                                                return $payload;