Subversion Repositories vnag

Rev

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

Rev 80 Rev 87
Line 3... Line 3...
3
/*
3
/*
4
 * VNag - Nagios Framework for PHP
4
 * VNag - Nagios Framework for PHP
5
 * Developed by Daniel Marschall, ViaThinkSoft <www.viathinksoft.com>
5
 * Developed by Daniel Marschall, ViaThinkSoft <www.viathinksoft.com>
6
 * Licensed under the terms of the Apache 2.0 license
6
 * Licensed under the terms of the Apache 2.0 license
7
 *
7
 *
8
 * Revision 2023-10-13
8
 * Revision 2023-10-29
9
 */
9
 */
10
 
10
 
11
// TODO: Should we also warn if a newer major version is released?
11
// TODO: Should we also warn if a newer major version is released?
12
 
12
 
13
declare(ticks=1);
13
declare(ticks=1);
Line 111... Line 111...
111
                $check_errors = 0;
111
                $check_errors = 0;
112
 
112
 
113
                $ext_json_files = glob($system_dir.'/ext/*/*/composer.json');
113
                $ext_json_files = glob($system_dir.'/ext/*/*/composer.json');
114
                foreach ($ext_json_files as $ext_json_file) {
114
                foreach ($ext_json_files as $ext_json_file) {
115
                        $cont = @file_get_contents($ext_json_file);
115
                        $cont = @file_get_contents($ext_json_file);
116
                        if ($cont === false) continue; // TODO: throw exception?
116
                        if ($cont === false) throw new VNagException("Cannot read file $ext_json_file");
117
                        $ext_json_client = @json_decode($cont,true);
117
                        $ext_json_client = @json_decode($cont,true);
118
                        if ($ext_json_client === false) continue; // TODO: throw exception?
118
                        if ($ext_json_client === false) throw new VNagException("Cannot read JSON data from $ext_json_file");
119
                        $extname = $ext_json_client['name'];
119
                        $extname = $ext_json_client['name'];
120
                        $version = $ext_json_client['version'];
120
                        $version = $ext_json_client['version'];
121
                        $total_extensions++;
121
                        $total_extensions++;
122
                        if (isset($ext_json_client['extra']) && isset($ext_json_client['extra']['version-check'])) {
122
                        if (isset($ext_json_client['extra']) && isset($ext_json_client['extra']['version-check'])) {
123
                                if (!isset($ext_json_client['extra']['version-check']['ssl'])) $ext_json_client['extra']['version-check']['ssl'] = false;
123
                                if (!isset($ext_json_client['extra']['version-check']['ssl'])) $ext_json_client['extra']['version-check']['ssl'] = false;