diff options
author | Thorsten Schöning <tschoening@am-soft.de> | 2017-08-31 09:40:53 +0200 |
---|---|---|
committer | Thorsten Schöning <tschoening@am-soft.de> | 2017-08-31 09:42:54 +0200 |
commit | 0e92cd0d0f8b0b53e04aec445ac09193fb802d5d (patch) | |
tree | 7e229e37a7c82dd2ab81bd9aa281a1a5dcf3f1a1 | |
parent | 7e2d7e7431b7ba6e8dd74cc76c55018d51206fa2 (diff) | |
download | phpvirtualbox-0e92cd0d0f8b0b53e04aec445ac09193fb802d5d.zip phpvirtualbox-0e92cd0d0f8b0b53e04aec445ac09193fb802d5d.tar.gz phpvirtualbox-0e92cd0d0f8b0b53e04aec445ac09193fb802d5d.tar.bz2 |
#53: Reducing multiple SOAP calls to one for now as it seems that the web UI is only using the first processor description anyway and because of the wrong loop approach it doesn't make sense to query the CPU ID 0 multiple times. The multiple entries in the array are only used to show the total number of CPUs. Both places need to be synced in the end anyway, it doesn't make sense to only assume one description in one place and multiple different in some other.
https://github.com/phpvirtualbox/phpvirtualbox/blob/develop/js/phpvirtualbox.js#L48
-rw-r--r-- | endpoints/lib/vboxconnector.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/endpoints/lib/vboxconnector.php b/endpoints/lib/vboxconnector.php index 68c3499..5b7b20b 100644 --- a/endpoints/lib/vboxconnector.php +++ b/endpoints/lib/vboxconnector.php @@ -3390,9 +3390,10 @@ class vboxconnector { /* * Processors */ - for($i = 0; $i < $host->processorCount; $i++) { - // TODO https://github.com/phpvirtualbox/phpvirtualbox/issues/53 - $response['cpus'][$i] = $host->getProcessorDescription(0); + // TODO https://github.com/phpvirtualbox/phpvirtualbox/issues/53
+ $response['cpus'][0] = $host->getProcessorDescription(0);
+ for($i = 1; $i < $host->processorCount; $i++) {
+ $response['cpus'][$i] = $response['cpus'][0];
} /* |