Subversion Repositories ALCASAR

Rev

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