blueshoes php application framework and cms            core_util
[ class tree: core_util ] [ index: core_util ] [ all elements ]

Class: Bs_System

Source Location: /core/util/Bs_System.class.php

Class Overview

Bs_Object
   |
   --Bs_System

This static class provides system functions.


Author(s):

Version:

  • 4.3.$Revision: 1.2 $ $Date: 2003/10/29 17:48:43 $

Copyright:

  • blueshoes.org

Variables

Methods


Inherited Variables

Inherited Methods

Class: Bs_Object

Bs_Object::Bs_Object()
Bs_Object::getErrors()
Basic error handling: Get *all* errors as string array from the global Bs_Error-error stack.
Bs_Object::getLastError()
Basic error handling: Get last error string from the global Bs_Error-error stack.
Bs_Object::getLastErrors()
Basic error handling: Get last errors string array from the global Bs_Error-error stack sinc last call of getLastErrors().
Bs_Object::persist()
Persists this object by serializing it and saving it to a file with unique name.
Bs_Object::setError()
Basic error handling: Push an error string on the global Bs_Error-error stack.
Bs_Object::toHtml()
Dumps the content of this object to a string using PHP's var_dump().
Bs_Object::toString()
Dumps the content of this object to a string using PHP's var_dump().
Bs_Object::unpersist()
Fetches an object that was persisted with persist()

Class Details

[line 19]
This static class provides system functions.

dependencies: Bs_String




Tags:

version:  4.3.$Revision: 1.2 $ $Date: 2003/10/29 17:48:43 $
copyright:  blueshoes.org
author:  andrej arn <at blueshoes dot org>


[ Top ]


Class Variables

$_Bs_String =

[line 22]


Type:   mixed


[ Top ]

$_isWindows =

[line 30]


Type:   mixed


[ Top ]



Class Methods


constructor Bs_System [line 33]

Bs_System Bs_System( )



[ Top ]

method getCpuAvailable [line 240]

float getCpuAvailable( )

returns the available cpu, that is idle+nice together.

it is the 'available' of getCpuStat() so look there.




Tags:

see:  Bs_System::getCpuStat()
access:  public


[ Top ]

method getCpuInfo [line 250]

void getCpuInfo( )



Tags:

todo:  all


[ Top ]

method getCpuStat [line 129]

array getCpuStat( [int $maxWaitTime = 3000])

returns a hash with the following keys: 'user' => cpu usage for 'user' processes.

'system' => cpu usage for 'system' processes. 'nice' => cpu usage for low-priority processes. 'idle' => free cpu 'available' => idle + nice, because you can grab the nice cpu power for you aswell.

the total *should* be 100%, but because of the rounding (all values are rounded to a max of 2 digits after the dot) there might be a little difference. the values are of type float.

should work with multi-processor systems aswell.

note: the method may take a while to return, because it has to wait until the file with the cpu information (/proc/stat) has to be updated. see param $maxWaitTime.




Tags:

return:  (hash, see above)
throws:  bool FALSE if not capable (windows)


Parameters:

int   $maxWaitTime   (time in milliseconds, default is 3000.)

[ Top ]

method getLoadAvg [line 313]

array getLoadAvg( )

returns information about the load average.

the returned vector has at least 3 elements. on the machine i tested it there were 5, like this: ELEMENT VALUE DESCRIPTION

  1. 1.79 load average of the last minute
  2. 1.21 load average of the last 5 minutes
  3. 1.12 load average of the last 15 minutes
  4. 2/130 don't know
  5. 28638 don't know
imo a load average of >5 is high. everything <2 is fine.




Tags:

return:  (vector, see above)
throws:  bool FALSE if not capable (windows)


[ Top ]

method getMemory [line 278]

void getMemory( )



[ Top ]

method getOs [line 55]

string getOs( )

returns the os we're on.



Tags:

todo:  document the possible return values.


[ Top ]

method getOsVersion [line 63]

void getOsVersion( )



Tags:

todo:  all


[ Top ]

method getSerial [line 333]

string getSerial( )

returns the serial number of the system.

example: 4f00000756496301




Tags:

throws:  bool FALSE if not capable (windows)


[ Top ]

method getSystemName [line 73]

void getSystemName( )

tells the systems name.

i think this only works on windows.




Tags:

throws:  bool FALSE (if not known)
access:  public


[ Top ]

method getUptime [line 99]

void getUptime( )

is this possible on winblows at all?



Tags:

todo:  all


[ Top ]

method getVersion [line 347]

void getVersion( )



Tags:

todo:  all


[ Top ]

method isWindows [line 43]

bool isWindows( )

Tells if we're on a winblows box.



[ Top ]

method systemCheckup [line 91]

void systemCheckup( )

Do some system checks

  • check for full disks/devices
  • high load times?
  • low memory?




Tags:

todo:  all


[ Top ]


Documentation generated on Mon, 29 Dec 2003 21:13:03 +0100 by phpDocumentor 1.2.3