From 8dd9523b40e77cd5a0db352dcf08e1fbda97c872 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Fri, 3 Jun 2022 09:20:51 +0200 Subject: [PATCH] refactor events meta pandora_enterprise#9086 --- pandora_console/composer.json | 5 +- pandora_console/include/functions_events.php | 6 +++ .../vendor/composer/InstalledVersions.php | 14 +++--- .../vendor/composer/autoload_files.php | 1 + .../vendor/composer/autoload_static.php | 1 + pandora_console/vendor/composer/installed.php | 50 +++++++++---------- 6 files changed, 44 insertions(+), 33 deletions(-) diff --git a/pandora_console/composer.json b/pandora_console/composer.json index 4ac4c7f027..bd4ab0d5fa 100644 --- a/pandora_console/composer.json +++ b/pandora_console/composer.json @@ -24,7 +24,10 @@ "PandoraFMS\\": "include/lib", "PandoraFMS\\Enterprise\\": "enterprise/include/lib", "UpdateManager\\": "update_manager_client/lib/UpdateManager" - } + }, + "files": [ + "include/global_config.php" + ] }, "autoload-dev": { "psr-4": { diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 75c0e37bb6..555ef394bf 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1510,6 +1510,9 @@ function events_get_all( $metaconsole_connections = array_flip($metaconsole_connections); $metaconsole_connections['meta'] = 0; + hd($metaconsole_connections, true); + hd($sql, true); + $result_meta = Promise\wait( parallelMap( $metaconsole_connections, @@ -1520,6 +1523,7 @@ function events_get_all( } $res = db_get_all_rows_sql($sql); + hd($res, true); if ($res === false) { $res = []; } @@ -1537,6 +1541,8 @@ function events_get_all( } } + hd($result_meta, true); + $data = []; if (empty($result_meta) === false) { foreach ($result_meta as $key => $value) { diff --git a/pandora_console/vendor/composer/InstalledVersions.php b/pandora_console/vendor/composer/InstalledVersions.php index 833dc6ff88..d85e22a1c6 100644 --- a/pandora_console/vendor/composer/InstalledVersions.php +++ b/pandora_console/vendor/composer/InstalledVersions.php @@ -28,7 +28,7 @@ class InstalledVersions { /** * @var mixed[]|null - * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null */ private static $installed; @@ -39,7 +39,7 @@ class InstalledVersions /** * @var array[] - * @psalm-var array}> + * @psalm-var array}> */ private static $installedByVendor = array(); @@ -243,7 +243,7 @@ class InstalledVersions /** * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { @@ -257,7 +257,7 @@ class InstalledVersions * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} */ public static function getRawData() { @@ -280,7 +280,7 @@ class InstalledVersions * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ public static function getAllRawData() { @@ -303,7 +303,7 @@ class InstalledVersions * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data */ public static function reload($data) { @@ -313,7 +313,7 @@ class InstalledVersions /** * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ private static function getInstalled() { diff --git a/pandora_console/vendor/composer/autoload_files.php b/pandora_console/vendor/composer/autoload_files.php index 31c588141b..cb0902a5df 100644 --- a/pandora_console/vendor/composer/autoload_files.php +++ b/pandora_console/vendor/composer/autoload_files.php @@ -25,4 +25,5 @@ return array( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', '861372841bb4b8ba9fdd215894666f40' => $vendorDir . '/amphp/parallel-functions/src/functions.php', '2c102faa651ef8ea5874edb585946bce' => $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php', + '11a9819e563d3900ef57275fe1df7d91' => $baseDir . '/include/global_config.php', ); diff --git a/pandora_console/vendor/composer/autoload_static.php b/pandora_console/vendor/composer/autoload_static.php index 759943ee4c..8084c51ea6 100644 --- a/pandora_console/vendor/composer/autoload_static.php +++ b/pandora_console/vendor/composer/autoload_static.php @@ -26,6 +26,7 @@ class ComposerStaticInit94a17e624d873685991e8ae888e00eb9 '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '861372841bb4b8ba9fdd215894666f40' => __DIR__ . '/..' . '/amphp/parallel-functions/src/functions.php', '2c102faa651ef8ea5874edb585946bce' => __DIR__ . '/..' . '/swiftmailer/swiftmailer/lib/swift_required.php', + '11a9819e563d3900ef57275fe1df7d91' => __DIR__ . '/../..' . '/include/global_config.php', ); public static $prefixLengthsPsr4 = array ( diff --git a/pandora_console/vendor/composer/installed.php b/pandora_console/vendor/composer/installed.php index cd16c4151a..58fc791dc3 100644 --- a/pandora_console/vendor/composer/installed.php +++ b/pandora_console/vendor/composer/installed.php @@ -1,220 +1,220 @@ array( + 'name' => 'pandorafms/console', 'pretty_version' => '1.0.0+no-version-set', 'version' => '1.0.0.0', + 'reference' => NULL, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => NULL, - 'name' => 'pandorafms/console', 'dev' => true, ), 'versions' => array( 'amphp/amp' => array( 'pretty_version' => 'v2.6.2', 'version' => '2.6.2.0', + 'reference' => '9d5100cebffa729aaffecd3ad25dc5aeea4f13bb', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/amp', 'aliases' => array(), - 'reference' => '9d5100cebffa729aaffecd3ad25dc5aeea4f13bb', 'dev_requirement' => false, ), 'amphp/byte-stream' => array( 'pretty_version' => 'v1.8.1', 'version' => '1.8.1.0', + 'reference' => 'acbd8002b3536485c997c4e019206b3f10ca15bd', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/byte-stream', 'aliases' => array(), - 'reference' => 'acbd8002b3536485c997c4e019206b3f10ca15bd', 'dev_requirement' => false, ), 'amphp/parallel' => array( 'pretty_version' => 'v1.4.1', 'version' => '1.4.1.0', + 'reference' => 'fbc128383c1ffb3823866f71b88d8c4722a25ce9', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/parallel', 'aliases' => array(), - 'reference' => 'fbc128383c1ffb3823866f71b88d8c4722a25ce9', 'dev_requirement' => false, ), 'amphp/parallel-functions' => array( 'pretty_version' => 'v1.0.0', 'version' => '1.0.0.0', + 'reference' => 'af9795d51abfafc3676cbe7e17965479491abaad', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/parallel-functions', 'aliases' => array(), - 'reference' => 'af9795d51abfafc3676cbe7e17965479491abaad', 'dev_requirement' => false, ), 'amphp/parser' => array( 'pretty_version' => 'v1.0.0', 'version' => '1.0.0.0', + 'reference' => 'f83e68f03d5b8e8e0365b8792985a7f341c57ae1', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/parser', 'aliases' => array(), - 'reference' => 'f83e68f03d5b8e8e0365b8792985a7f341c57ae1', 'dev_requirement' => false, ), 'amphp/process' => array( 'pretty_version' => 'v1.1.3', 'version' => '1.1.3.0', + 'reference' => 'f09e3ed3b0a953ccbfff1140f12be4a884f0aa83', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/process', 'aliases' => array(), - 'reference' => 'f09e3ed3b0a953ccbfff1140f12be4a884f0aa83', 'dev_requirement' => false, ), 'amphp/serialization' => array( 'pretty_version' => 'v1.0.0', 'version' => '1.0.0.0', + 'reference' => '693e77b2fb0b266c3c7d622317f881de44ae94a1', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/serialization', 'aliases' => array(), - 'reference' => '693e77b2fb0b266c3c7d622317f881de44ae94a1', 'dev_requirement' => false, ), 'amphp/sync' => array( 'pretty_version' => 'v1.4.2', 'version' => '1.4.2.0', + 'reference' => '85ab06764f4f36d63b1356b466df6111cf4b89cf', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/sync', 'aliases' => array(), - 'reference' => '85ab06764f4f36d63b1356b466df6111cf4b89cf', 'dev_requirement' => false, ), 'doctrine/lexer' => array( 'pretty_version' => '1.2.2', 'version' => '1.2.2.0', + 'reference' => '9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/lexer', 'aliases' => array(), - 'reference' => '9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c', 'dev_requirement' => false, ), 'egulias/email-validator' => array( 'pretty_version' => '3.1.2', 'version' => '3.1.2.0', + 'reference' => 'ee0db30118f661fb166bcffbf5d82032df484697', 'type' => 'library', 'install_path' => __DIR__ . '/../egulias/email-validator', 'aliases' => array(), - 'reference' => 'ee0db30118f661fb166bcffbf5d82032df484697', 'dev_requirement' => false, ), 'mpdf/mpdf' => array( 'pretty_version' => 'v8.0.15', 'version' => '8.0.15.0', + 'reference' => 'd8a5294a6cc2e814c4157aecc8d7ac25014b18ed', 'type' => 'library', 'install_path' => __DIR__ . '/../mpdf/mpdf', 'aliases' => array(), - 'reference' => 'd8a5294a6cc2e814c4157aecc8d7ac25014b18ed', 'dev_requirement' => false, ), 'myclabs/deep-copy' => array( 'pretty_version' => '1.10.2', 'version' => '1.10.2.0', + 'reference' => '776f831124e9c62e1a2c601ecc52e776d8bb7220', 'type' => 'library', 'install_path' => __DIR__ . '/../myclabs/deep-copy', 'aliases' => array(), - 'reference' => '776f831124e9c62e1a2c601ecc52e776d8bb7220', 'dev_requirement' => false, ), 'opis/closure' => array( 'pretty_version' => '3.6.3', 'version' => '3.6.3.0', + 'reference' => '3d81e4309d2a927abbe66df935f4bb60082805ad', 'type' => 'library', 'install_path' => __DIR__ . '/../opis/closure', 'aliases' => array(), - 'reference' => '3d81e4309d2a927abbe66df935f4bb60082805ad', 'dev_requirement' => false, ), 'pandorafms/console' => array( 'pretty_version' => '1.0.0+no-version-set', 'version' => '1.0.0.0', + 'reference' => NULL, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => NULL, 'dev_requirement' => false, ), 'paragonie/random_compat' => array( 'pretty_version' => 'v9.99.100', 'version' => '9.99.100.0', + 'reference' => '996434e5492cb4c3edcb9168db6fbb1359ef965a', 'type' => 'library', 'install_path' => __DIR__ . '/../paragonie/random_compat', 'aliases' => array(), - 'reference' => '996434e5492cb4c3edcb9168db6fbb1359ef965a', 'dev_requirement' => false, ), 'psr/log' => array( 'pretty_version' => '1.1.4', 'version' => '1.1.4.0', + 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), - 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', 'dev_requirement' => false, ), 'setasign/fpdi' => array( 'pretty_version' => 'v2.3.6', 'version' => '2.3.6.0', + 'reference' => '6231e315f73e4f62d72b73f3d6d78ff0eed93c31', 'type' => 'library', 'install_path' => __DIR__ . '/../setasign/fpdi', 'aliases' => array(), - 'reference' => '6231e315f73e4f62d72b73f3d6d78ff0eed93c31', 'dev_requirement' => false, ), 'swiftmailer/swiftmailer' => array( 'pretty_version' => 'v6.3.0', 'version' => '6.3.0.0', + 'reference' => '8a5d5072dca8f48460fce2f4131fcc495eec654c', 'type' => 'library', 'install_path' => __DIR__ . '/../swiftmailer/swiftmailer', 'aliases' => array(), - 'reference' => '8a5d5072dca8f48460fce2f4131fcc495eec654c', 'dev_requirement' => false, ), 'symfony/polyfill-iconv' => array( 'pretty_version' => 'v1.24.0', 'version' => '1.24.0.0', + 'reference' => 'f1aed619e28cb077fc83fac8c4c0383578356e40', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-iconv', 'aliases' => array(), - 'reference' => 'f1aed619e28cb077fc83fac8c4c0383578356e40', 'dev_requirement' => false, ), 'symfony/polyfill-intl-idn' => array( 'pretty_version' => 'v1.24.0', 'version' => '1.24.0.0', + 'reference' => '749045c69efb97c70d25d7463abba812e91f3a44', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn', 'aliases' => array(), - 'reference' => '749045c69efb97c70d25d7463abba812e91f3a44', 'dev_requirement' => false, ), 'symfony/polyfill-intl-normalizer' => array( 'pretty_version' => 'v1.24.0', 'version' => '1.24.0.0', + 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), - 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8', 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( 'pretty_version' => 'v1.24.0', 'version' => '1.24.0.0', + 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), - 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825', 'dev_requirement' => false, ), 'symfony/polyfill-php72' => array( 'pretty_version' => 'v1.24.0', 'version' => '1.24.0.0', + 'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php72', 'aliases' => array(), - 'reference' => '9a142215a36a3888e30d0a9eeea9766764e96976', 'dev_requirement' => false, ), ),