/** * sets a user-defined error handler function * * @param integer $level contains the level of the error raised, as an integer. * @param string $message contains the error message, as a string. * @param string $file which contains the filename that the error was raised in, as a string. * @param integer $line which contains the line number the error was raised at, as an integer. * * @return void */ function errorHandlerPsi($level, $message, $file, $line) { $error = PSI_Error::singleton(); if (PSI_DEBUG || $level !== 2 || !(preg_match("/^[^:]*: open_basedir /", $message) || preg_match("/^fopen\\(/", $message) || preg_match("/^is_readable\\(/", $message))) { // disable open_basedir, is_readable and fopen warnings $error->addPhpError("errorHandlerPsi : ", "Level : " . $level . " Message : " . $message . " File : " . $file . " Line : " . $line); } }
/** * doing some initial tasks * - generate the xml structure with the right header elements * - get the error object for error output * - get a instance of the sysinfo object * * @param boolean $complete generate xml with all plugins or not * @param string $pluginname name of the plugin * * @return void */ public function __construct($complete = false, $pluginname = "") { $this->_errors = PSI_Error::singleton(); if ($pluginname == "") { $this->_plugin_request = false; $this->_plugin = ''; } else { $this->_plugin_request = true; $this->_plugin = $pluginname; } if ($complete) { $this->_complete_request = true; } else { $this->_complete_request = false; } $os = PSI_OS; $this->_sysinfo = new $os(); $this->_plugins = CommonFunctions::getPlugins(); $this->_xmlbody(); }
/** * build the global Error object */ public function __construct() { $this->error = PSI_Error::singleton(); $this->upsinfo = new UPSInfo(); }
/** * function for getting a list of values in the specified context * optionally filter this list, based on the list from third parameter * * @param $wmi holds the COM object that we pull the WMI data from * @param string $strClass name of the class where the values are stored * @param array $strValue filter out only needed values, if not set all values of the class are returned * * @return array content of the class stored in an array */ public static function getWMI($wmi, $strClass, $strValue = array()) { $arrData = array(); if ($wmi) { $value = ""; try { $objWEBM = $wmi->Get($strClass); $arrProp = $objWEBM->Properties_; $arrWEBMCol = $objWEBM->Instances_(); foreach ($arrWEBMCol as $objItem) { if (is_array($arrProp)) { reset($arrProp); } $arrInstance = array(); foreach ($arrProp as $propItem) { $value = $objItem->{$propItem->Name}; //instead exploitable eval("\$value = \$objItem->".$propItem->Name.";"); if (empty($strValue)) { if (is_string($value)) { $arrInstance[$propItem->Name] = trim($value); } else { $arrInstance[$propItem->Name] = $value; } } else { if (in_array($propItem->Name, $strValue)) { if (is_string($value)) { $arrInstance[$propItem->Name] = trim($value); } else { $arrInstance[$propItem->Name] = $value; } } } } $arrData[] = $arrInstance; } } catch (Exception $e) { if (PSI_DEBUG) { $error = PSI_Error::singleton(); $error->addError($e->getCode(), $e->getMessage()); } } } return $arrData; }
/** * call the parent constructor and check for needed extensions */ public function __construct() { $this->error = PSI_Error::singleton(); $this->_checkConfig(); CommonFunctions::checkForExtensions(); }
/** * build the global Error object */ public function __construct() { $this->error = PSI_Error::singleton(); $this->sys = new System(); }
/** * sets a user-defined error handler function * * @param integer $level contains the level of the error raised, as an integer. * @param string $message contains the error message, as a string. * @param string $file which contains the filename that the error was raised in, as a string. * @param integer $line which contains the line number the error was raised at, as an integer. * * @return void */ function errorHandlerPsi($level, $message, $file, $line) { $error = PSI_Error::singleton(); $error->addPhpError("errorHandlerPsi : ", "Level : " . $level . " Message : " . $message . " File : " . $file . " Line : " . $line); }