Subversion Repositories ALCASAR

Rev

Rev 3037 | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
2775 rexy 1
<?php
2
/**
3
 * System TO class
4
 *
5
 * PHP version 5
6
 *
7
 * @category  PHP
8
 * @package   PSI_TO
9
 * @author    Michael Cramer <BigMichi1@users.sourceforge.net>
10
 * @copyright 2009 phpSysInfo
11
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
12
 * @version   SVN: $Id: class.System.inc.php 255 2009-06-17 13:39:41Z bigmichi1 $
13
 * @link      http://phpsysinfo.sourceforge.net
14
 */
15
 /**
16
 * System TO class
17
 *
18
 * @category  PHP
19
 * @package   PSI_TO
20
 * @author    Michael Cramer <BigMichi1@users.sourceforge.net>
21
 * @copyright 2009 phpSysInfo
22
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
23
 * @version   Release: 3.0
24
 * @link      http://phpsysinfo.sourceforge.net
25
 */
26
class System
27
{
28
    /**
29
     * name of the host where phpSysInfo runs
30
     *
3037 rexy 31
     * @var string
2775 rexy 32
     */
33
    private $_hostname = "localhost";
34
 
35
    /**
36
     * ip of the host where phpSysInfo runs
37
     *
3037 rexy 38
     * @var string
2775 rexy 39
     */
40
    private $_ip = "127.0.0.1";
41
 
42
    /**
3037 rexy 43
     * detailed information about the kernel
2775 rexy 44
     *
3037 rexy 45
     * @var string
2775 rexy 46
     */
47
    private $_kernel = "Unknown";
48
 
49
    /**
50
     * name of the distribution
51
     *
3037 rexy 52
     * @var string
2775 rexy 53
     */
54
    private $_distribution = "Unknown";
55
 
56
    /**
57
     * icon of the distribution (must be available in phpSysInfo)
58
     *
3037 rexy 59
     * @var string
2775 rexy 60
     */
61
    private $_distributionIcon = "unknown.png";
62
 
63
    /**
64
     * detailed Information about the machine name
65
     *
3037 rexy 66
     * @var string
2775 rexy 67
     */
68
    private $_machine = "";
69
 
70
    /**
71
     * time in sec how long the system is running
72
     *
3037 rexy 73
     * @var int
2775 rexy 74
     */
75
    private $_uptime = 0;
76
 
77
    /**
78
     * count of users that are currently logged in
79
     *
3037 rexy 80
     * @var int
2775 rexy 81
     */
82
    private $_users = 0;
83
 
84
    /**
85
     * load of the system
86
     *
3037 rexy 87
     * @var string
2775 rexy 88
     */
89
    private $_load = "";
90
 
91
    /**
92
     * load of the system in percent (all cpus, if more than one)
93
     *
3037 rexy 94
     * @var int
2775 rexy 95
     */
96
    private $_loadPercent = null;
97
 
98
    /**
99
     * array with cpu devices
100
     *
101
     * @see CpuDevice
102
     *
103
     * @var array
104
     */
105
    private $_cpus = array();
106
 
107
    /**
108
     * array with network devices
109
     *
110
     * @see NetDevice
111
     *
112
     * @var array
113
     */
114
    private $_netDevices = array();
115
 
116
    /**
117
     * array with pci devices
118
     *
119
     * @see HWDevice
120
     *
121
     * @var array
122
     */
123
    private $_pciDevices = array();
124
 
125
    /**
126
     * array with ide devices
127
     *
128
     * @see HWDevice
129
     *
130
     * @var array
131
     */
132
    private $_ideDevices = array();
133
 
134
    /**
135
     * array with scsi devices
136
     *
137
     * @see HWDevice
138
     *
139
     * @var array
140
     */
141
    private $_scsiDevices = array();
142
 
143
    /**
144
     * array with usb devices
145
     *
146
     * @see HWDevice
147
     *
148
     * @var array
149
     */
150
    private $_usbDevices = array();
151
 
152
    /**
153
     * array with thunderbolt devices
154
     *
155
     * @see HWDevice
156
     *
157
     * @var array
158
     */
159
    private $_tbDevices = array();
160
 
161
    /**
162
     * array with I2C devices
163
     *
164
     * @see HWDevice
165
     *
166
     * @var array
167
     */
168
    private $_i2cDevices = array();
169
 
170
    /**
171
     * array with NVMe devices
172
     *
173
     * @see HWDevice
174
     *
175
     * @var array
176
     */
177
    private $_nvmeDevices = array();
178
 
179
    /**
2976 rexy 180
     * array with Mem devices
181
     *
182
     * @see HWDevice
183
     *
184
     * @var array
185
     */
186
    private $_memDevices = array();
187
 
188
    /**
2775 rexy 189
     * array with disk devices
190
     *
191
     * @see DiskDevice
192
     *
193
     * @var array
194
     */
195
    private $_diskDevices = array();
196
 
197
    /**
198
     * free memory in bytes
199
     *
3037 rexy 200
     * @var int
2775 rexy 201
     */
202
    private $_memFree = 0;
203
 
204
    /**
205
     * total memory in bytes
206
     *
3037 rexy 207
     * @var int
2775 rexy 208
     */
209
    private $_memTotal = 0;
210
 
211
    /**
212
     * used memory in bytes
213
     *
3037 rexy 214
     * @var int
2775 rexy 215
     */
216
    private $_memUsed = 0;
217
 
218
    /**
219
     * used memory by applications in bytes
220
     *
3037 rexy 221
     * @var int
2775 rexy 222
     */
223
    private $_memApplication = null;
224
 
225
    /**
226
     * used memory for buffers in bytes
227
     *
3037 rexy 228
     * @var int
2775 rexy 229
     */
230
    private $_memBuffer = null;
231
 
232
    /**
233
     * used memory for cache in bytes
234
     *
3037 rexy 235
     * @var int
2775 rexy 236
     */
237
    private $_memCache = null;
238
 
239
    /**
240
     * array with swap devices
241
     *
242
     * @see DiskDevice
243
     *
244
     * @var array
245
     */
246
    private $_swapDevices = array();
247
 
248
    /**
249
     * array of types of processes
250
     *
251
     * @var array
252
     */
253
    private $_processes = array();
254
 
255
    /**
3037 rexy 256
     *  array with Virtualizer information
257
     *
258
     * @var array
259
     */
260
    private $_virtualizer = array();
261
 
262
    /**
3100 rexy 263
     * operating system type
264
     *
265
     * @var string
266
     */
267
    private $_OS = "";
268
 
269
    /**
2775 rexy 270
     * remove duplicate Entries and Count
271
     *
272
     * @param array $arrDev list of HWDevices
273
     *
274
     * @see HWDevice
275
     *
276
     * @return array
277
     */
278
    public static function removeDupsAndCount($arrDev)
279
    {
280
        $result = array();
281
        foreach ($arrDev as $dev) {
282
            if (count($result) === 0) {
283
                array_push($result, $dev);
284
            } else {
285
                $found = false;
286
                foreach ($result as $tmp) {
287
                    if ($dev->equals($tmp)) {
288
                        $tmp->setCount($tmp->getCount() + 1);
289
                        $found = true;
290
                        break;
291
                    }
292
                }
293
                if (!$found) {
294
                    array_push($result, $dev);
295
                }
296
            }
297
        }
298
 
299
        return $result;
300
    }
301
 
302
    /**
303
     * return percent of used memory
304
     *
305
     * @see System::_memUsed
306
     * @see System::_memTotal
307
     *
3037 rexy 308
     * @return int
2775 rexy 309
     */
310
    public function getMemPercentUsed()
311
    {
312
        if ($this->_memTotal > 0) {
313
            return round($this->_memUsed / $this->_memTotal * 100);
314
        } else {
315
            return 0;
316
        }
317
    }
318
 
319
    /**
320
     * return percent of used memory for applications
321
     *
322
     * @see System::_memApplication
323
     * @see System::_memTotal
324
     *
3037 rexy 325
     * @return int
2775 rexy 326
     */
327
    public function getMemPercentApplication()
328
    {
329
        if ($this->_memApplication !== null) {
330
            if (($this->_memApplication > 0) && ($this->_memTotal > 0)) {
331
                return round($this->_memApplication / $this->_memTotal * 100);
332
            } else {
333
                return 0;
334
            }
335
        } else {
336
            return null;
337
        }
338
    }
339
 
340
    /**
341
     * return percent of used memory for cache
342
     *
343
     * @see System::_memCache
344
     * @see System::_memTotal
345
     *
3037 rexy 346
     * @return int
2775 rexy 347
     */
348
    public function getMemPercentCache()
349
    {
350
        if ($this->_memCache !== null) {
351
            if (($this->_memCache > 0) && ($this->_memTotal > 0)) {
352
                if (($this->_memApplication !== null) && ($this->_memApplication > 0)) {
353
                    return round(($this->_memCache + $this->_memApplication) / $this->_memTotal * 100) - $this->getMemPercentApplication();
354
                } else {
355
                    return round($this->_memCache / $this->_memTotal * 100);
356
                }
357
            } else {
358
                return 0;
359
            }
360
        } else {
361
            return null;
362
        }
363
    }
364
 
365
    /**
366
     * return percent of used memory for buffer
367
     *
368
     * @see System::_memBuffer
369
     * @see System::_memTotal
370
     *
3037 rexy 371
     * @return int
2775 rexy 372
     */
373
    public function getMemPercentBuffer()
374
    {
375
        if ($this->_memBuffer !== null) {
376
            if (($this->_memBuffer > 0) && ($this->_memTotal > 0)) {
377
                if (($this->_memCache !== null) && ($this->_memCache > 0)) {
378
                    if (($this->_memApplication !== null) && ($this->_memApplication > 0)) {
379
                        return round(($this->_memBuffer + $this->_memApplication + $this->_memCache) / $this->_memTotal * 100) - $this->getMemPercentApplication() - $this->getMemPercentCache();
380
                    } else {
381
                        return round(($this->_memBuffer + $this->_memCache) / $this->_memTotal * 100) - $this->getMemPercentCache();
382
                    }
383
                } elseif (($this->_memApplication !== null) && ($this->_memApplication > 0)) {
384
                    return round(($this->_memBuffer + $this->_memApplication) / $this->_memTotal * 100) - $this->getMemPercentApplication();
385
                } else {
386
                    return round($this->_memBuffer / $this->_memTotal * 100);
387
                }
388
            } else {
389
                return 0;
390
            }
391
        } else {
392
            return null;
393
        }
394
    }
395
 
396
    /**
397
     * Returns total free swap space
398
     *
399
     * @see System::_swapDevices
400
     * @see DiskDevice::getFree()
401
     *
3037 rexy 402
     * @return int
2775 rexy 403
     */
404
    public function getSwapFree()
405
    {
406
        if (count($this->_swapDevices) > 0) {
407
            $free = 0;
408
            foreach ($this->_swapDevices as $dev) {
409
                $free += $dev->getFree();
410
            }
411
 
412
            return $free;
413
        }
414
 
415
        return null;
416
    }
417
 
418
    /**
419
     * Returns total swap space
420
     *
421
     * @see System::_swapDevices
422
     * @see DiskDevice::getTotal()
423
     *
3037 rexy 424
     * @return int
2775 rexy 425
     */
426
    public function getSwapTotal()
427
    {
428
        if (count($this->_swapDevices) > 0) {
429
            $total = 0;
430
            foreach ($this->_swapDevices as $dev) {
431
                $total += $dev->getTotal();
432
            }
433
 
434
            return $total;
435
        } else {
436
            return null;
437
        }
438
    }
439
 
440
    /**
441
     * Returns total used swap space
442
     *
443
     * @see System::_swapDevices
444
     * @see DiskDevice::getUsed()
445
     *
3037 rexy 446
     * @return int
2775 rexy 447
     */
448
    public function getSwapUsed()
449
    {
450
        if (count($this->_swapDevices) > 0) {
451
            $used = 0;
452
            foreach ($this->_swapDevices as $dev) {
453
                $used += $dev->getUsed();
454
            }
455
 
456
            return $used;
457
        } else {
458
            return null;
459
        }
460
    }
461
 
462
    /**
463
     * return percent of total swap space used
464
     *
465
     * @see System::getSwapUsed()
466
     * @see System::getSwapTotal()
467
     *
3037 rexy 468
     * @return int
2775 rexy 469
     */
470
    public function getSwapPercentUsed()
471
    {
472
        if ($this->getSwapTotal() !== null) {
473
            if ($this->getSwapTotal() > 0) {
474
                return round($this->getSwapUsed() / $this->getSwapTotal() * 100);
475
            } else {
476
                return 0;
477
            }
478
        } else {
479
            return null;
480
        }
481
    }
482
 
483
    /**
484
     * Returns $_distribution.
485
     *
486
     * @see System::$_distribution
487
     *
488
     * @return String
489
     */
490
    public function getDistribution()
491
    {
492
        return $this->_distribution;
493
    }
494
 
495
    /**
496
     * Sets $_distribution.
497
     *
498
     * @param String $distribution distributionname
499
     *
500
     * @see System::$_distribution
501
     *
3037 rexy 502
     * @return void
2775 rexy 503
     */
504
    public function setDistribution($distribution)
505
    {
506
        $this->_distribution = $distribution;
507
    }
508
 
509
    /**
510
     * Returns $_distributionIcon.
511
     *
512
     * @see System::$_distributionIcon
513
     *
514
     * @return String
515
     */
516
    public function getDistributionIcon()
517
    {
518
        return $this->_distributionIcon;
519
    }
520
 
521
    /**
522
     * Sets $_distributionIcon.
523
     *
524
     * @param String $distributionIcon distribution icon
525
     *
526
     * @see System::$_distributionIcon
527
     *
3037 rexy 528
     * @return void
2775 rexy 529
     */
530
    public function setDistributionIcon($distributionIcon)
531
    {
532
        $this->_distributionIcon = $distributionIcon;
533
    }
534
 
535
    /**
536
     * Returns $_hostname.
537
     *
538
     * @see System::$_hostname
539
     *
540
     * @return String
541
     */
542
    public function getHostname()
543
    {
544
        return $this->_hostname;
545
    }
546
 
547
    /**
548
     * Sets $_hostname.
549
     *
550
     * @param String $hostname hostname
551
     *
552
     * @see System::$_hostname
553
     *
3037 rexy 554
     * @return void
2775 rexy 555
     */
556
    public function setHostname($hostname)
557
    {
558
        $this->_hostname = $hostname;
559
    }
560
 
561
    /**
562
     * Returns $_ip.
563
     *
564
     * @see System::$_ip
565
     *
566
     * @return String
567
     */
568
    public function getIp()
569
    {
570
        return $this->_ip;
571
    }
572
 
573
    /**
574
     * Sets $_ip.
575
     *
576
     * @param String $ip IP
577
     *
578
     * @see System::$_ip
579
     *
3037 rexy 580
     * @return void
2775 rexy 581
     */
582
    public function setIp($ip)
583
    {
584
        $this->_ip = $ip;
585
    }
586
 
587
    /**
588
     * Returns $_kernel.
589
     *
590
     * @see System::$_kernel
591
     *
592
     * @return String
593
     */
594
    public function getKernel()
595
    {
596
        return $this->_kernel;
597
    }
598
 
599
    /**
600
     * Sets $_kernel.
601
     *
602
     * @param String $kernel kernelname
603
     *
604
     * @see System::$_kernel
605
     *
3037 rexy 606
     * @return void
2775 rexy 607
     */
608
    public function setKernel($kernel)
609
    {
610
        $this->_kernel = $kernel;
611
    }
612
 
613
    /**
614
     * Returns $_load.
615
     *
616
     * @see System::$_load
617
     *
618
     * @return String
619
     */
620
    public function getLoad()
621
    {
622
        return $this->_load;
623
    }
624
 
625
    /**
626
     * Sets $_load.
627
     *
628
     * @param String $load current system load
629
     *
630
     * @see System::$_load
631
     *
3037 rexy 632
     * @return void
2775 rexy 633
     */
634
    public function setLoad($load)
635
    {
636
        $this->_load = $load;
637
    }
638
 
639
    /**
640
     * Returns $_loadPercent.
641
     *
642
     * @see System::$_loadPercent
643
     *
3037 rexy 644
     * @return int
2775 rexy 645
     */
646
    public function getLoadPercent()
647
    {
648
        return $this->_loadPercent;
649
    }
650
 
651
    /**
652
     * Sets $_loadPercent.
653
     *
3037 rexy 654
     * @param int $loadPercent load percent
2775 rexy 655
     *
656
     * @see System::$_loadPercent
657
     *
3037 rexy 658
     * @return void
2775 rexy 659
     */
660
    public function setLoadPercent($loadPercent)
661
    {
662
        $this->_loadPercent = $loadPercent;
663
    }
664
 
665
    /**
666
     * Returns $_machine.
667
     *
668
     * @see System::$_machine
669
     *
670
     * @return String
671
     */
672
    public function getMachine()
673
    {
674
        return $this->_machine;
675
    }
676
 
677
    /**
678
     * Sets $_machine.
679
     *
680
     * @param string $machine machine
681
     *
682
     * @see System::$_machine
683
     *
3037 rexy 684
     * @return void
2775 rexy 685
     */
686
    public function setMachine($machine)
687
    {
688
        $this->_machine = $machine;
689
    }
690
 
691
    /**
692
     * Returns $_uptime.
693
     *
694
     * @see System::$_uptime
695
     *
3037 rexy 696
     * @return int
2775 rexy 697
     */
698
    public function getUptime()
699
    {
700
        return $this->_uptime;
701
    }
702
 
703
    /**
704
     * Sets $_uptime.
705
     *
706
     * @param integer $uptime uptime
707
     *
708
     * @see System::$_uptime
709
     *
3037 rexy 710
     * @return void
2775 rexy 711
     */
712
    public function setUptime($uptime)
713
    {
714
        $this->_uptime = $uptime;
715
    }
716
 
717
    /**
718
     * Returns $_users.
719
     *
720
     * @see System::$_users
721
     *
3037 rexy 722
     * @return int
2775 rexy 723
     */
724
    public function getUsers()
725
    {
726
        return $this->_users;
727
    }
728
 
729
    /**
730
     * Sets $_users.
731
     *
3037 rexy 732
     * @param int $users user count
2775 rexy 733
     *
734
     * @see System::$_users
735
     *
3037 rexy 736
     * @return void
2775 rexy 737
     */
738
    public function setUsers($users)
739
    {
740
        $this->_users = $users;
741
    }
742
 
743
    /**
744
     * Returns $_cpus.
745
     *
746
     * @see System::$_cpus
747
     *
748
     * @return array
749
     */
750
    public function getCpus()
751
    {
752
        return $this->_cpus;
753
    }
754
 
755
    /**
756
     * Sets $_cpus.
757
     *
758
     * @param CpuDevice $cpus cpu device
759
     *
760
     * @see System::$_cpus
761
     * @see CpuDevice
762
     *
3037 rexy 763
     * @return void
2775 rexy 764
     */
765
    public function setCpus($cpus)
766
    {
767
        array_push($this->_cpus, $cpus);
768
    }
769
 
770
    /**
771
     * Returns $_netDevices.
772
     *
773
     * @see System::$_netDevices
774
     *
775
     * @return array
776
     */
777
    public function getNetDevices()
778
    {
779
        if (defined('PSI_SORT_NETWORK_INTERFACES_LIST') && PSI_SORT_NETWORK_INTERFACES_LIST) {
780
            usort($this->_netDevices, array('CommonFunctions', 'name_natural_compare'));
781
        }
782
 
783
        return $this->_netDevices;
784
    }
785
 
786
    /**
787
     * Sets $_netDevices.
788
     *
789
     * @param NetDevice $netDevices network device
790
     *
791
     * @see System::$_netDevices
792
     * @see NetDevice
793
     *
3037 rexy 794
     * @return void
2775 rexy 795
     */
796
    public function setNetDevices($netDevices)
797
    {
798
        array_push($this->_netDevices, $netDevices);
799
    }
800
 
801
    /**
802
     * Returns $_pciDevices.
803
     *
804
     * @see System::$_pciDevices
805
     *
806
     * @return array
807
     */
808
    public function getPciDevices()
809
    {
810
        return $this->_pciDevices;
811
    }
812
 
813
    /**
814
     * Sets $_pciDevices.
815
     *
816
     * @param HWDevice $pciDevices pci device
817
     *
818
     * @see System::$_pciDevices
819
     * @see HWDevice
820
     *
3037 rexy 821
     * @return void
2775 rexy 822
     */
823
    public function setPciDevices($pciDevices)
824
    {
825
        array_push($this->_pciDevices, $pciDevices);
826
    }
827
 
828
    /**
829
     * Returns $_ideDevices.
830
     *
831
     * @see System::$_ideDevices
832
     *
833
     * @return array
834
     */
835
    public function getIdeDevices()
836
    {
837
        return $this->_ideDevices;
838
    }
839
 
840
    /**
841
     * Sets $_ideDevices.
842
     *
843
     * @param HWDevice $ideDevices ide device
844
     *
845
     * @see System::$_ideDevices
846
     * @see HWDevice
847
     *
3037 rexy 848
     * @return void
2775 rexy 849
     */
850
    public function setIdeDevices($ideDevices)
851
    {
852
        array_push($this->_ideDevices, $ideDevices);
853
    }
854
 
855
    /**
856
     * Returns $_scsiDevices.
857
     *
858
     * @see System::$_scsiDevices
859
     *
860
     * @return array
861
     */
862
    public function getScsiDevices()
863
    {
864
        return $this->_scsiDevices;
865
    }
866
 
867
    /**
868
     * Sets $_scsiDevices.
869
     *
870
     * @param HWDevice $scsiDevices scsi devices
871
     *
872
     * @see System::$_scsiDevices
873
     * @see HWDevice
874
     *
3037 rexy 875
     * @return void
2775 rexy 876
     */
877
    public function setScsiDevices($scsiDevices)
878
    {
879
        array_push($this->_scsiDevices, $scsiDevices);
880
    }
881
 
882
    /**
883
     * Returns $_usbDevices.
884
     *
885
     * @see System::$_usbDevices
886
     *
887
     * @return array
888
     */
889
    public function getUsbDevices()
890
    {
891
        return $this->_usbDevices;
892
    }
893
 
894
    /**
895
     * Sets $_usbDevices.
896
     *
897
     * @param HWDevice $usbDevices usb device
898
     *
899
     * @see System::$_usbDevices
900
     * @see HWDevice
901
     *
3037 rexy 902
     * @return void
2775 rexy 903
     */
904
    public function setUsbDevices($usbDevices)
905
    {
906
        array_push($this->_usbDevices, $usbDevices);
907
    }
908
 
909
    /**
910
     * Returns $_tbDevices.
911
     *
912
     * @see System::$_tbDevices
913
     *
914
     * @return array
915
     */
916
    public function getTbDevices()
917
    {
918
        return $this->_tbDevices;
919
    }
920
 
921
    /**
922
     * Sets $_tbDevices.
923
     *
924
     * @param HWDevice $tbDevices thunderbolt device
925
     *
926
     * @see System::$_tbDevices
927
     * @see HWDevice
928
     *
3037 rexy 929
     * @return void
2775 rexy 930
     */
931
    public function setTbDevices($tbDevices)
932
    {
933
        array_push($this->_tbDevices, $tbDevices);
934
    }
935
 
936
    /**
937
     * Returns $_i2cDevices.
938
     *
939
     * @see System::$_i2cDevices
940
     *
941
     * @return array
942
     */
943
    public function getI2cDevices()
944
    {
945
        return $this->_i2cDevices;
946
    }
947
 
948
    /**
949
     * Sets $_i2cDevices.
950
     *
951
     * @param HWDevice $i2cDevices I2C device
952
     *
953
     * @see System::$_i2cDevices
954
     * @see HWDevice
955
     *
3037 rexy 956
     * @return void
2775 rexy 957
     */
958
    public function setI2cDevices($i2cDevices)
959
    {
960
        array_push($this->_i2cDevices, $i2cDevices);
961
    }
962
 
963
    /**
964
     * Returns $_nvmeDevices.
965
     *
966
     * @see System::$_nvmeDevices
967
     *
968
     * @return array
969
     */
970
    public function getNvmeDevices()
971
    {
972
        return $this->_nvmeDevices;
973
    }
974
 
975
    /**
976
     * Sets $_nvmeDevices.
977
     *
978
     * @param HWDevice $nvmeDevices NVMe device
979
     *
980
     * @see System::$_nvmeDevices
981
     * @see HWDevice
982
     *
3037 rexy 983
     * @return void
2775 rexy 984
     */
985
    public function setNvmeDevices($nvmeDevices)
986
    {
987
        array_push($this->_nvmeDevices, $nvmeDevices);
988
    }
989
 
990
    /**
2976 rexy 991
     * Returns $_memDevices.
992
     *
993
     * @see System::$_memDevices
994
     *
995
     * @return array
996
     */
997
    public function getMemDevices()
998
    {
999
        return $this->_memDevices;
1000
    }
1001
 
1002
    /**
1003
     * Sets $_memDevices.
1004
     *
1005
     * @param HWDevice $memDevices mem device
1006
     *
1007
     * @see System::$_memDevices
1008
     * @see HWDevice
1009
     *
3037 rexy 1010
     * @return void
2976 rexy 1011
     */
1012
    public function setMemDevices($memDevices)
1013
    {
1014
        array_push($this->_memDevices, $memDevices);
1015
    }
1016
 
1017
    /**
2775 rexy 1018
     * Returns $_diskDevices.
1019
     *
1020
     * @see System::$_diskDevices
1021
     *
1022
     * @return array
1023
     */
1024
    public function getDiskDevices()
1025
    {
1026
        return $this->_diskDevices;
1027
    }
1028
 
1029
    /**
1030
     * Sets $_diskDevices.
1031
     *
1032
     * @param DiskDevice $diskDevices disk device
1033
     *
1034
     * @see System::$_diskDevices
1035
     * @see DiskDevice
1036
     *
1037
     * @return void
1038
     */
1039
    public function setDiskDevices($diskDevices)
1040
    {
1041
        array_push($this->_diskDevices, $diskDevices);
1042
    }
1043
 
1044
    /**
1045
     * Returns $_memApplication.
1046
     *
1047
     * @see System::$_memApplication
1048
     *
3037 rexy 1049
     * @return int
2775 rexy 1050
     */
1051
    public function getMemApplication()
1052
    {
1053
        return $this->_memApplication;
1054
    }
1055
 
1056
    /**
1057
     * Sets $_memApplication.
1058
     *
3037 rexy 1059
     * @param int $memApplication application memory
2775 rexy 1060
     *
1061
     * @see System::$_memApplication
1062
     *
3037 rexy 1063
     * @return void
2775 rexy 1064
     */
1065
    public function setMemApplication($memApplication)
1066
    {
1067
        $this->_memApplication = $memApplication;
1068
    }
1069
 
1070
    /**
1071
     * Returns $_memBuffer.
1072
     *
1073
     * @see System::$_memBuffer
1074
     *
3037 rexy 1075
     * @return int
2775 rexy 1076
     */
1077
    public function getMemBuffer()
1078
    {
1079
        return $this->_memBuffer;
1080
    }
1081
 
1082
    /**
1083
     * Sets $_memBuffer.
1084
     *
3037 rexy 1085
     * @param int $memBuffer buffer memory
2775 rexy 1086
     *
1087
     * @see System::$_memBuffer
1088
     *
3037 rexy 1089
     * @return void
2775 rexy 1090
     */
1091
    public function setMemBuffer($memBuffer)
1092
    {
1093
        $this->_memBuffer = $memBuffer;
1094
    }
1095
 
1096
    /**
1097
     * Returns $_memCache.
1098
     *
1099
     * @see System::$_memCache
1100
     *
3037 rexy 1101
     * @return int
2775 rexy 1102
     */
1103
    public function getMemCache()
1104
    {
1105
        return $this->_memCache;
1106
    }
1107
 
1108
    /**
1109
     * Sets $_memCache.
1110
     *
3037 rexy 1111
     * @param int $memCache cache memory
2775 rexy 1112
     *
1113
     * @see System::$_memCache
1114
     *
3037 rexy 1115
     * @return void
2775 rexy 1116
     */
1117
    public function setMemCache($memCache)
1118
    {
1119
        $this->_memCache = $memCache;
1120
    }
1121
 
1122
    /**
1123
     * Returns $_memFree.
1124
     *
1125
     * @see System::$_memFree
1126
     *
3037 rexy 1127
     * @return int
2775 rexy 1128
     */
1129
    public function getMemFree()
1130
    {
1131
        return $this->_memFree;
1132
    }
1133
 
1134
    /**
1135
     * Sets $_memFree.
1136
     *
3037 rexy 1137
     * @param int $memFree free memory
2775 rexy 1138
     *
1139
     * @see System::$_memFree
1140
     *
3037 rexy 1141
     * @return void
2775 rexy 1142
     */
1143
    public function setMemFree($memFree)
1144
    {
1145
        $this->_memFree = $memFree;
1146
    }
1147
 
1148
    /**
1149
     * Returns $_memTotal.
1150
     *
1151
     * @see System::$_memTotal
1152
     *
3037 rexy 1153
     * @return int
2775 rexy 1154
     */
1155
    public function getMemTotal()
1156
    {
1157
        return $this->_memTotal;
1158
    }
1159
 
1160
    /**
1161
     * Sets $_memTotal.
1162
     *
3037 rexy 1163
     * @param int $memTotal total memory
2775 rexy 1164
     *
1165
     * @see System::$_memTotal
1166
     *
3037 rexy 1167
     * @return void
2775 rexy 1168
     */
1169
    public function setMemTotal($memTotal)
1170
    {
1171
        $this->_memTotal = $memTotal;
1172
    }
1173
 
1174
    /**
1175
     * Returns $_memUsed.
1176
     *
1177
     * @see System::$_memUsed
1178
     *
3037 rexy 1179
     * @return int
2775 rexy 1180
     */
1181
    public function getMemUsed()
1182
    {
1183
        return $this->_memUsed;
1184
    }
1185
 
1186
    /**
1187
     * Sets $_memUsed.
1188
     *
3037 rexy 1189
     * @param int $memUsed used memory
2775 rexy 1190
     *
1191
     * @see System::$_memUsed
1192
     *
3037 rexy 1193
     * @return void
2775 rexy 1194
     */
1195
    public function setMemUsed($memUsed)
1196
    {
1197
        $this->_memUsed = $memUsed;
1198
    }
1199
 
1200
    /**
1201
     * Returns $_swapDevices.
1202
     *
1203
     * @see System::$_swapDevices
1204
     *
1205
     * @return array
1206
     */
1207
    public function getSwapDevices()
1208
    {
1209
        return $this->_swapDevices;
1210
    }
1211
 
1212
    /**
1213
     * Sets $_swapDevices.
1214
     *
1215
     * @param DiskDevice $swapDevices swap devices
1216
     *
1217
     * @see System::$_swapDevices
1218
     * @see DiskDevice
1219
     *
3037 rexy 1220
     * @return void
2775 rexy 1221
     */
1222
    public function setSwapDevices($swapDevices)
1223
    {
1224
        array_push($this->_swapDevices, $swapDevices);
1225
    }
1226
 
1227
    /**
1228
     * Returns $_processes.
1229
     *
1230
     * @see System::$_processes
1231
     *
1232
     * @return array
1233
     */
1234
    public function getProcesses()
1235
    {
1236
        return $this->_processes;
1237
    }
1238
 
1239
    /**
1240
     * Sets $_proceses.
1241
     *
1242
     * @param $processes array of types of processes
1243
     *
1244
     * @see System::$_processes
1245
     *
3037 rexy 1246
     * @return void
2775 rexy 1247
     */
1248
    public function setProcesses($processes)
1249
    {
1250
        $this->_processes = $processes;
1251
/*
1252
        foreach ($processes as $proc_type=>$proc_count) {
1253
            $this->_processes[$proc_type] = $proc_count;
1254
        }
1255
*/
1256
    }
3037 rexy 1257
 
1258
    /**
1259
     * Returns $_virtualizer.
1260
     *
1261
     * @see System::$_virtualizer
1262
     *
1263
     * @return array
1264
     */
1265
    public function getVirtualizer()
1266
    {
1267
        return $this->_virtualizer;
1268
    }
1269
 
1270
    /**
1271
     * Sets $_virtualizer.
1272
     *
1273
     * @param String      $virtualizer virtualizername
1274
     * @param Bool|String $value       true, false or virtualizername to replace
1275
     *
1276
     * @see System::$_virtualizer
1277
     *
1278
     * @return void
1279
     */
1280
    public function setVirtualizer($virtualizer, $value = true)
1281
    {
1282
        if (!isset($this->_virtualizer[$virtualizer])) {
1283
            if (is_bool($value)) {
1284
                $this->_virtualizer[$virtualizer] = $value;
1285
            } else { // replace the virtualizer with another
1286
                $this->_virtualizer[$virtualizer] = true;
1287
                $this->_virtualizer[$value] = false;
1288
            }
1289
        }
1290
    }
3100 rexy 1291
 
1292
    /**
1293
     * Returns $_OS.
1294
     *
1295
     * @see System::$_OS
1296
     *
1297
     * @return string
1298
     */
1299
    public function getOS()
1300
    {
1301
        return $this->_OS;
1302
    }
1303
 
1304
    /**
1305
     * Sets $_OS.
1306
     *
1307
     * @param $os operating system type
1308
     *
1309
     * @see System::$_OS
1310
     *
1311
     * @return void
1312
     */
1313
    public function setOS($OS)
1314
    {
1315
        $this->_OS = $OS;
1316
    }
2775 rexy 1317
}