repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
phpsysinfo/phpsysinfo | includes/mb/class.ipmitool.inc.php | IPMItool._current | private function _current()
{
foreach ($this->_buf as $sensor) {
if (((isset($sensor['Sensor Type (Threshold)']) && ($sensor['Sensor Type (Threshold)'] == 'Current'))
||(isset($sensor['Sensor Type (Analog)']) && ($sensor['Sensor Type (Analog)'] == 'Current')))
&& i... | php | private function _current()
{
foreach ($this->_buf as $sensor) {
if (((isset($sensor['Sensor Type (Threshold)']) && ($sensor['Sensor Type (Threshold)'] == 'Current'))
||(isset($sensor['Sensor Type (Analog)']) && ($sensor['Sensor Type (Analog)'] == 'Current')))
&& i... | [
"private",
"function",
"_current",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_buf",
"as",
"$",
"sensor",
")",
"{",
"if",
"(",
"(",
"(",
"isset",
"(",
"$",
"sensor",
"[",
"'Sensor Type (Threshold)'",
"]",
")",
"&&",
"(",
"$",
"sensor",
"[",
... | get current information
@return void | [
"get",
"current",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.ipmitool.inc.php#L255-L277 |
phpsysinfo/phpsysinfo | includes/mb/class.ipmitool.inc.php | IPMItool._other | private function _other()
{
foreach ($this->_buf as $sensor) {
if (isset($sensor['Sensor Type (Discrete)'])) {
$dev = new SensorDevice();
if ($sensor['Sensor Type (Discrete)']!=='') {
$dev->setName($sensor['Sensor'].' ('.$sensor['Sensor Type (D... | php | private function _other()
{
foreach ($this->_buf as $sensor) {
if (isset($sensor['Sensor Type (Discrete)'])) {
$dev = new SensorDevice();
if ($sensor['Sensor Type (Discrete)']!=='') {
$dev->setName($sensor['Sensor'].' ('.$sensor['Sensor Type (D... | [
"private",
"function",
"_other",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_buf",
"as",
"$",
"sensor",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"sensor",
"[",
"'Sensor Type (Discrete)'",
"]",
")",
")",
"{",
"$",
"dev",
"=",
"new",
"SensorDevi... | get other information
@return void | [
"get",
"other",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.ipmitool.inc.php#L284-L302 |
phpsysinfo/phpsysinfo | includes/to/device/class.HWDevice.inc.php | HWDevice.equals | public function equals(HWDevice $dev)
{
if ($dev->getName() === $this->_name
&& $dev->getCapacity() === $this->_capacity
&& $dev->getManufacturer() === $this->_manufacturer
&& $dev->getProduct() === $this->_product
&& $dev->getSerial() === $this->_serial) {
... | php | public function equals(HWDevice $dev)
{
if ($dev->getName() === $this->_name
&& $dev->getCapacity() === $this->_capacity
&& $dev->getManufacturer() === $this->_manufacturer
&& $dev->getProduct() === $this->_product
&& $dev->getSerial() === $this->_serial) {
... | [
"public",
"function",
"equals",
"(",
"HWDevice",
"$",
"dev",
")",
"{",
"if",
"(",
"$",
"dev",
"->",
"getName",
"(",
")",
"===",
"$",
"this",
"->",
"_name",
"&&",
"$",
"dev",
"->",
"getCapacity",
"(",
")",
"===",
"$",
"this",
"->",
"_capacity",
"&&"... | compare a given device with the internal one
@param HWDevice $dev device that should be compared
@return boolean | [
"compare",
"a",
"given",
"device",
"with",
"the",
"internal",
"one"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/to/device/class.HWDevice.inc.php#L77-L88 |
phpsysinfo/phpsysinfo | includes/ups/class.nut.inc.php | Nut._info | private function _info()
{
if (! empty($this->_output)) {
foreach ($this->_output as $name => $value) {
$temp = preg_split("/\n/", $value, -1, PREG_SPLIT_NO_EMPTY);
$ups_data = array();
foreach ($temp as $valueTemp) {
$line = pr... | php | private function _info()
{
if (! empty($this->_output)) {
foreach ($this->_output as $name => $value) {
$temp = preg_split("/\n/", $value, -1, PREG_SPLIT_NO_EMPTY);
$ups_data = array();
foreach ($temp as $valueTemp) {
$line = pr... | [
"private",
"function",
"_info",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"_output",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_output",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"temp",
"=",
"preg_split... | parse the input and store data in resultset for xml generation
@return void | [
"parse",
"the",
"input",
"and",
"store",
"data",
"in",
"resultset",
"for",
"xml",
"generation"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/ups/class.nut.inc.php#L76-L129 |
phpsysinfo/phpsysinfo | includes/plugin/class.PSI_Plugin.inc.php | PSI_Plugin._getconfig | private function _getconfig()
{
if ((!defined('PSI_PLUGIN_'.strtoupper($this->_plugin_name).'_ACCESS')) &&
(!defined('PSI_PLUGIN_'.strtoupper($this->_plugin_name).'_FILE')) &&
(!defined('PSI_PLUGIN_'.strtoupper($this->_plugin_name).'_SHOW_SERIAL'))) {
$this->global_... | php | private function _getconfig()
{
if ((!defined('PSI_PLUGIN_'.strtoupper($this->_plugin_name).'_ACCESS')) &&
(!defined('PSI_PLUGIN_'.strtoupper($this->_plugin_name).'_FILE')) &&
(!defined('PSI_PLUGIN_'.strtoupper($this->_plugin_name).'_SHOW_SERIAL'))) {
$this->global_... | [
"private",
"function",
"_getconfig",
"(",
")",
"{",
"if",
"(",
"(",
"!",
"defined",
"(",
"'PSI_PLUGIN_'",
".",
"strtoupper",
"(",
"$",
"this",
"->",
"_plugin_name",
")",
".",
"'_ACCESS'",
")",
")",
"&&",
"(",
"!",
"defined",
"(",
"'PSI_PLUGIN_'",
".",
... | read the plugin configuration file, if we have one in the plugin directory
@return void | [
"read",
"the",
"plugin",
"configuration",
"file",
"if",
"we",
"have",
"one",
"in",
"the",
"plugin",
"directory"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/plugin/class.PSI_Plugin.inc.php#L87-L94 |
phpsysinfo/phpsysinfo | includes/plugin/class.PSI_Plugin.inc.php | PSI_Plugin._checkfiles | private function _checkfiles()
{
if (!file_exists($this->_plugin_base."js/".strtolower($this->_plugin_name).".js")) {
$this->global_error->addError("file_exists(".$this->_plugin_base."js/".strtolower($this->_plugin_name).".js)", "JS-File for Plugin '".$this->_plugin_name."' is missing!");
... | php | private function _checkfiles()
{
if (!file_exists($this->_plugin_base."js/".strtolower($this->_plugin_name).".js")) {
$this->global_error->addError("file_exists(".$this->_plugin_base."js/".strtolower($this->_plugin_name).".js)", "JS-File for Plugin '".$this->_plugin_name."' is missing!");
... | [
"private",
"function",
"_checkfiles",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"_plugin_base",
".",
"\"js/\"",
".",
"strtolower",
"(",
"$",
"this",
"->",
"_plugin_name",
")",
".",
"\".js\"",
")",
")",
"{",
"$",
"this",
"->"... | check if there is a default translation file availabe and also the required js file for
appending the content of the plugin to the main webpage
@return void | [
"check",
"if",
"there",
"is",
"a",
"default",
"translation",
"file",
"availabe",
"and",
"also",
"the",
"required",
"js",
"file",
"for",
"appending",
"the",
"content",
"of",
"the",
"plugin",
"to",
"the",
"main",
"webpage"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/plugin/class.PSI_Plugin.inc.php#L102-L118 |
phpsysinfo/phpsysinfo | includes/plugin/class.PSI_Plugin.inc.php | PSI_Plugin._createXml | private function _createXml($enc)
{
$dom = new DOMDocument('1.0', 'UTF-8');
$root = $dom->createElement("Plugin_".$this->_plugin_name);
$dom->appendChild($root);
$this->xml = new SimpleXMLExtended(simplexml_import_dom($dom), $enc);
} | php | private function _createXml($enc)
{
$dom = new DOMDocument('1.0', 'UTF-8');
$root = $dom->createElement("Plugin_".$this->_plugin_name);
$dom->appendChild($root);
$this->xml = new SimpleXMLExtended(simplexml_import_dom($dom), $enc);
} | [
"private",
"function",
"_createXml",
"(",
"$",
"enc",
")",
"{",
"$",
"dom",
"=",
"new",
"DOMDocument",
"(",
"'1.0'",
",",
"'UTF-8'",
")",
";",
"$",
"root",
"=",
"$",
"dom",
"->",
"createElement",
"(",
"\"Plugin_\"",
".",
"$",
"this",
"->",
"_plugin_nam... | create the xml template where plugin information are added to
@param string $enc target encoding
@return void | [
"create",
"the",
"xml",
"template",
"where",
"plugin",
"information",
"are",
"added",
"to"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/plugin/class.PSI_Plugin.inc.php#L127-L133 |
phpsysinfo/phpsysinfo | includes/mb/class.thermalzone.inc.php | ThermalZone._temperature | private function _temperature()
{
if (PSI_OS == 'WINNT') {
if ($this->_buf) foreach ($this->_buf as $buffer) {
if (isset($buffer['CurrentTemperature']) && (($value = ($buffer['CurrentTemperature'] - 2732)/10) > -100)) {
$dev = new SensorDevice();
... | php | private function _temperature()
{
if (PSI_OS == 'WINNT') {
if ($this->_buf) foreach ($this->_buf as $buffer) {
if (isset($buffer['CurrentTemperature']) && (($value = ($buffer['CurrentTemperature'] - 2732)/10) > -100)) {
$dev = new SensorDevice();
... | [
"private",
"function",
"_temperature",
"(",
")",
"{",
"if",
"(",
"PSI_OS",
"==",
"'WINNT'",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_buf",
")",
"foreach",
"(",
"$",
"this",
"->",
"_buf",
"as",
"$",
"buffer",
")",
"{",
"if",
"(",
"isset",
"(",
"$... | get temperature information
@return void | [
"get",
"temperature",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.thermalzone.inc.php#L50-L126 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._get_Win32_OperatingSystem | private function _get_Win32_OperatingSystem()
{
if ($this->_Win32_OperatingSystem === null) $this->_Win32_OperatingSystem = CommonFunctions::getWMI($this->_wmi, 'Win32_OperatingSystem', array('CodeSet', 'Locale', 'LastBootUpTime', 'LocalDateTime', 'Version', 'ServicePackMajorVersion', 'Caption', 'OSArchitec... | php | private function _get_Win32_OperatingSystem()
{
if ($this->_Win32_OperatingSystem === null) $this->_Win32_OperatingSystem = CommonFunctions::getWMI($this->_wmi, 'Win32_OperatingSystem', array('CodeSet', 'Locale', 'LastBootUpTime', 'LocalDateTime', 'Version', 'ServicePackMajorVersion', 'Caption', 'OSArchitec... | [
"private",
"function",
"_get_Win32_OperatingSystem",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_Win32_OperatingSystem",
"===",
"null",
")",
"$",
"this",
"->",
"_Win32_OperatingSystem",
"=",
"CommonFunctions",
"::",
"getWMI",
"(",
"$",
"this",
"->",
"_wmi",
... | reads the data from WMI Win32_OperatingSystem
@return array | [
"reads",
"the",
"data",
"from",
"WMI",
"Win32_OperatingSystem"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L105-L109 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._get_Win32_ComputerSystem | private function _get_Win32_ComputerSystem()
{
if ($this->_Win32_ComputerSystem === null) $this->_Win32_ComputerSystem = CommonFunctions::getWMI($this->_wmi, 'Win32_ComputerSystem', array('Name', 'Manufacturer', 'Model'));
return $this->_Win32_ComputerSystem;
} | php | private function _get_Win32_ComputerSystem()
{
if ($this->_Win32_ComputerSystem === null) $this->_Win32_ComputerSystem = CommonFunctions::getWMI($this->_wmi, 'Win32_ComputerSystem', array('Name', 'Manufacturer', 'Model'));
return $this->_Win32_ComputerSystem;
} | [
"private",
"function",
"_get_Win32_ComputerSystem",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_Win32_ComputerSystem",
"===",
"null",
")",
"$",
"this",
"->",
"_Win32_ComputerSystem",
"=",
"CommonFunctions",
"::",
"getWMI",
"(",
"$",
"this",
"->",
"_wmi",
",... | reads the data from WMI Win32_ComputerSystem
@return array | [
"reads",
"the",
"data",
"from",
"WMI",
"Win32_ComputerSystem"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L116-L120 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._get_Win32_Processor | private function _get_Win32_Processor()
{
if ($this->_Win32_Processor === null) $this->_Win32_Processor = CommonFunctions::getWMI($this->_wmi, 'Win32_Processor', array('LoadPercentage', 'AddressWidth', 'Name', 'L2CacheSize', 'L3CacheSize', 'CurrentClockSpeed', 'ExtClock', 'NumberOfCores', 'NumberOfLogicalPr... | php | private function _get_Win32_Processor()
{
if ($this->_Win32_Processor === null) $this->_Win32_Processor = CommonFunctions::getWMI($this->_wmi, 'Win32_Processor', array('LoadPercentage', 'AddressWidth', 'Name', 'L2CacheSize', 'L3CacheSize', 'CurrentClockSpeed', 'ExtClock', 'NumberOfCores', 'NumberOfLogicalPr... | [
"private",
"function",
"_get_Win32_Processor",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_Win32_Processor",
"===",
"null",
")",
"$",
"this",
"->",
"_Win32_Processor",
"=",
"CommonFunctions",
"::",
"getWMI",
"(",
"$",
"this",
"->",
"_wmi",
",",
"'Win32_Pr... | reads the data from WMI Win32_Processor
@return array | [
"reads",
"the",
"data",
"from",
"WMI",
"Win32_Processor"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L127-L131 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._get_Win32_PerfFormattedData_PerfOS_Processor | private function _get_Win32_PerfFormattedData_PerfOS_Processor()
{
if ($this->_Win32_PerfFormattedData_PerfOS_Processor === null) {
$cpubuffer = CommonFunctions::getWMI($this->_wmi, 'Win32_PerfFormattedData_PerfOS_Processor', array('Name', 'PercentProcessorTime'));
$this->_Win32_Perf... | php | private function _get_Win32_PerfFormattedData_PerfOS_Processor()
{
if ($this->_Win32_PerfFormattedData_PerfOS_Processor === null) {
$cpubuffer = CommonFunctions::getWMI($this->_wmi, 'Win32_PerfFormattedData_PerfOS_Processor', array('Name', 'PercentProcessorTime'));
$this->_Win32_Perf... | [
"private",
"function",
"_get_Win32_PerfFormattedData_PerfOS_Processor",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_Win32_PerfFormattedData_PerfOS_Processor",
"===",
"null",
")",
"{",
"$",
"cpubuffer",
"=",
"CommonFunctions",
"::",
"getWMI",
"(",
"$",
"this",
"->... | reads the data from WMI Win32_PerfFormattedData_PerfOS_Processor
@return array | [
"reads",
"the",
"data",
"from",
"WMI",
"Win32_PerfFormattedData_PerfOS_Processor"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L138-L151 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._get_systeminfo | private function _get_systeminfo()
{
if ($this->_systeminfo === null) CommonFunctions::executeProgram('systeminfo', '', $this->_systeminfo, false);
return $this->_systeminfo;
} | php | private function _get_systeminfo()
{
if ($this->_systeminfo === null) CommonFunctions::executeProgram('systeminfo', '', $this->_systeminfo, false);
return $this->_systeminfo;
} | [
"private",
"function",
"_get_systeminfo",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_systeminfo",
"===",
"null",
")",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'systeminfo'",
",",
"''",
",",
"$",
"this",
"->",
"_systeminfo",
",",
"false",
")",
"... | reads the data from systeminfo
@return string | [
"reads",
"the",
"data",
"from",
"systeminfo"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L158-L162 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._getCodeSet | private function _getCodeSet()
{
$buffer = $this->_get_Win32_OperatingSystem();
if (!$buffer) {
if (CommonFunctions::executeProgram('reg', 'query HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage /v ACP', $strBuf, false) && (strlen($strBuf) > 0) && preg_match("/^\s*AC... | php | private function _getCodeSet()
{
$buffer = $this->_get_Win32_OperatingSystem();
if (!$buffer) {
if (CommonFunctions::executeProgram('reg', 'query HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage /v ACP', $strBuf, false) && (strlen($strBuf) > 0) && preg_match("/^\s*AC... | [
"private",
"function",
"_getCodeSet",
"(",
")",
"{",
"$",
"buffer",
"=",
"$",
"this",
"->",
"_get_Win32_OperatingSystem",
"(",
")",
";",
"if",
"(",
"!",
"$",
"buffer",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'reg'",
",",
"'q... | store the codepage of the os for converting some strings to utf-8
@return void | [
"store",
"the",
"codepage",
"of",
"the",
"os",
"for",
"converting",
"some",
"strings",
"to",
"utf",
"-",
"8"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L185-L223 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._devicelist | private function _devicelist($strType)
{
if (empty($this->_wmidevices)) {
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
$this->_wmidevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PnPEntity', array('Name', 'PNPDeviceID', 'Manufacturer', 'PNPClass'));
... | php | private function _devicelist($strType)
{
if (empty($this->_wmidevices)) {
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
$this->_wmidevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PnPEntity', array('Name', 'PNPDeviceID', 'Manufacturer', 'PNPClass'));
... | [
"private",
"function",
"_devicelist",
"(",
"$",
"strType",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_wmidevices",
")",
")",
"{",
"if",
"(",
"defined",
"(",
"'PSI_SHOW_DEVICES_INFOS'",
")",
"&&",
"PSI_SHOW_DEVICES_INFOS",
")",
"{",
"$",
"this"... | retrieve different device types from the system based on selector
@param string $strType type of the devices that should be returned
@return array list of devices of the specified type | [
"retrieve",
"different",
"device",
"types",
"from",
"the",
"system",
"based",
"on",
"selector"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L232-L289 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._hostname | private function _hostname()
{
if (PSI_USE_VHOST === true) {
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
} else {
$buffer = $this->_get_Win32_ComputerSystem();
if (!$buffer && CommonFunctions::executeProgram('reg', 'query HKEY... | php | private function _hostname()
{
if (PSI_USE_VHOST === true) {
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
} else {
$buffer = $this->_get_Win32_ComputerSystem();
if (!$buffer && CommonFunctions::executeProgram('reg', 'query HKEY... | [
"private",
"function",
"_hostname",
"(",
")",
"{",
"if",
"(",
"PSI_USE_VHOST",
"===",
"true",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"readenv",
"(",
"'SERVER_NAME'",
",",
"$",
"hnm",
")",
")",
"$",
"this",
"->",
"sys",
"->",
"setHostname",
"(",
... | Host Name
@return void | [
"Host",
"Name"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L296-L324 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._uptime | private function _uptime()
{
$result = 0;
date_default_timezone_set('UTC');
$buffer = $this->_get_Win32_OperatingSystem();
if ($buffer && ($buffer[0]['LastBootUpTime'] !== null)) {
$local = $buffer[0]['LocalDateTime'];
$boot = $buffer[0]['LastBootUpTime'];
... | php | private function _uptime()
{
$result = 0;
date_default_timezone_set('UTC');
$buffer = $this->_get_Win32_OperatingSystem();
if ($buffer && ($buffer[0]['LastBootUpTime'] !== null)) {
$local = $buffer[0]['LocalDateTime'];
$boot = $buffer[0]['LastBootUpTime'];
... | [
"private",
"function",
"_uptime",
"(",
")",
"{",
"$",
"result",
"=",
"0",
";",
"date_default_timezone_set",
"(",
"'UTC'",
")",
";",
"$",
"buffer",
"=",
"$",
"this",
"->",
"_get_Win32_OperatingSystem",
"(",
")",
";",
"if",
"(",
"$",
"buffer",
"&&",
"(",
... | UpTime
time the system is running
@return void | [
"UpTime",
"time",
"the",
"system",
"is",
"running"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L332-L374 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._users | protected function _users()
{
if (CommonFunctions::executeProgram('quser', '', $strBuf, false) && (strlen($strBuf) > 0)) {
$lines = preg_split('/\n/', $strBuf);
$users = count($lines)-1;
} else {
$users = 0;
$buffer = CommonFunctions::getWMI($t... | php | protected function _users()
{
if (CommonFunctions::executeProgram('quser', '', $strBuf, false) && (strlen($strBuf) > 0)) {
$lines = preg_split('/\n/', $strBuf);
$users = count($lines)-1;
} else {
$users = 0;
$buffer = CommonFunctions::getWMI($t... | [
"protected",
"function",
"_users",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'quser'",
",",
"''",
",",
"$",
"strBuf",
",",
"false",
")",
"&&",
"(",
"strlen",
"(",
"$",
"strBuf",
")",
">",
"0",
")",
")",
"{",
"$",
"l... | Number of Users
@return void | [
"Number",
"of",
"Users"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L381-L396 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._distro | private function _distro()
{
$buffer = $this->_get_Win32_OperatingSystem();
if ($buffer) {
$ver = $buffer[0]['Version'];
$kernel = $ver;
if ($buffer[0]['ServicePackMajorVersion'] > 0) {
$kernel .= ' SP'.$buffer[0]['ServicePackMajorVersion'];
... | php | private function _distro()
{
$buffer = $this->_get_Win32_OperatingSystem();
if ($buffer) {
$ver = $buffer[0]['Version'];
$kernel = $ver;
if ($buffer[0]['ServicePackMajorVersion'] > 0) {
$kernel .= ' SP'.$buffer[0]['ServicePackMajorVersion'];
... | [
"private",
"function",
"_distro",
"(",
")",
"{",
"$",
"buffer",
"=",
"$",
"this",
"->",
"_get_Win32_OperatingSystem",
"(",
")",
";",
"if",
"(",
"$",
"buffer",
")",
"{",
"$",
"ver",
"=",
"$",
"buffer",
"[",
"0",
"]",
"[",
"'Version'",
"]",
";",
"$",... | Distribution
@return void | [
"Distribution"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L403-L465 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._loadavg | private function _loadavg()
{
$loadavg = "";
$sum = 0;
$buffer = $this->_get_Win32_Processor();
if ($buffer) {
foreach ($buffer as $load) {
$value = $load['LoadPercentage'];
$loadavg .= $value.' ';
$sum += $value;
... | php | private function _loadavg()
{
$loadavg = "";
$sum = 0;
$buffer = $this->_get_Win32_Processor();
if ($buffer) {
foreach ($buffer as $load) {
$value = $load['LoadPercentage'];
$loadavg .= $value.' ';
$sum += $value;
... | [
"private",
"function",
"_loadavg",
"(",
")",
"{",
"$",
"loadavg",
"=",
"\"\"",
";",
"$",
"sum",
"=",
"0",
";",
"$",
"buffer",
"=",
"$",
"this",
"->",
"_get_Win32_Processor",
"(",
")",
";",
"if",
"(",
"$",
"buffer",
")",
"{",
"foreach",
"(",
"$",
... | Processor Load
optionally create a loadbar
@return void | [
"Processor",
"Load",
"optionally",
"create",
"a",
"loadbar"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L473-L505 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._cpuinfo | private function _cpuinfo()
{
$allCpus = $this->_get_Win32_Processor();
if (!$allCpus) {
if (CommonFunctions::executeProgram('reg', 'query HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor /s', $strBuf, false) && (strlen($strBuf) > 0)) {
$lines = preg_sp... | php | private function _cpuinfo()
{
$allCpus = $this->_get_Win32_Processor();
if (!$allCpus) {
if (CommonFunctions::executeProgram('reg', 'query HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor /s', $strBuf, false) && (strlen($strBuf) > 0)) {
$lines = preg_sp... | [
"private",
"function",
"_cpuinfo",
"(",
")",
"{",
"$",
"allCpus",
"=",
"$",
"this",
"->",
"_get_Win32_Processor",
"(",
")",
";",
"if",
"(",
"!",
"$",
"allCpus",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'reg'",
",",
"'query HK... | CPU information
@return void | [
"CPU",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L512-L576 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._machine | private function _machine()
{
$buffer = $this->_get_Win32_ComputerSystem();
if ($buffer) {
$buf = "";
if (isset($buffer[0]['Manufacturer']) && !preg_match("/^To be filled by O\.E\.M\.$|^System manufacturer$|^Not Specified$/i", $buf2=$buffer[0]['Manufacturer'])) {
... | php | private function _machine()
{
$buffer = $this->_get_Win32_ComputerSystem();
if ($buffer) {
$buf = "";
if (isset($buffer[0]['Manufacturer']) && !preg_match("/^To be filled by O\.E\.M\.$|^System manufacturer$|^Not Specified$/i", $buf2=$buffer[0]['Manufacturer'])) {
... | [
"private",
"function",
"_machine",
"(",
")",
"{",
"$",
"buffer",
"=",
"$",
"this",
"->",
"_get_Win32_ComputerSystem",
"(",
")",
";",
"if",
"(",
"$",
"buffer",
")",
"{",
"$",
"buf",
"=",
"\"\"",
";",
"if",
"(",
"isset",
"(",
"$",
"buffer",
"[",
"0",... | Machine information
@return void | [
"Machine",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L583-L599 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._hardware | private function _hardware()
{
foreach ($this->_devicelist('PCI') as $pciDev) {
$dev = new HWDevice();
$dev->setName($pciDev['Name']);
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
$dev->setManufacturer($pciDev['Manufacturer']);
... | php | private function _hardware()
{
foreach ($this->_devicelist('PCI') as $pciDev) {
$dev = new HWDevice();
$dev->setName($pciDev['Name']);
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
$dev->setManufacturer($pciDev['Manufacturer']);
... | [
"private",
"function",
"_hardware",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_devicelist",
"(",
"'PCI'",
")",
"as",
"$",
"pciDev",
")",
"{",
"$",
"dev",
"=",
"new",
"HWDevice",
"(",
")",
";",
"$",
"dev",
"->",
"setName",
"(",
"$",
"pciDev... | Hardwaredevices
@return void | [
"Hardwaredevices"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L606-L654 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._network | private function _network()
{
if ($this->_wmi) {
$buffer = $this->_get_Win32_OperatingSystem();
if ($buffer && isset($buffer[0]) && isset($buffer[0]['Version']) && version_compare($buffer[0]['Version'], "6.2", ">=")) { // minimal windows 2012 or windows 8
$allDevices ... | php | private function _network()
{
if ($this->_wmi) {
$buffer = $this->_get_Win32_OperatingSystem();
if ($buffer && isset($buffer[0]) && isset($buffer[0]['Version']) && version_compare($buffer[0]['Version'], "6.2", ">=")) { // minimal windows 2012 or windows 8
$allDevices ... | [
"private",
"function",
"_network",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_wmi",
")",
"{",
"$",
"buffer",
"=",
"$",
"this",
"->",
"_get_Win32_OperatingSystem",
"(",
")",
";",
"if",
"(",
"$",
"buffer",
"&&",
"isset",
"(",
"$",
"buffer",
"[",
... | Network devices
@return void | [
"Network",
"devices"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L661-L836 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._memory | private function _memory()
{
if ($this->_wmi) {
$buffer = $this->_get_Win32_OperatingSystem();
if ($buffer) {
$this->sys->setMemTotal($buffer[0]['TotalVisibleMemorySize'] * 1024);
$this->sys->setMemFree($buffer[0]['FreePhysicalMemory'] * 1024);
... | php | private function _memory()
{
if ($this->_wmi) {
$buffer = $this->_get_Win32_OperatingSystem();
if ($buffer) {
$this->sys->setMemTotal($buffer[0]['TotalVisibleMemorySize'] * 1024);
$this->sys->setMemFree($buffer[0]['FreePhysicalMemory'] * 1024);
... | [
"private",
"function",
"_memory",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_wmi",
")",
"{",
"$",
"buffer",
"=",
"$",
"this",
"->",
"_get_Win32_OperatingSystem",
"(",
")",
";",
"if",
"(",
"$",
"buffer",
")",
"{",
"$",
"this",
"->",
"sys",
"->",... | Physical memory information and Swap Space information
@link http://msdn2.microsoft.com/En-US/library/aa394239.aspx
@link http://msdn2.microsoft.com/en-us/library/aa394246.aspx
@return void | [
"Physical",
"memory",
"information",
"and",
"Swap",
"Space",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L845-L871 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT._filesystems | private function _filesystems()
{
$typearray = array('Unknown', 'No Root Directory', 'Removable Disk', 'Local Disk', 'Network Drive', 'Compact Disc', 'RAM Disk');
$floppyarray = array('Unknown', '5 1/4 in.', '3 1/2 in.', '3 1/2 in.', '3 1/2 in.', '3 1/2 in.', '5 1/4 in.', '5 1/4 in.', '5 1/4 in.', '... | php | private function _filesystems()
{
$typearray = array('Unknown', 'No Root Directory', 'Removable Disk', 'Local Disk', 'Network Drive', 'Compact Disc', 'RAM Disk');
$floppyarray = array('Unknown', '5 1/4 in.', '3 1/2 in.', '3 1/2 in.', '3 1/2 in.', '3 1/2 in.', '5 1/4 in.', '5 1/4 in.', '5 1/4 in.', '... | [
"private",
"function",
"_filesystems",
"(",
")",
"{",
"$",
"typearray",
"=",
"array",
"(",
"'Unknown'",
",",
"'No Root Directory'",
",",
"'Removable Disk'",
",",
"'Local Disk'",
",",
"'Network Drive'",
",",
"'Compact Disc'",
",",
"'RAM Disk'",
")",
";",
"$",
"fl... | filesystem information
@return void | [
"filesystem",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L878-L922 |
phpsysinfo/phpsysinfo | includes/os/class.WINNT.inc.php | WINNT.build | public function build()
{
$this->_distro(); //share getDistribution()
if ($this->sys->getDistribution()=="ReactOS") {
$this->error->addError("WARN", "The ReactOS version of phpSysInfo is a work in progress, some things currently don't work");
}
if (!$this->blockname || $t... | php | public function build()
{
$this->_distro(); //share getDistribution()
if ($this->sys->getDistribution()=="ReactOS") {
$this->error->addError("WARN", "The ReactOS version of phpSysInfo is a work in progress, some things currently don't work");
}
if (!$this->blockname || $t... | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"this",
"->",
"_distro",
"(",
")",
";",
"//share getDistribution()",
"if",
"(",
"$",
"this",
"->",
"sys",
"->",
"getDistribution",
"(",
")",
"==",
"\"ReactOS\"",
")",
"{",
"$",
"this",
"->",
"error",
"... | get the information
@see PSI_Interface_OS::build()
@return Void | [
"get",
"the",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.WINNT.inc.php#L970-L997 |
phpsysinfo/phpsysinfo | includes/os/class.QNX.inc.php | QNX._cpuinfo | protected function _cpuinfo()
{
if (CommonFunctions::executeProgram('pidin', 'info', $buf)
&& preg_match('/^Processor\d+: (.*)/m', $buf)) {
$lines = preg_split("/\n/", $buf, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
if (preg_match('/^Processor\d... | php | protected function _cpuinfo()
{
if (CommonFunctions::executeProgram('pidin', 'info', $buf)
&& preg_match('/^Processor\d+: (.*)/m', $buf)) {
$lines = preg_split("/\n/", $buf, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
if (preg_match('/^Processor\d... | [
"protected",
"function",
"_cpuinfo",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'pidin'",
",",
"'info'",
",",
"$",
"buf",
")",
"&&",
"preg_match",
"(",
"'/^Processor\\d+: (.*)/m'",
",",
"$",
"buf",
")",
")",
"{",
"$",
"lines... | get the cpu information
@return void | [
"get",
"the",
"cpu",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.QNX.inc.php#L34-L50 |
phpsysinfo/phpsysinfo | includes/os/class.QNX.inc.php | QNX._uptime | private function _uptime()
{
if (CommonFunctions::executeProgram('pidin', 'info', $buf)
&& preg_match('/^.* BootTime:(.*)/', $buf, $bstart)
&& CommonFunctions::executeProgram('date', '', $bstop)) {
/* default error handler */
if (function_exists('errorHandlerPs... | php | private function _uptime()
{
if (CommonFunctions::executeProgram('pidin', 'info', $buf)
&& preg_match('/^.* BootTime:(.*)/', $buf, $bstart)
&& CommonFunctions::executeProgram('date', '', $bstop)) {
/* default error handler */
if (function_exists('errorHandlerPs... | [
"private",
"function",
"_uptime",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'pidin'",
",",
"'info'",
",",
"$",
"buf",
")",
"&&",
"preg_match",
"(",
"'/^.* BootTime:(.*)/'",
",",
"$",
"buf",
",",
"$",
"bstart",
")",
"&&",
... | UpTime
time the system is running
@return void | [
"UpTime",
"time",
"the",
"system",
"is",
"running"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.QNX.inc.php#L85-L109 |
phpsysinfo/phpsysinfo | includes/os/class.QNX.inc.php | QNX._memory | private function _memory()
{
if (CommonFunctions::executeProgram('pidin', 'info', $buf)
&& preg_match('/^.* FreeMem:(\S+)Mb\/(\S+)Mb/', $buf, $memm)) {
$this->sys->setMemTotal(1024*1024*$memm[2]);
$this->sys->setMemFree(1024*1024*$memm[1]);
$this->sys->setMemUs... | php | private function _memory()
{
if (CommonFunctions::executeProgram('pidin', 'info', $buf)
&& preg_match('/^.* FreeMem:(\S+)Mb\/(\S+)Mb/', $buf, $memm)) {
$this->sys->setMemTotal(1024*1024*$memm[2]);
$this->sys->setMemFree(1024*1024*$memm[1]);
$this->sys->setMemUs... | [
"private",
"function",
"_memory",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'pidin'",
",",
"'info'",
",",
"$",
"buf",
")",
"&&",
"preg_match",
"(",
"'/^.* FreeMem:(\\S+)Mb\\/(\\S+)Mb/'",
",",
"$",
"buf",
",",
"$",
"memm",
")"... | Physical memory information and Swap Space information
@return void | [
"Physical",
"memory",
"information",
"and",
"Swap",
"Space",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.QNX.inc.php#L145-L153 |
phpsysinfo/phpsysinfo | includes/os/class.QNX.inc.php | QNX._network | private function _network()
{
if (CommonFunctions::executeProgram('ifconfig', '', $bufr, PSI_DEBUG)) {
$lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
$was = false;
$dev = null;
foreach ($lines as $line) {
if (preg_match("/^([^\s:]... | php | private function _network()
{
if (CommonFunctions::executeProgram('ifconfig', '', $bufr, PSI_DEBUG)) {
$lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
$was = false;
$dev = null;
foreach ($lines as $line) {
if (preg_match("/^([^\s:]... | [
"private",
"function",
"_network",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'ifconfig'",
",",
"''",
",",
"$",
"bufr",
",",
"PSI_DEBUG",
")",
")",
"{",
"$",
"lines",
"=",
"preg_split",
"(",
"\"/\\n/\"",
",",
"$",
"bufr",
... | network information
@return void | [
"network",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.QNX.inc.php#L173-L203 |
phpsysinfo/phpsysinfo | includes/mb/class.qtssnmp.inc.php | QTSsnmp._temperature | private function _temperature()
{
if (CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." 127.0.0.1 .1.3.6.1.4.1.24681.1.2.5.0", $buffer, PSI_DEBUG)
&& preg_match('/^[\.\d]+ = STRING:\s\"?(\d+)\sC/', $buffer, $data)) {
... | php | private function _temperature()
{
if (CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." 127.0.0.1 .1.3.6.1.4.1.24681.1.2.5.0", $buffer, PSI_DEBUG)
&& preg_match('/^[\.\d]+ = STRING:\s\"?(\d+)\sC/', $buffer, $data)) {
... | [
"private",
"function",
"_temperature",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"\"snmpwalk\"",
",",
"\"-Ona -c public -v 1 -t \"",
".",
"PSI_SNMP_TIMEOUT_INT",
".",
"\" -r \"",
".",
"PSI_SNMP_RETRY_INT",
".",
"\" 127.0.0.1 .1.3.6.1.4.1.24... | get temperature information
@return void | [
"get",
"temperature",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.qtssnmp.inc.php#L22-L49 |
phpsysinfo/phpsysinfo | includes/mb/class.qtssnmp.inc.php | QTSsnmp._fans | private function _fans()
{
if (CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." 127.0.0.1 .1.3.6.1.4.1.24681.1.2.15.1.3", $buffer, PSI_DEBUG)) {
$lines = preg_split('/\r?\n/', $buffer);
foreach ($lines as $line) if... | php | private function _fans()
{
if (CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." 127.0.0.1 .1.3.6.1.4.1.24681.1.2.15.1.3", $buffer, PSI_DEBUG)) {
$lines = preg_split('/\r?\n/', $buffer);
foreach ($lines as $line) if... | [
"private",
"function",
"_fans",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"\"snmpwalk\"",
",",
"\"-Ona -c public -v 1 -t \"",
".",
"PSI_SNMP_TIMEOUT_INT",
".",
"\" -r \"",
".",
"PSI_SNMP_RETRY_INT",
".",
"\" 127.0.0.1 .1.3.6.1.4.1.24681.1.2... | get fan information
@return void | [
"get",
"fan",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.qtssnmp.inc.php#L56-L67 |
phpsysinfo/phpsysinfo | includes/os/class.Haiku.inc.php | Haiku._cpuinfo | protected function _cpuinfo()
{
if (CommonFunctions::executeProgram('sysinfo', '-cpu', $bufr, PSI_DEBUG)) {
$cpus = preg_split("/\nCPU #\d+/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
$cpuspeed = "";
foreach ($cpus as $cpu) {
if (preg_match("/^.*running at (\d+)M... | php | protected function _cpuinfo()
{
if (CommonFunctions::executeProgram('sysinfo', '-cpu', $bufr, PSI_DEBUG)) {
$cpus = preg_split("/\nCPU #\d+/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
$cpuspeed = "";
foreach ($cpus as $cpu) {
if (preg_match("/^.*running at (\d+)M... | [
"protected",
"function",
"_cpuinfo",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'sysinfo'",
",",
"'-cpu'",
",",
"$",
"bufr",
",",
"PSI_DEBUG",
")",
")",
"{",
"$",
"cpus",
"=",
"preg_split",
"(",
"\"/\\nCPU #\\d+/\"",
",",
"$... | get the cpu information
@return void | [
"get",
"the",
"cpu",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Haiku.inc.php#L34-L67 |
phpsysinfo/phpsysinfo | includes/os/class.Haiku.inc.php | Haiku._pci | protected function _pci()
{
if (CommonFunctions::executeProgram('listdev', '', $bufr, PSI_DEBUG)) {
// $devices = preg_split("/^device |\ndevice /", $bufr, -1, PREG_SPLIT_NO_EMPTY);
$devices = preg_split("/^device /m", $bufr, -1, PREG_SPLIT_NO_EMPTY);
foreach ($devices as ... | php | protected function _pci()
{
if (CommonFunctions::executeProgram('listdev', '', $bufr, PSI_DEBUG)) {
// $devices = preg_split("/^device |\ndevice /", $bufr, -1, PREG_SPLIT_NO_EMPTY);
$devices = preg_split("/^device /m", $bufr, -1, PREG_SPLIT_NO_EMPTY);
foreach ($devices as ... | [
"protected",
"function",
"_pci",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'listdev'",
",",
"''",
",",
"$",
"bufr",
",",
"PSI_DEBUG",
")",
")",
"{",
"// $devices = preg_split(\"/^device |\\ndevice /\", $bufr, -1, PREG_SPLIT_NO... | PCI devices
get the pci device information
@return void | [
"PCI",
"devices",
"get",
"the",
"pci",
"device",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Haiku.inc.php#L75-L102 |
phpsysinfo/phpsysinfo | includes/os/class.Haiku.inc.php | Haiku._usb | protected function _usb()
{
if (CommonFunctions::executeProgram('listusb', '', $bufr, PSI_DEBUG)) {
$devices = preg_split("/\n/", $bufr);
foreach ($devices as $device) {
if (preg_match("/^\S+\s+\S+\s+\"(.*)\"\s+\"(.*)\"/", $device, $ar_buf)) {
$dev... | php | protected function _usb()
{
if (CommonFunctions::executeProgram('listusb', '', $bufr, PSI_DEBUG)) {
$devices = preg_split("/\n/", $bufr);
foreach ($devices as $device) {
if (preg_match("/^\S+\s+\S+\s+\"(.*)\"\s+\"(.*)\"/", $device, $ar_buf)) {
$dev... | [
"protected",
"function",
"_usb",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'listusb'",
",",
"''",
",",
"$",
"bufr",
",",
"PSI_DEBUG",
")",
")",
"{",
"$",
"devices",
"=",
"preg_split",
"(",
"\"/\\n/\"",
",",
"$",
"bufr",
... | USB devices
get the usb device information
@return void | [
"USB",
"devices",
"get",
"the",
"usb",
"device",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Haiku.inc.php#L110-L122 |
phpsysinfo/phpsysinfo | includes/os/class.Haiku.inc.php | Haiku._distro | protected function _distro()
{
if (CommonFunctions::executeProgram('uname', '-sr', $ret))
$this->sys->setDistribution($ret);
else
$this->sys->setDistribution('Haiku');
$this->sys->setDistributionIcon('Haiku.png');
} | php | protected function _distro()
{
if (CommonFunctions::executeProgram('uname', '-sr', $ret))
$this->sys->setDistribution($ret);
else
$this->sys->setDistribution('Haiku');
$this->sys->setDistributionIcon('Haiku.png');
} | [
"protected",
"function",
"_distro",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'uname'",
",",
"'-sr'",
",",
"$",
"ret",
")",
")",
"$",
"this",
"->",
"sys",
"->",
"setDistribution",
"(",
"$",
"ret",
")",
";",
"else",
"$",... | Distribution
@return void | [
"Distribution"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Haiku.inc.php#L141-L149 |
phpsysinfo/phpsysinfo | includes/os/class.Haiku.inc.php | Haiku._loadavg | private function _loadavg()
{
if (CommonFunctions::executeProgram('top', '-n 1 -i 1', $buf)) {
if (preg_match("/\s+(\S+)%\s+TOTAL\s+\(\S+%\s+idle time/", $buf, $ar_buf)) {
$this->sys->setLoad($ar_buf[1]);
if (PSI_LOAD_BAR) {
$this->sys->setLoad... | php | private function _loadavg()
{
if (CommonFunctions::executeProgram('top', '-n 1 -i 1', $buf)) {
if (preg_match("/\s+(\S+)%\s+TOTAL\s+\(\S+%\s+idle time/", $buf, $ar_buf)) {
$this->sys->setLoad($ar_buf[1]);
if (PSI_LOAD_BAR) {
$this->sys->setLoad... | [
"private",
"function",
"_loadavg",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'top'",
",",
"'-n 1 -i 1'",
",",
"$",
"buf",
")",
")",
"{",
"if",
"(",
"preg_match",
"(",
"\"/\\s+(\\S+)%\\s+TOTAL\\s+\\(\\S+%\\s+idle time/\"",
",",
"$... | Processor Load
optionally create a loadbar
@return void | [
"Processor",
"Load",
"optionally",
"create",
"a",
"loadbar"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Haiku.inc.php#L182-L192 |
phpsysinfo/phpsysinfo | includes/os/class.Haiku.inc.php | Haiku._memory | private function _memory()
{
if (CommonFunctions::executeProgram('sysinfo', '-mem', $bufr, PSI_DEBUG)) {
if (preg_match("/(.*)bytes free\s+\(used\/max\s+(.*)\s+\/\s+(.*)\)\s*\n\s+\(cached\s+(.*)\)/", $bufr, $ar_buf)) {
$this->sys->setMemTotal($ar_buf[3]);
$this->s... | php | private function _memory()
{
if (CommonFunctions::executeProgram('sysinfo', '-mem', $bufr, PSI_DEBUG)) {
if (preg_match("/(.*)bytes free\s+\(used\/max\s+(.*)\s+\/\s+(.*)\)\s*\n\s+\(cached\s+(.*)\)/", $bufr, $ar_buf)) {
$this->sys->setMemTotal($ar_buf[3]);
$this->s... | [
"private",
"function",
"_memory",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'sysinfo'",
",",
"'-mem'",
",",
"$",
"bufr",
",",
"PSI_DEBUG",
")",
")",
"{",
"if",
"(",
"preg_match",
"(",
"\"/(.*)bytes free\\s+\\(used\\/max\\s+(.*)\\... | Physical memory information and Swap Space information
@return void | [
"Physical",
"memory",
"information",
"and",
"Swap",
"Space",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Haiku.inc.php#L228-L251 |
phpsysinfo/phpsysinfo | includes/os/class.Haiku.inc.php | Haiku._filesystems | private function _filesystems()
{
if (CommonFunctions::executeProgram('df', '-b', $df, PSI_DEBUG)) {
$df = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
foreach ($df as $df_line) {
$ar_buf = preg_split("/\s+/", $df_line);
if ((substr($df_line, 0, 1) ==... | php | private function _filesystems()
{
if (CommonFunctions::executeProgram('df', '-b', $df, PSI_DEBUG)) {
$df = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
foreach ($df as $df_line) {
$ar_buf = preg_split("/\s+/", $df_line);
if ((substr($df_line, 0, 1) ==... | [
"private",
"function",
"_filesystems",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'df'",
",",
"'-b'",
",",
"$",
"df",
",",
"PSI_DEBUG",
")",
")",
"{",
"$",
"df",
"=",
"preg_split",
"(",
"\"/\\n/\"",
",",
"$",
"df",
",",
... | filesystem information
@return void | [
"filesystem",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Haiku.inc.php#L258-L277 |
phpsysinfo/phpsysinfo | includes/os/class.Haiku.inc.php | Haiku._network | private function _network()
{
if (CommonFunctions::executeProgram('ifconfig', '', $bufr, PSI_DEBUG)) {
$lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
$was = false;
$errors = 0;
$drops = 0;
$dev = null;
foreach ($lines as $... | php | private function _network()
{
if (CommonFunctions::executeProgram('ifconfig', '', $bufr, PSI_DEBUG)) {
$lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
$was = false;
$errors = 0;
$drops = 0;
$dev = null;
foreach ($lines as $... | [
"private",
"function",
"_network",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'ifconfig'",
",",
"''",
",",
"$",
"bufr",
",",
"PSI_DEBUG",
")",
")",
"{",
"$",
"lines",
"=",
"preg_split",
"(",
"\"/\\n/\"",
",",
"$",
"bufr",
... | network information
@return void | [
"network",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Haiku.inc.php#L284-L335 |
phpsysinfo/phpsysinfo | plugins/psstatus/class.psstatus.inc.php | PSStatus.execute | public function execute()
{
if (defined('PSI_PLUGIN_PSSTATUS_PROCESSES') && is_string(PSI_PLUGIN_PSSTATUS_PROCESSES)) {
if (preg_match(ARRAY_EXP, PSI_PLUGIN_PSSTATUS_PROCESSES)) {
$processes = eval(PSI_PLUGIN_PSSTATUS_PROCESSES);
} else {
$processes = ... | php | public function execute()
{
if (defined('PSI_PLUGIN_PSSTATUS_PROCESSES') && is_string(PSI_PLUGIN_PSSTATUS_PROCESSES)) {
if (preg_match(ARRAY_EXP, PSI_PLUGIN_PSSTATUS_PROCESSES)) {
$processes = eval(PSI_PLUGIN_PSSTATUS_PROCESSES);
} else {
$processes = ... | [
"public",
"function",
"execute",
"(",
")",
"{",
"if",
"(",
"defined",
"(",
"'PSI_PLUGIN_PSSTATUS_PROCESSES'",
")",
"&&",
"is_string",
"(",
"PSI_PLUGIN_PSSTATUS_PROCESSES",
")",
")",
"{",
"if",
"(",
"preg_match",
"(",
"ARRAY_EXP",
",",
"PSI_PLUGIN_PSSTATUS_PROCESSES"... | doing all tasks to get the required informations that the plugin needs
result is stored in an internal array<br>the array is build like a tree,
so that it is possible to get only a specific process with the childs
@return void | [
"doing",
"all",
"tasks",
"to",
"get",
"the",
"required",
"informations",
"that",
"the",
"plugin",
"needs",
"result",
"is",
"stored",
"in",
"an",
"internal",
"array<br",
">",
"the",
"array",
"is",
"build",
"like",
"a",
"tree",
"so",
"that",
"it",
"is",
"p... | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/plugins/psstatus/class.psstatus.inc.php#L101-L119 |
phpsysinfo/phpsysinfo | plugins/psstatus/class.psstatus.inc.php | PSStatus.xml | public function xml()
{
foreach ($this->_result as $ps) {
$xmlps = $this->xml->addChild("Process");
$xmlps->addAttribute("Name", $ps[0]);
$xmlps->addAttribute("Status", $ps[1] ? 1 : 0);
}
return $this->xml->getSimpleXmlElement();
} | php | public function xml()
{
foreach ($this->_result as $ps) {
$xmlps = $this->xml->addChild("Process");
$xmlps->addAttribute("Name", $ps[0]);
$xmlps->addAttribute("Status", $ps[1] ? 1 : 0);
}
return $this->xml->getSimpleXmlElement();
} | [
"public",
"function",
"xml",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_result",
"as",
"$",
"ps",
")",
"{",
"$",
"xmlps",
"=",
"$",
"this",
"->",
"xml",
"->",
"addChild",
"(",
"\"Process\"",
")",
";",
"$",
"xmlps",
"->",
"addAttribute",
"(... | generates the XML content for the plugin
@return SimpleXMLElement entire XML content for the plugin | [
"generates",
"the",
"XML",
"content",
"for",
"the",
"plugin"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/plugins/psstatus/class.psstatus.inc.php#L126-L135 |
phpsysinfo/phpsysinfo | plugins/psstatus/class.psstatus.inc.php | PSStatus.process_inarray | private function process_inarray($needle, $haystack)
{
foreach ($haystack as $stalk) {
if ($needle === $stalk[0]) {
return true;
}
}
return false;
} | php | private function process_inarray($needle, $haystack)
{
foreach ($haystack as $stalk) {
if ($needle === $stalk[0]) {
return true;
}
}
return false;
} | [
"private",
"function",
"process_inarray",
"(",
"$",
"needle",
",",
"$",
"haystack",
")",
"{",
"foreach",
"(",
"$",
"haystack",
"as",
"$",
"stalk",
")",
"{",
"if",
"(",
"$",
"needle",
"===",
"$",
"stalk",
"[",
"0",
"]",
")",
"{",
"return",
"true",
"... | checks an array if process name is in
@param mixed $needle what to find
@param array $haystack where to find
@return boolean true - found<br>false - not found | [
"checks",
"an",
"array",
"if",
"process",
"name",
"is",
"in"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/plugins/psstatus/class.psstatus.inc.php#L145-L154 |
phpsysinfo/phpsysinfo | includes/mb/class.hddtemp.inc.php | HDDTemp._temperature | private function _temperature()
{
$ar_buf = array();
switch (defined('PSI_SENSOR_HDDTEMP_ACCESS')?strtolower(PSI_SENSOR_HDDTEMP_ACCESS):'command') {
case 'tcp':
$lines = '';
// Timo van Roermund: connect to the hddtemp daemon, use a 5 second timeout.
$fp =... | php | private function _temperature()
{
$ar_buf = array();
switch (defined('PSI_SENSOR_HDDTEMP_ACCESS')?strtolower(PSI_SENSOR_HDDTEMP_ACCESS):'command') {
case 'tcp':
$lines = '';
// Timo van Roermund: connect to the hddtemp daemon, use a 5 second timeout.
$fp =... | [
"private",
"function",
"_temperature",
"(",
")",
"{",
"$",
"ar_buf",
"=",
"array",
"(",
")",
";",
"switch",
"(",
"defined",
"(",
"'PSI_SENSOR_HDDTEMP_ACCESS'",
")",
"?",
"strtolower",
"(",
"PSI_SENSOR_HDDTEMP_ACCESS",
")",
":",
"'command'",
")",
"{",
"case",
... | get the temperature information from hddtemp
access is available through tcp or command
@return void | [
"get",
"the",
"temperature",
"information",
"from",
"hddtemp",
"access",
"is",
"available",
"through",
"tcp",
"or",
"command"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.hddtemp.inc.php#L24-L111 |
phpsysinfo/phpsysinfo | plugins/uprecords/class.uprecords.inc.php | uprecords.getUprecords | private function getUprecords()
{
$result = array();
$i = 0;
foreach ($this->_lines as $line) {
if (($i > 1) and (strpos($line, '---') === false)) {
$buffer = preg_split("/\s*[ |]\s+/", ltrim(ltrim($line, '->'), ' '));
if (defined('PSI_PLUGIN_UPRE... | php | private function getUprecords()
{
$result = array();
$i = 0;
foreach ($this->_lines as $line) {
if (($i > 1) and (strpos($line, '---') === false)) {
$buffer = preg_split("/\s*[ |]\s+/", ltrim(ltrim($line, '->'), ' '));
if (defined('PSI_PLUGIN_UPRE... | [
"private",
"function",
"getUprecords",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"i",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"_lines",
"as",
"$",
"line",
")",
"{",
"if",
"(",
"(",
"$",
"i",
">",
"1",
")",
"and... | get uprecords information
@return array uprecords in array with label | [
"get",
"uprecords",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/plugins/uprecords/class.uprecords.inc.php#L31-L67 |
phpsysinfo/phpsysinfo | plugins/bat/class.bat.inc.php | BAT.execute | public function execute()
{
if (empty($this->_filecontent)) {
return;
}
for ($bi = 0; $bi < sizeof($this->_filecontent); $bi++) {
$bat = array();
if (isset($this->_filecontent[$bi]['info'])) foreach ($this->_filecontent[$bi]['info'] as $roworig) {
... | php | public function execute()
{
if (empty($this->_filecontent)) {
return;
}
for ($bi = 0; $bi < sizeof($this->_filecontent); $bi++) {
$bat = array();
if (isset($this->_filecontent[$bi]['info'])) foreach ($this->_filecontent[$bi]['info'] as $roworig) {
... | [
"public",
"function",
"execute",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_filecontent",
")",
")",
"{",
"return",
";",
"}",
"for",
"(",
"$",
"bi",
"=",
"0",
";",
"$",
"bi",
"<",
"sizeof",
"(",
"$",
"this",
"->",
"_filecontent",... | doing all tasks to get the required informations that the plugin needs
result is stored in an internal array
@return void | [
"doing",
"all",
"tasks",
"to",
"get",
"the",
"required",
"informations",
"that",
"the",
"plugin",
"needs",
"result",
"is",
"stored",
"in",
"an",
"internal",
"array"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/plugins/bat/class.bat.inc.php#L348-L679 |
phpsysinfo/phpsysinfo | plugins/bat/class.bat.inc.php | BAT.xml | public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
$xmlbat->addAttribute("Name", $bat_item['name']);
}
if (isset($bat_item['model']) && ($bat_item['model'] !== ... | php | public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
$xmlbat->addAttribute("Name", $bat_item['name']);
}
if (isset($bat_item['model']) && ($bat_item['model'] !== ... | [
"public",
"function",
"xml",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_result",
"as",
"$",
"bat_item",
")",
"{",
"$",
"xmlbat",
"=",
"$",
"this",
"->",
"xml",
"->",
"addChild",
"(",
"\"Bat\"",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"ba... | generates the XML content for the plugin
@return SimpleXMLElement entire XML content for the plugin | [
"generates",
"the",
"XML",
"content",
"for",
"the",
"plugin"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/plugins/bat/class.bat.inc.php#L686-L776 |
phpsysinfo/phpsysinfo | includes/os/class.FreeBSD.inc.php | FreeBSD._uptime | private function _uptime()
{
$s = preg_split('/ /', $this->grabkey('kern.boottime'));
$a = preg_replace('/,/', '', $s[3]);
$this->sys->setUptime(time() - $a);
} | php | private function _uptime()
{
$s = preg_split('/ /', $this->grabkey('kern.boottime'));
$a = preg_replace('/,/', '', $s[3]);
$this->sys->setUptime(time() - $a);
} | [
"private",
"function",
"_uptime",
"(",
")",
"{",
"$",
"s",
"=",
"preg_split",
"(",
"'/ /'",
",",
"$",
"this",
"->",
"grabkey",
"(",
"'kern.boottime'",
")",
")",
";",
"$",
"a",
"=",
"preg_replace",
"(",
"'/,/'",
",",
"''",
",",
"$",
"s",
"[",
"3",
... | UpTime
time the system is running
@return void | [
"UpTime",
"time",
"the",
"system",
"is",
"running"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.FreeBSD.inc.php#L50-L55 |
phpsysinfo/phpsysinfo | includes/os/class.FreeBSD.inc.php | FreeBSD._network | private function _network()
{
$dev = null;
if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
$lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$ar_buf = preg_split("/\s+/", $line);
... | php | private function _network()
{
$dev = null;
if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
$lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$ar_buf = preg_split("/\s+/", $line);
... | [
"private",
"function",
"_network",
"(",
")",
"{",
"$",
"dev",
"=",
"null",
";",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'netstat'",
",",
"'-nibd'",
",",
"$",
"netstat",
",",
"PSI_DEBUG",
")",
")",
"{",
"$",
"lines",
"=",
"preg_split",... | get network information
@return void | [
"get",
"network",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.FreeBSD.inc.php#L62-L127 |
phpsysinfo/phpsysinfo | includes/os/class.FreeBSD.inc.php | FreeBSD._distroicon | private function _distroicon()
{
if (extension_loaded('pfSense') && CommonFunctions::rfts('/etc/version', $version, 1, 4096, false) && (trim($version) != '')) { // pfSense detection
$this->sys->setDistribution('pfSense '. trim($version));
$this->sys->setDistributionIcon('pfSense.png'... | php | private function _distroicon()
{
if (extension_loaded('pfSense') && CommonFunctions::rfts('/etc/version', $version, 1, 4096, false) && (trim($version) != '')) { // pfSense detection
$this->sys->setDistribution('pfSense '. trim($version));
$this->sys->setDistributionIcon('pfSense.png'... | [
"private",
"function",
"_distroicon",
"(",
")",
"{",
"if",
"(",
"extension_loaded",
"(",
"'pfSense'",
")",
"&&",
"CommonFunctions",
"::",
"rfts",
"(",
"'/etc/version'",
",",
"$",
"version",
",",
"1",
",",
"4096",
",",
"false",
")",
"&&",
"(",
"trim",
"("... | get icon name and distro extended check
@return void | [
"get",
"icon",
"name",
"and",
"distro",
"extended",
"check"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.FreeBSD.inc.php#L134-L142 |
phpsysinfo/phpsysinfo | includes/os/class.FreeBSD.inc.php | FreeBSD._memoryadditional | private function _memoryadditional()
{
$pagesize = $this->grabkey("hw.pagesize");
$this->sys->setMemCache($this->grabkey("vm.stats.vm.v_cache_count") * $pagesize);
$this->sys->setMemApplication(($this->grabkey("vm.stats.vm.v_active_count") + $this->grabkey("vm.stats.vm.v_wire_count")) * $pag... | php | private function _memoryadditional()
{
$pagesize = $this->grabkey("hw.pagesize");
$this->sys->setMemCache($this->grabkey("vm.stats.vm.v_cache_count") * $pagesize);
$this->sys->setMemApplication(($this->grabkey("vm.stats.vm.v_active_count") + $this->grabkey("vm.stats.vm.v_wire_count")) * $pag... | [
"private",
"function",
"_memoryadditional",
"(",
")",
"{",
"$",
"pagesize",
"=",
"$",
"this",
"->",
"grabkey",
"(",
"\"hw.pagesize\"",
")",
";",
"$",
"this",
"->",
"sys",
"->",
"setMemCache",
"(",
"$",
"this",
"->",
"grabkey",
"(",
"\"vm.stats.vm.v_cache_cou... | extend the memory information with additional values
@return void | [
"extend",
"the",
"memory",
"information",
"with",
"additional",
"values"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.FreeBSD.inc.php#L149-L155 |
phpsysinfo/phpsysinfo | includes/os/class.FreeBSD.inc.php | FreeBSD._processes | protected function _processes()
{
if (CommonFunctions::executeProgram('ps', 'aux', $bufr, PSI_DEBUG)) {
$lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
$processes['*'] = 0;
foreach ($lines as $line) {
if (preg_match("/^\S+\s+\d+\s+\S+\s+\S+\s+... | php | protected function _processes()
{
if (CommonFunctions::executeProgram('ps', 'aux', $bufr, PSI_DEBUG)) {
$lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
$processes['*'] = 0;
foreach ($lines as $line) {
if (preg_match("/^\S+\s+\d+\s+\S+\s+\S+\s+... | [
"protected",
"function",
"_processes",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'ps'",
",",
"'aux'",
",",
"$",
"bufr",
",",
"PSI_DEBUG",
")",
")",
"{",
"$",
"lines",
"=",
"preg_split",
"(",
"\"/\\n/\"",
",",
"$",
"bufr",... | Processes
@return void | [
"Processes"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.FreeBSD.inc.php#L162-L184 |
phpsysinfo/phpsysinfo | includes/os/class.FreeBSD.inc.php | FreeBSD.build | public function build()
{
parent::build();
if (!$this->blockname || $this->blockname==='vitals') {
$this->_distroicon();
$this->_uptime();
$this->_processes();
}
if (!$this->blockname || $this->blockname==='network') {
$this->_network()... | php | public function build()
{
parent::build();
if (!$this->blockname || $this->blockname==='vitals') {
$this->_distroicon();
$this->_uptime();
$this->_processes();
}
if (!$this->blockname || $this->blockname==='network') {
$this->_network()... | [
"public",
"function",
"build",
"(",
")",
"{",
"parent",
"::",
"build",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"blockname",
"||",
"$",
"this",
"->",
"blockname",
"===",
"'vitals'",
")",
"{",
"$",
"this",
"->",
"_distroicon",
"(",
")",
";"... | get the information
@see BSDCommon::build()
@return Void | [
"get",
"the",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.FreeBSD.inc.php#L193-L207 |
phpsysinfo/phpsysinfo | plugins/quotas/class.quotas.inc.php | Quotas.execute | public function execute()
{
$i = 0;
$quotas = array();
foreach ($this->_filecontent as $thisline) {
$thisline = preg_replace("/([\s]--)/", "", $thisline);
$thisline = preg_split("/(\s)/", $thisline, -1, PREG_SPLIT_NO_EMPTY);
if (count($thisline) == 7) {
... | php | public function execute()
{
$i = 0;
$quotas = array();
foreach ($this->_filecontent as $thisline) {
$thisline = preg_replace("/([\s]--)/", "", $thisline);
$thisline = preg_split("/(\s)/", $thisline, -1, PREG_SPLIT_NO_EMPTY);
if (count($thisline) == 7) {
... | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"i",
"=",
"0",
";",
"$",
"quotas",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_filecontent",
"as",
"$",
"thisline",
")",
"{",
"$",
"thisline",
"=",
"preg_replace",
"(",
"\"/... | doing all tasks to get the required informations that the plugin needs
result is stored in an internal array<br>the array is build like a tree,
so that it is possible to get only a specific process with the childs
@return void | [
"doing",
"all",
"tasks",
"to",
"get",
"the",
"required",
"informations",
"that",
"the",
"plugin",
"needs",
"result",
"is",
"stored",
"in",
"an",
"internal",
"array<br",
">",
"the",
"array",
"is",
"build",
"like",
"a",
"tree",
"so",
"that",
"it",
"is",
"p... | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/plugins/quotas/class.quotas.inc.php#L66-L95 |
phpsysinfo/phpsysinfo | plugins/quotas/class.quotas.inc.php | Quotas.xml | public function xml()
{
foreach ($this->_result as $quota) {
$quotaChild = $this->xml->addChild("Quota");
$quotaChild->addAttribute("User", $quota['user']);
$quotaChild->addAttribute("ByteUsed", $quota['byte_used']);
$quotaChild->addAttribute("ByteSoft", $quot... | php | public function xml()
{
foreach ($this->_result as $quota) {
$quotaChild = $this->xml->addChild("Quota");
$quotaChild->addAttribute("User", $quota['user']);
$quotaChild->addAttribute("ByteUsed", $quota['byte_used']);
$quotaChild->addAttribute("ByteSoft", $quot... | [
"public",
"function",
"xml",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_result",
"as",
"$",
"quota",
")",
"{",
"$",
"quotaChild",
"=",
"$",
"this",
"->",
"xml",
"->",
"addChild",
"(",
"\"Quota\"",
")",
";",
"$",
"quotaChild",
"->",
"addAttri... | generates the XML content for the plugin
@return SimpleXMLElement entire XML content for the plugin | [
"generates",
"the",
"XML",
"content",
"for",
"the",
"plugin"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/plugins/quotas/class.quotas.inc.php#L102-L118 |
phpsysinfo/phpsysinfo | includes/os/class.OpenBSD.inc.php | OpenBSD.ide | protected function ide()
{
foreach ($this->readdmesg() as $line) {
if (preg_match('/^(.*) at pciide[0-9]+ (.*): <(.*)>/', $line, $ar_buf)) {
$dev = new HWDevice();
$dev->setName($ar_buf[3]);
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES... | php | protected function ide()
{
foreach ($this->readdmesg() as $line) {
if (preg_match('/^(.*) at pciide[0-9]+ (.*): <(.*)>/', $line, $ar_buf)) {
$dev = new HWDevice();
$dev->setName($ar_buf[3]);
if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES... | [
"protected",
"function",
"ide",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"readdmesg",
"(",
")",
"as",
"$",
"line",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^(.*) at pciide[0-9]+ (.*): <(.*)>/'",
",",
"$",
"line",
",",
"$",
"ar_buf",
")",
")",
... | IDE information
@return void | [
"IDE",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.OpenBSD.inc.php#L112-L130 |
phpsysinfo/phpsysinfo | includes/os/class.OpenBSD.inc.php | OpenBSD.cpuinfo | protected function cpuinfo()
{
$dev = new CpuDevice();
$dev->setModel($this->grabkey('hw.model'));
$dev->setCpuSpeed($this->grabkey('hw.cpuspeed'));
$was = false;
foreach ($this->readdmesg() as $line) {
if (preg_match("/^cpu[0-9]+: (.*)/", $line, $ar_buf)) {
... | php | protected function cpuinfo()
{
$dev = new CpuDevice();
$dev->setModel($this->grabkey('hw.model'));
$dev->setCpuSpeed($this->grabkey('hw.cpuspeed'));
$was = false;
foreach ($this->readdmesg() as $line) {
if (preg_match("/^cpu[0-9]+: (.*)/", $line, $ar_buf)) {
... | [
"protected",
"function",
"cpuinfo",
"(",
")",
"{",
"$",
"dev",
"=",
"new",
"CpuDevice",
"(",
")",
";",
"$",
"dev",
"->",
"setModel",
"(",
"$",
"this",
"->",
"grabkey",
"(",
"'hw.model'",
")",
")",
";",
"$",
"dev",
"->",
"setCpuSpeed",
"(",
"$",
"th... | get CPU information
@return void | [
"get",
"CPU",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.OpenBSD.inc.php#L137-L170 |
phpsysinfo/phpsysinfo | includes/ups/class.apcupsd.inc.php | Apcupsd._info | private function _info()
{
foreach ($this->_output as $ups) {
$dev = new UPSDevice();
// General info
if (preg_match('/^UPSNAME\s*:\s*(.*)$/m', $ups, $data)) {
$dev->setName(trim($data[1]));
}
if (preg_match('/^MODEL\s*:\s*(.*)$/m... | php | private function _info()
{
foreach ($this->_output as $ups) {
$dev = new UPSDevice();
// General info
if (preg_match('/^UPSNAME\s*:\s*(.*)$/m', $ups, $data)) {
$dev->setName(trim($data[1]));
}
if (preg_match('/^MODEL\s*:\s*(.*)$/m... | [
"private",
"function",
"_info",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_output",
"as",
"$",
"ups",
")",
"{",
"$",
"dev",
"=",
"new",
"UPSDevice",
"(",
")",
";",
"// General info",
"if",
"(",
"preg_match",
"(",
"'/^UPSNAME\\s*:\\s*(.*)$/m'",
"... | parse the input and store data in resultset for xml generation
@return Void | [
"parse",
"the",
"input",
"and",
"store",
"data",
"in",
"resultset",
"for",
"xml",
"generation"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/ups/class.apcupsd.inc.php#L67-L135 |
phpsysinfo/phpsysinfo | plugins/ps/class.ps.inc.php | PS.execute | public function execute()
{
if (empty($this->_filecontent)) {
return;
}
$items = array();
foreach ($this->_filecontent as $roworig) {
$row = preg_split("/[\s]+/", trim($roworig), 5);
if (count($row) != 5) {
break;
}
... | php | public function execute()
{
if (empty($this->_filecontent)) {
return;
}
$items = array();
foreach ($this->_filecontent as $roworig) {
$row = preg_split("/[\s]+/", trim($roworig), 5);
if (count($row) != 5) {
break;
}
... | [
"public",
"function",
"execute",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_filecontent",
")",
")",
"{",
"return",
";",
"}",
"$",
"items",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_filecontent",
"as",
"$",
... | doing all tasks to get the required informations that the plugin needs
result is stored in an internal array<br>the array is build like a tree,
so that it is possible to get only a specific process with the childs
@return void | [
"doing",
"all",
"tasks",
"to",
"get",
"the",
"required",
"informations",
"that",
"the",
"plugin",
"needs",
"result",
"is",
"stored",
"in",
"an",
"internal",
"array<br",
">",
"the",
"array",
"is",
"build",
"like",
"a",
"tree",
"so",
"that",
"it",
"is",
"p... | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/plugins/ps/class.ps.inc.php#L166-L205 |
phpsysinfo/phpsysinfo | plugins/ps/class.ps.inc.php | PS.xml | public function xml()
{
if ($this->_result) {
$positions = array(0=>0);
$this->_addchild($this->_result['childs'], $this->xml, $positions);
}
return $this->xml->getSimpleXmlElement();
} | php | public function xml()
{
if ($this->_result) {
$positions = array(0=>0);
$this->_addchild($this->_result['childs'], $this->xml, $positions);
}
return $this->xml->getSimpleXmlElement();
} | [
"public",
"function",
"xml",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_result",
")",
"{",
"$",
"positions",
"=",
"array",
"(",
"0",
"=>",
"0",
")",
";",
"$",
"this",
"->",
"_addchild",
"(",
"$",
"this",
"->",
"_result",
"[",
"'childs'",
"]",... | generates the XML content for the plugin
@return SimpleXMLElement entire XML content for the plugin | [
"generates",
"the",
"XML",
"content",
"for",
"the",
"plugin"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/plugins/ps/class.ps.inc.php#L211-L219 |
phpsysinfo/phpsysinfo | plugins/ps/class.ps.inc.php | PS._addchild | private function _addchild($child, SimpleXMLExtended $xml, &$positions)
{
foreach ($child as $key=>$value) {
$xmlnode = $xml->addChild("Process");
if (isset($value[0])) {
array_push($positions, $value[0]);
$xmlnode->addAttribute('PID', $value[0]);
... | php | private function _addchild($child, SimpleXMLExtended $xml, &$positions)
{
foreach ($child as $key=>$value) {
$xmlnode = $xml->addChild("Process");
if (isset($value[0])) {
array_push($positions, $value[0]);
$xmlnode->addAttribute('PID', $value[0]);
... | [
"private",
"function",
"_addchild",
"(",
"$",
"child",
",",
"SimpleXMLExtended",
"$",
"xml",
",",
"&",
"$",
"positions",
")",
"{",
"foreach",
"(",
"$",
"child",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"xmlnode",
"=",
"$",
"xml",
"->",
... | recursive function to allow appending child processes to a parent process
@param array $child part of the array which should be appended to the XML
@param SimpleXMLExtended $xml XML-Object to which the array content is appended
@param array &$positions array with parent positions in... | [
"recursive",
"function",
"to",
"allow",
"appending",
"child",
"processes",
"to",
"a",
"parent",
"process"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/plugins/ps/class.ps.inc.php#L229-L258 |
phpsysinfo/phpsysinfo | includes/mb/class.ohm.inc.php | OHM._temperature | private function _temperature()
{
if (isset($this->_buf['Temperature'])) foreach ($this->_buf['Temperature'] as $name=>$value) {
$dev = new SensorDevice();
$dev->setName($name);
$dev->setValue($value);
$this->mbinfo->setMbTemp($dev);
}
} | php | private function _temperature()
{
if (isset($this->_buf['Temperature'])) foreach ($this->_buf['Temperature'] as $name=>$value) {
$dev = new SensorDevice();
$dev->setName($name);
$dev->setValue($value);
$this->mbinfo->setMbTemp($dev);
}
} | [
"private",
"function",
"_temperature",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_buf",
"[",
"'Temperature'",
"]",
")",
")",
"foreach",
"(",
"$",
"this",
"->",
"_buf",
"[",
"'Temperature'",
"]",
"as",
"$",
"name",
"=>",
"$",
"value"... | get temperature information
@return void | [
"get",
"temperature",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.ohm.inc.php#L53-L61 |
phpsysinfo/phpsysinfo | includes/mb/class.ohm.inc.php | OHM._voltage | private function _voltage()
{
if (isset($this->_buf['Voltage'])) foreach ($this->_buf['Voltage'] as $name=>$value) {
$dev = new SensorDevice();
$dev->setName($name);
$dev->setValue($value);
$this->mbinfo->setMbVolt($dev);
}
} | php | private function _voltage()
{
if (isset($this->_buf['Voltage'])) foreach ($this->_buf['Voltage'] as $name=>$value) {
$dev = new SensorDevice();
$dev->setName($name);
$dev->setValue($value);
$this->mbinfo->setMbVolt($dev);
}
} | [
"private",
"function",
"_voltage",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_buf",
"[",
"'Voltage'",
"]",
")",
")",
"foreach",
"(",
"$",
"this",
"->",
"_buf",
"[",
"'Voltage'",
"]",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"... | get voltage information
@return void | [
"get",
"voltage",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.ohm.inc.php#L68-L76 |
phpsysinfo/phpsysinfo | includes/mb/class.ohm.inc.php | OHM._fans | private function _fans()
{
if (isset($this->_buf['Fan'])) foreach ($this->_buf['Fan'] as $name=>$value) {
$dev = new SensorDevice();
$dev->setName($name);
$dev->setValue($value);
$this->mbinfo->setMbFan($dev);
}
} | php | private function _fans()
{
if (isset($this->_buf['Fan'])) foreach ($this->_buf['Fan'] as $name=>$value) {
$dev = new SensorDevice();
$dev->setName($name);
$dev->setValue($value);
$this->mbinfo->setMbFan($dev);
}
} | [
"private",
"function",
"_fans",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_buf",
"[",
"'Fan'",
"]",
")",
")",
"foreach",
"(",
"$",
"this",
"->",
"_buf",
"[",
"'Fan'",
"]",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
... | get fan information
@return void | [
"get",
"fan",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.ohm.inc.php#L83-L91 |
phpsysinfo/phpsysinfo | includes/mb/class.ohm.inc.php | OHM._power | private function _power()
{
if (isset($this->_buf['Power'])) foreach ($this->_buf['Power'] as $name=>$value) {
$dev = new SensorDevice();
$dev->setName($name);
$dev->setValue($value);
$this->mbinfo->setMbPower($dev);
}
} | php | private function _power()
{
if (isset($this->_buf['Power'])) foreach ($this->_buf['Power'] as $name=>$value) {
$dev = new SensorDevice();
$dev->setName($name);
$dev->setValue($value);
$this->mbinfo->setMbPower($dev);
}
} | [
"private",
"function",
"_power",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_buf",
"[",
"'Power'",
"]",
")",
")",
"foreach",
"(",
"$",
"this",
"->",
"_buf",
"[",
"'Power'",
"]",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
... | get power information
@return void | [
"get",
"power",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.ohm.inc.php#L98-L106 |
phpsysinfo/phpsysinfo | includes/os/class.Android.inc.php | Android._get_buildprop | private function _get_buildprop()
{
if ($this->_buildprop === null) {
if (!CommonFunctions::rfts('/system/build.prop', $this->_buildprop, 0, 4096, false)) {
CommonFunctions::rfts('/system//build.prop', $this->_buildprop, 0, 4096, false); //fix some access issues
}
... | php | private function _get_buildprop()
{
if ($this->_buildprop === null) {
if (!CommonFunctions::rfts('/system/build.prop', $this->_buildprop, 0, 4096, false)) {
CommonFunctions::rfts('/system//build.prop', $this->_buildprop, 0, 4096, false); //fix some access issues
}
... | [
"private",
"function",
"_get_buildprop",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_buildprop",
"===",
"null",
")",
"{",
"if",
"(",
"!",
"CommonFunctions",
"::",
"rfts",
"(",
"'/system/build.prop'",
",",
"$",
"this",
"->",
"_buildprop",
",",
"0",
","... | reads the data from /system/build.prop file
@return string | [
"reads",
"the",
"data",
"from",
"/",
"system",
"/",
"build",
".",
"prop",
"file"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Android.inc.php#L41-L50 |
phpsysinfo/phpsysinfo | includes/os/class.Android.inc.php | Android._kernel | private function _kernel()
{
if (CommonFunctions::executeProgram('uname', '-r', $strBuf, false)) {
$result = $strBuf;
if (CommonFunctions::executeProgram('uname', '-v', $strBuf, PSI_DEBUG)) {
if (preg_match('/SMP/', $strBuf)) {
$result .= ' (SMP)';... | php | private function _kernel()
{
if (CommonFunctions::executeProgram('uname', '-r', $strBuf, false)) {
$result = $strBuf;
if (CommonFunctions::executeProgram('uname', '-v', $strBuf, PSI_DEBUG)) {
if (preg_match('/SMP/', $strBuf)) {
$result .= ' (SMP)';... | [
"private",
"function",
"_kernel",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'uname'",
",",
"'-r'",
",",
"$",
"strBuf",
",",
"false",
")",
")",
"{",
"$",
"result",
"=",
"$",
"strBuf",
";",
"if",
"(",
"CommonFunctions",
"... | Kernel Version
@return void | [
"Kernel",
"Version"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Android.inc.php#L57-L77 |
phpsysinfo/phpsysinfo | includes/os/class.Android.inc.php | Android._filesystems | private function _filesystems()
{
$notwas = true;
if (CommonFunctions::executeProgram('df', '2>/dev/null ', $df, PSI_DEBUG) && preg_match("/\s+[0-9\.]+[KMGT]\s+/", $df)) {
$df = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
if (CommonFunctions::executeProgram('mount', '',... | php | private function _filesystems()
{
$notwas = true;
if (CommonFunctions::executeProgram('df', '2>/dev/null ', $df, PSI_DEBUG) && preg_match("/\s+[0-9\.]+[KMGT]\s+/", $df)) {
$df = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
if (CommonFunctions::executeProgram('mount', '',... | [
"private",
"function",
"_filesystems",
"(",
")",
"{",
"$",
"notwas",
"=",
"true",
";",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'df'",
",",
"'2>/dev/null '",
",",
"$",
"df",
",",
"PSI_DEBUG",
")",
"&&",
"preg_match",
"(",
"\"/\\s+[0-9\\.]+... | filesystem information
@return void | [
"filesystem",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Android.inc.php#L94-L169 |
phpsysinfo/phpsysinfo | includes/os/class.Android.inc.php | Android._distro | protected function _distro()
{
$buf = "";
if (($lines = $this->_get_buildprop()) && preg_match('/^ro\.build\.version\.release=([^\n]+)/m', $lines, $ar_buf)) {
$buf = trim($ar_buf[1]);
}
if (is_null($buf) || ($buf == "")) {
$this->sys->setDistribution('Andr... | php | protected function _distro()
{
$buf = "";
if (($lines = $this->_get_buildprop()) && preg_match('/^ro\.build\.version\.release=([^\n]+)/m', $lines, $ar_buf)) {
$buf = trim($ar_buf[1]);
}
if (is_null($buf) || ($buf == "")) {
$this->sys->setDistribution('Andr... | [
"protected",
"function",
"_distro",
"(",
")",
"{",
"$",
"buf",
"=",
"\"\"",
";",
"if",
"(",
"(",
"$",
"lines",
"=",
"$",
"this",
"->",
"_get_buildprop",
"(",
")",
")",
"&&",
"preg_match",
"(",
"'/^ro\\.build\\.version\\.release=([^\\n]+)/m'",
",",
"$",
"li... | Distribution
@return void | [
"Distribution"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Android.inc.php#L176-L193 |
phpsysinfo/phpsysinfo | includes/os/class.Android.inc.php | Android._machine | private function _machine()
{
if ($lines = $this->_get_buildprop()) {
$buf = "";
if (preg_match('/^ro\.product\.manufacturer=([^\n]+)/m', $lines, $ar_buf) && (trim($ar_buf[1]) !== "unknown")) {
$buf .= ' '.trim($ar_buf[1]);
}
if (preg_match('/^... | php | private function _machine()
{
if ($lines = $this->_get_buildprop()) {
$buf = "";
if (preg_match('/^ro\.product\.manufacturer=([^\n]+)/m', $lines, $ar_buf) && (trim($ar_buf[1]) !== "unknown")) {
$buf .= ' '.trim($ar_buf[1]);
}
if (preg_match('/^... | [
"private",
"function",
"_machine",
"(",
")",
"{",
"if",
"(",
"$",
"lines",
"=",
"$",
"this",
"->",
"_get_buildprop",
"(",
")",
")",
"{",
"$",
"buf",
"=",
"\"\"",
";",
"if",
"(",
"preg_match",
"(",
"'/^ro\\.product\\.manufacturer=([^\\n]+)/m'",
",",
"$",
... | Machine
@return void | [
"Machine"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Android.inc.php#L200-L217 |
phpsysinfo/phpsysinfo | includes/os/class.Android.inc.php | Android._pci | private function _pci()
{
if (CommonFunctions::executeProgram('lspci', '', $bufr, false)) {
$bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
foreach ($bufe as $buf) {
$device = preg_split("/ /", $buf, 4);
if (isset($device[3]) && trim($devic... | php | private function _pci()
{
if (CommonFunctions::executeProgram('lspci', '', $bufr, false)) {
$bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
foreach ($bufe as $buf) {
$device = preg_split("/ /", $buf, 4);
if (isset($device[3]) && trim($devic... | [
"private",
"function",
"_pci",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'lspci'",
",",
"''",
",",
"$",
"bufr",
",",
"false",
")",
")",
"{",
"$",
"bufe",
"=",
"preg_split",
"(",
"\"/\\n/\"",
",",
"$",
"bufr",
",",
"-"... | PCI devices
@return void | [
"PCI",
"devices"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Android.inc.php#L224-L237 |
phpsysinfo/phpsysinfo | includes/output/class.WebpageXML.inc.php | WebpageXML._prepare | private function _prepare()
{
if ($this->_pluginName === null) {
// Figure out which OS we are running on, and detect support
if (!file_exists(PSI_APP_ROOT.'/includes/os/class.'.PSI_OS.'.inc.php')) {
$this->error->addError("file_exists(class.".PSI_OS.".inc.php)", PSI_... | php | private function _prepare()
{
if ($this->_pluginName === null) {
// Figure out which OS we are running on, and detect support
if (!file_exists(PSI_APP_ROOT.'/includes/os/class.'.PSI_OS.'.inc.php')) {
$this->error->addError("file_exists(class.".PSI_OS.".inc.php)", PSI_... | [
"private",
"function",
"_prepare",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_pluginName",
"===",
"null",
")",
"{",
"// Figure out which OS we are running on, and detect support",
"if",
"(",
"!",
"file_exists",
"(",
"PSI_APP_ROOT",
".",
"'/includes/os/class.'",
... | generate the output
@return void | [
"generate",
"the",
"output"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/output/class.WebpageXML.inc.php#L61-L131 |
phpsysinfo/phpsysinfo | includes/output/class.WebpageXML.inc.php | WebpageXML.getJsonString | public function getJsonString()
{
if (defined('PSI_JSON_ISSUE') && (PSI_JSON_ISSUE)) {
return json_encode(simplexml_load_string(str_replace(">", ">\n", $this->getXMLString()))); // solving json_encode issue
} else {
return json_encode(simplexml_load_string($this->getXMLString... | php | public function getJsonString()
{
if (defined('PSI_JSON_ISSUE') && (PSI_JSON_ISSUE)) {
return json_encode(simplexml_load_string(str_replace(">", ">\n", $this->getXMLString()))); // solving json_encode issue
} else {
return json_encode(simplexml_load_string($this->getXMLString... | [
"public",
"function",
"getJsonString",
"(",
")",
"{",
"if",
"(",
"defined",
"(",
"'PSI_JSON_ISSUE'",
")",
"&&",
"(",
"PSI_JSON_ISSUE",
")",
")",
"{",
"return",
"json_encode",
"(",
"simplexml_load_string",
"(",
"str_replace",
"(",
"\">\"",
",",
"\">\\n\"",
",",... | get json string
@return string | [
"get",
"json",
"string"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/output/class.WebpageXML.inc.php#L163-L170 |
phpsysinfo/phpsysinfo | includes/mb/class.mbmon.inc.php | MBMon._fans | private function _fans()
{
foreach ($this->_lines as $line) {
if (preg_match('/^(FAN\d*)\s*:\s*(.*)$/D', $line, $data)) {
if ($data[2] <> '0') {
$dev = new SensorDevice();
$dev->setName($data[1]);
$dev->setValue($data[2]... | php | private function _fans()
{
foreach ($this->_lines as $line) {
if (preg_match('/^(FAN\d*)\s*:\s*(.*)$/D', $line, $data)) {
if ($data[2] <> '0') {
$dev = new SensorDevice();
$dev->setName($data[1]);
$dev->setValue($data[2]... | [
"private",
"function",
"_fans",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_lines",
"as",
"$",
"line",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^(FAN\\d*)\\s*:\\s*(.*)$/D'",
",",
"$",
"line",
",",
"$",
"data",
")",
")",
"{",
"if",
"(",
"$",... | get fan information
@return void | [
"get",
"fan",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.mbmon.inc.php#L85-L98 |
phpsysinfo/phpsysinfo | includes/mb/class.mbmon.inc.php | MBMon._voltage | private function _voltage()
{
foreach ($this->_lines as $line) {
if (preg_match('/^(V.*)\s*:\s*(.*)$/D', $line, $data)) {
if ($data[2] <> '+0.00') {
$dev = new SensorDevice();
$dev->setName($data[1]);
$dev->setValue($dat... | php | private function _voltage()
{
foreach ($this->_lines as $line) {
if (preg_match('/^(V.*)\s*:\s*(.*)$/D', $line, $data)) {
if ($data[2] <> '+0.00') {
$dev = new SensorDevice();
$dev->setName($data[1]);
$dev->setValue($dat... | [
"private",
"function",
"_voltage",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_lines",
"as",
"$",
"line",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^(V.*)\\s*:\\s*(.*)$/D'",
",",
"$",
"line",
",",
"$",
"data",
")",
")",
"{",
"if",
"(",
"$",
... | get voltage information
@return void | [
"get",
"voltage",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.mbmon.inc.php#L105-L117 |
spatie/pdf-to-image | src/Pdf.php | Pdf.setOutputFormat | public function setOutputFormat($outputFormat)
{
if (! $this->isValidOutputFormat($outputFormat)) {
throw new InvalidFormat("Format {$outputFormat} is not supported");
}
$this->outputFormat = $outputFormat;
return $this;
} | php | public function setOutputFormat($outputFormat)
{
if (! $this->isValidOutputFormat($outputFormat)) {
throw new InvalidFormat("Format {$outputFormat} is not supported");
}
$this->outputFormat = $outputFormat;
return $this;
} | [
"public",
"function",
"setOutputFormat",
"(",
"$",
"outputFormat",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isValidOutputFormat",
"(",
"$",
"outputFormat",
")",
")",
"{",
"throw",
"new",
"InvalidFormat",
"(",
"\"Format {$outputFormat} is not supported\"",
")"... | Set the output format.
@param string $outputFormat
@return $this
@throws \Spatie\PdfToImage\Exceptions\InvalidFormat | [
"Set",
"the",
"output",
"format",
"."
] | train | https://github.com/spatie/pdf-to-image/blob/295ed2ddda5a503008b91333c57e3433831cf1a1/src/Pdf.php#L74-L83 |
spatie/pdf-to-image | src/Pdf.php | Pdf.setLayerMethod | public function setLayerMethod($layerMethod)
{
if (
is_int($layerMethod) === false &&
is_null($layerMethod) === false
) {
throw new InvalidLayerMethod('LayerMethod must be an integer or null');
}
$this->layerMethod = $layerMethod;
return ... | php | public function setLayerMethod($layerMethod)
{
if (
is_int($layerMethod) === false &&
is_null($layerMethod) === false
) {
throw new InvalidLayerMethod('LayerMethod must be an integer or null');
}
$this->layerMethod = $layerMethod;
return ... | [
"public",
"function",
"setLayerMethod",
"(",
"$",
"layerMethod",
")",
"{",
"if",
"(",
"is_int",
"(",
"$",
"layerMethod",
")",
"===",
"false",
"&&",
"is_null",
"(",
"$",
"layerMethod",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"InvalidLayerMethod",
"("... | Sets the layer method for Imagick::mergeImageLayers()
If int, should correspond to a predefined LAYERMETHOD constant.
If null, Imagick::mergeImageLayers() will not be called.
@param int|null
@return $this
@throws \Spatie\PdfToImage\Exceptions\InvalidLayerMethod
@see https://secure.php.net/manual/en/imagick.constant... | [
"Sets",
"the",
"layer",
"method",
"for",
"Imagick",
"::",
"mergeImageLayers",
"()",
"If",
"int",
"should",
"correspond",
"to",
"a",
"predefined",
"LAYERMETHOD",
"constant",
".",
"If",
"null",
"Imagick",
"::",
"mergeImageLayers",
"()",
"will",
"not",
"be",
"cal... | train | https://github.com/spatie/pdf-to-image/blob/295ed2ddda5a503008b91333c57e3433831cf1a1/src/Pdf.php#L109-L121 |
spatie/pdf-to-image | src/Pdf.php | Pdf.setPage | public function setPage($page)
{
if ($page > $this->getNumberOfPages() || $page < 1) {
throw new PageDoesNotExist("Page {$page} does not exist");
}
$this->page = $page;
return $this;
} | php | public function setPage($page)
{
if ($page > $this->getNumberOfPages() || $page < 1) {
throw new PageDoesNotExist("Page {$page} does not exist");
}
$this->page = $page;
return $this;
} | [
"public",
"function",
"setPage",
"(",
"$",
"page",
")",
"{",
"if",
"(",
"$",
"page",
">",
"$",
"this",
"->",
"getNumberOfPages",
"(",
")",
"||",
"$",
"page",
"<",
"1",
")",
"{",
"throw",
"new",
"PageDoesNotExist",
"(",
"\"Page {$page} does not exist\"",
... | Set the page number that should be rendered.
@param int $page
@return $this
@throws \Spatie\PdfToImage\Exceptions\PageDoesNotExist | [
"Set",
"the",
"page",
"number",
"that",
"should",
"be",
"rendered",
"."
] | train | https://github.com/spatie/pdf-to-image/blob/295ed2ddda5a503008b91333c57e3433831cf1a1/src/Pdf.php#L144-L153 |
spatie/pdf-to-image | src/Pdf.php | Pdf.saveImage | public function saveImage($pathToImage)
{
if (is_dir($pathToImage)) {
$pathToImage = rtrim($pathToImage, '\/').DIRECTORY_SEPARATOR.$this->page.'.'.$this->outputFormat;
}
$imageData = $this->getImageData($pathToImage);
return file_put_contents($pathToImage, $imageData) !... | php | public function saveImage($pathToImage)
{
if (is_dir($pathToImage)) {
$pathToImage = rtrim($pathToImage, '\/').DIRECTORY_SEPARATOR.$this->page.'.'.$this->outputFormat;
}
$imageData = $this->getImageData($pathToImage);
return file_put_contents($pathToImage, $imageData) !... | [
"public",
"function",
"saveImage",
"(",
"$",
"pathToImage",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"pathToImage",
")",
")",
"{",
"$",
"pathToImage",
"=",
"rtrim",
"(",
"$",
"pathToImage",
",",
"'\\/'",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"this",... | Save the image to the given path.
@param string $pathToImage
@return bool | [
"Save",
"the",
"image",
"to",
"the",
"given",
"path",
"."
] | train | https://github.com/spatie/pdf-to-image/blob/295ed2ddda5a503008b91333c57e3433831cf1a1/src/Pdf.php#L172-L181 |
spatie/pdf-to-image | src/Pdf.php | Pdf.saveAllPagesAsImages | public function saveAllPagesAsImages($directory, $prefix = '')
{
$numberOfPages = $this->getNumberOfPages();
if ($numberOfPages === 0) {
return [];
}
return array_map(function ($pageNumber) use ($directory, $prefix) {
$this->setPage($pageNumber);
... | php | public function saveAllPagesAsImages($directory, $prefix = '')
{
$numberOfPages = $this->getNumberOfPages();
if ($numberOfPages === 0) {
return [];
}
return array_map(function ($pageNumber) use ($directory, $prefix) {
$this->setPage($pageNumber);
... | [
"public",
"function",
"saveAllPagesAsImages",
"(",
"$",
"directory",
",",
"$",
"prefix",
"=",
"''",
")",
"{",
"$",
"numberOfPages",
"=",
"$",
"this",
"->",
"getNumberOfPages",
"(",
")",
";",
"if",
"(",
"$",
"numberOfPages",
"===",
"0",
")",
"{",
"return"... | Save the file as images to the given directory.
@param string $directory
@param string $prefix
@return array $files the paths to the created images | [
"Save",
"the",
"file",
"as",
"images",
"to",
"the",
"given",
"directory",
"."
] | train | https://github.com/spatie/pdf-to-image/blob/295ed2ddda5a503008b91333c57e3433831cf1a1/src/Pdf.php#L191-L208 |
spatie/pdf-to-image | src/Pdf.php | Pdf.getImageData | public function getImageData($pathToImage)
{
/*
* Reinitialize imagick because the target resolution must be set
* before reading the actual image.
*/
$this->imagick = new Imagick();
$this->imagick->setResolution($this->resolution, $this->resolution);
if ... | php | public function getImageData($pathToImage)
{
/*
* Reinitialize imagick because the target resolution must be set
* before reading the actual image.
*/
$this->imagick = new Imagick();
$this->imagick->setResolution($this->resolution, $this->resolution);
if ... | [
"public",
"function",
"getImageData",
"(",
"$",
"pathToImage",
")",
"{",
"/*\n * Reinitialize imagick because the target resolution must be set\n * before reading the actual image.\n */",
"$",
"this",
"->",
"imagick",
"=",
"new",
"Imagick",
"(",
")",
";",
... | Return raw image data.
@param string $pathToImage
@return \Imagick | [
"Return",
"raw",
"image",
"data",
"."
] | train | https://github.com/spatie/pdf-to-image/blob/295ed2ddda5a503008b91333c57e3433831cf1a1/src/Pdf.php#L217-L248 |
spatie/pdf-to-image | src/Pdf.php | Pdf.getRemoteImageData | protected function getRemoteImageData($pathToImage)
{
$this->imagick->readImage($this->pdfFile);
$this->imagick->setIteratorIndex($this->page - 1);
if (is_int($this->layerMethod)) {
$this->imagick = $this->imagick->mergeImageLayers($this->layerMethod);
}
$this-... | php | protected function getRemoteImageData($pathToImage)
{
$this->imagick->readImage($this->pdfFile);
$this->imagick->setIteratorIndex($this->page - 1);
if (is_int($this->layerMethod)) {
$this->imagick = $this->imagick->mergeImageLayers($this->layerMethod);
}
$this-... | [
"protected",
"function",
"getRemoteImageData",
"(",
"$",
"pathToImage",
")",
"{",
"$",
"this",
"->",
"imagick",
"->",
"readImage",
"(",
"$",
"this",
"->",
"pdfFile",
")",
";",
"$",
"this",
"->",
"imagick",
"->",
"setIteratorIndex",
"(",
"$",
"this",
"->",
... | Return remote raw image data.
@param string $pathToImage
@return \Imagick | [
"Return",
"remote",
"raw",
"image",
"data",
"."
] | train | https://github.com/spatie/pdf-to-image/blob/295ed2ddda5a503008b91333c57e3433831cf1a1/src/Pdf.php#L281-L294 |
spatie/pdf-to-image | src/Pdf.php | Pdf.determineOutputFormat | protected function determineOutputFormat($pathToImage)
{
$outputFormat = pathinfo($pathToImage, PATHINFO_EXTENSION);
if ($this->outputFormat != '') {
$outputFormat = $this->outputFormat;
}
$outputFormat = strtolower($outputFormat);
if (! $this->isValidOutputFor... | php | protected function determineOutputFormat($pathToImage)
{
$outputFormat = pathinfo($pathToImage, PATHINFO_EXTENSION);
if ($this->outputFormat != '') {
$outputFormat = $this->outputFormat;
}
$outputFormat = strtolower($outputFormat);
if (! $this->isValidOutputFor... | [
"protected",
"function",
"determineOutputFormat",
"(",
"$",
"pathToImage",
")",
"{",
"$",
"outputFormat",
"=",
"pathinfo",
"(",
"$",
"pathToImage",
",",
"PATHINFO_EXTENSION",
")",
";",
"if",
"(",
"$",
"this",
"->",
"outputFormat",
"!=",
"''",
")",
"{",
"$",
... | Determine in which format the image must be rendered.
@param $pathToImage
@return string | [
"Determine",
"in",
"which",
"format",
"the",
"image",
"must",
"be",
"rendered",
"."
] | train | https://github.com/spatie/pdf-to-image/blob/295ed2ddda5a503008b91333c57e3433831cf1a1/src/Pdf.php#L303-L318 |
spatie/schema-org | generator/Console/GenerateCommand.php | GenerateCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('Generating package code...');
$generator = new PackageGenerator();
$definitions = new Definitions([
'core' => 'https://raw.githubusercontent.com/schemaorg/schemaorg/master/data/schema... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('Generating package code...');
$generator = new PackageGenerator();
$definitions = new Definitions([
'core' => 'https://raw.githubusercontent.com/schemaorg/schemaorg/master/data/schema... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"output",
"->",
"writeln",
"(",
"'Generating package code...'",
")",
";",
"$",
"generator",
"=",
"new",
"PackageGenerator",
"(",
")",
... | @param \Symfony\Component\Console\Input\InputInterface $input
@param \Symfony\Component\Console\Output\OutputInterface $output
@return int | [
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"Console",
"\\",
"Input",
"\\",
"InputInterface",
"$input",
"@param",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"Console",
"\\",
"Output",
"\\",
"OutputInterface",
"$output"
] | train | https://github.com/spatie/schema-org/blob/a2d513f7a07a83c08538dbb3aa9210f10faa4020/generator/Console/GenerateCommand.php#L28-L47 |
cweiske/jsonmapper | src/JsonMapper.php | JsonMapper.map | public function map($json, $object)
{
if ($this->bEnforceMapType && !is_object($json)) {
throw new InvalidArgumentException(
'JsonMapper::map() requires first argument to be an object'
. ', ' . gettype($json) . ' given.'
);
}
if (!is_ob... | php | public function map($json, $object)
{
if ($this->bEnforceMapType && !is_object($json)) {
throw new InvalidArgumentException(
'JsonMapper::map() requires first argument to be an object'
. ', ' . gettype($json) . ' given.'
);
}
if (!is_ob... | [
"public",
"function",
"map",
"(",
"$",
"json",
",",
"$",
"object",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"bEnforceMapType",
"&&",
"!",
"is_object",
"(",
"$",
"json",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'JsonMapper::map() requ... | Map data all data in $json into the given $object instance.
@param object $json JSON object structure from json_decode()
@param object $object Object to map $json data into
@return object Mapped object is returned.
@see mapArray() | [
"Map",
"data",
"all",
"data",
"in",
"$json",
"into",
"the",
"given",
"$object",
"instance",
"."
] | train | https://github.com/cweiske/jsonmapper/blob/258e9c3595ac45646ce0c03613892a25e987427e/src/JsonMapper.php#L123-L295 |
cweiske/jsonmapper | src/JsonMapper.php | JsonMapper.getFullNamespace | protected function getFullNamespace($type, $strNs)
{
if ($type !== '' && $type{0} != '\\') {
//create a full qualified namespace
if ($strNs != '') {
$type = '\\' . $strNs . '\\' . $type;
}
}
return $type;
} | php | protected function getFullNamespace($type, $strNs)
{
if ($type !== '' && $type{0} != '\\') {
//create a full qualified namespace
if ($strNs != '') {
$type = '\\' . $strNs . '\\' . $type;
}
}
return $type;
} | [
"protected",
"function",
"getFullNamespace",
"(",
"$",
"type",
",",
"$",
"strNs",
")",
"{",
"if",
"(",
"$",
"type",
"!==",
"''",
"&&",
"$",
"type",
"{",
"0",
"}",
"!=",
"'\\\\'",
")",
"{",
"//create a full qualified namespace",
"if",
"(",
"$",
"strNs",
... | Convert a type name to a fully namespaced type name.
@param string $type Type name (simple type or class name)
@param string $strNs Base namespace that gets prepended to the type name
@return string Fully-qualified type name with namespace | [
"Convert",
"a",
"type",
"name",
"to",
"a",
"fully",
"namespaced",
"type",
"name",
"."
] | train | https://github.com/cweiske/jsonmapper/blob/258e9c3595ac45646ce0c03613892a25e987427e/src/JsonMapper.php#L305-L314 |
cweiske/jsonmapper | src/JsonMapper.php | JsonMapper.checkMissingData | protected function checkMissingData($providedProperties, ReflectionClass $rc)
{
foreach ($rc->getProperties() as $property) {
$rprop = $rc->getProperty($property->name);
$docblock = $rprop->getDocComment();
$annotations = $this->parseAnnotations($docblock);
if... | php | protected function checkMissingData($providedProperties, ReflectionClass $rc)
{
foreach ($rc->getProperties() as $property) {
$rprop = $rc->getProperty($property->name);
$docblock = $rprop->getDocComment();
$annotations = $this->parseAnnotations($docblock);
if... | [
"protected",
"function",
"checkMissingData",
"(",
"$",
"providedProperties",
",",
"ReflectionClass",
"$",
"rc",
")",
"{",
"foreach",
"(",
"$",
"rc",
"->",
"getProperties",
"(",
")",
"as",
"$",
"property",
")",
"{",
"$",
"rprop",
"=",
"$",
"rc",
"->",
"ge... | Check required properties exist in json
@param array $providedProperties array with json properties
@param object $rc Reflection class to check
@throws JsonMapper_Exception
@return void | [
"Check",
"required",
"properties",
"exist",
"in",
"json"
] | train | https://github.com/cweiske/jsonmapper/blob/258e9c3595ac45646ce0c03613892a25e987427e/src/JsonMapper.php#L326-L342 |
cweiske/jsonmapper | src/JsonMapper.php | JsonMapper.mapArray | public function mapArray($json, $array, $class = null, $parent_key = '')
{
foreach ($json as $key => $jvalue) {
if ($class === null) {
$array[$key] = $jvalue;
} else if ($this->isArrayOfType($class)) {
$array[$key] = $this->mapArray(
... | php | public function mapArray($json, $array, $class = null, $parent_key = '')
{
foreach ($json as $key => $jvalue) {
if ($class === null) {
$array[$key] = $jvalue;
} else if ($this->isArrayOfType($class)) {
$array[$key] = $this->mapArray(
... | [
"public",
"function",
"mapArray",
"(",
"$",
"json",
",",
"$",
"array",
",",
"$",
"class",
"=",
"null",
",",
"$",
"parent_key",
"=",
"''",
")",
"{",
"foreach",
"(",
"$",
"json",
"as",
"$",
"key",
"=>",
"$",
"jvalue",
")",
"{",
"if",
"(",
"$",
"c... | Map an array
@param array $json JSON array structure from json_decode()
@param mixed $array Array or ArrayObject that gets filled with
data from $json
@param string $class Class name for children objects.
All children will get mapped onto this type.
Supports class names and simple types
like "string"... | [
"Map",
"an",
"array"
] | train | https://github.com/cweiske/jsonmapper/blob/258e9c3595ac45646ce0c03613892a25e987427e/src/JsonMapper.php#L360-L405 |
cweiske/jsonmapper | src/JsonMapper.php | JsonMapper.inspectProperty | protected function inspectProperty(ReflectionClass $rc, $name)
{
//try setter method first
$setter = 'set' . $this->getCamelCaseName($name);
if ($rc->hasMethod($setter)) {
$rmeth = $rc->getMethod($setter);
if ($rmeth->isPublic() || $this->bIgnoreVisibility) {
... | php | protected function inspectProperty(ReflectionClass $rc, $name)
{
//try setter method first
$setter = 'set' . $this->getCamelCaseName($name);
if ($rc->hasMethod($setter)) {
$rmeth = $rc->getMethod($setter);
if ($rmeth->isPublic() || $this->bIgnoreVisibility) {
... | [
"protected",
"function",
"inspectProperty",
"(",
"ReflectionClass",
"$",
"rc",
",",
"$",
"name",
")",
"{",
"//try setter method first",
"$",
"setter",
"=",
"'set'",
".",
"$",
"this",
"->",
"getCamelCaseName",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"rc... | Try to find out if a property exists in a given class.
Checks property first, falls back to setter method.
@param object $rc Reflection class to check
@param string $name Property name
@return array First value: if the property exists
Second value: the accessor to use (
ReflectionMethod or ReflectionProperty, or nu... | [
"Try",
"to",
"find",
"out",
"if",
"a",
"property",
"exists",
"in",
"a",
"given",
"class",
".",
"Checks",
"property",
"first",
"falls",
"back",
"to",
"setter",
"method",
"."
] | train | https://github.com/cweiske/jsonmapper/blob/258e9c3595ac45646ce0c03613892a25e987427e/src/JsonMapper.php#L419-L501 |
cweiske/jsonmapper | src/JsonMapper.php | JsonMapper.getSafeName | protected function getSafeName($name)
{
if (strpos($name, '-') !== false) {
$name = $this->getCamelCaseName($name);
}
return $name;
} | php | protected function getSafeName($name)
{
if (strpos($name, '-') !== false) {
$name = $this->getCamelCaseName($name);
}
return $name;
} | [
"protected",
"function",
"getSafeName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"name",
",",
"'-'",
")",
"!==",
"false",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"getCamelCaseName",
"(",
"$",
"name",
")",
";",
"}",
"return"... | Since hyphens cannot be used in variables we have to uppercase them.
Technically you may use them, but they are awkward to access.
@param string $name Property name
@return string Name without hyphen | [
"Since",
"hyphens",
"cannot",
"be",
"used",
"in",
"variables",
"we",
"have",
"to",
"uppercase",
"them",
"."
] | train | https://github.com/cweiske/jsonmapper/blob/258e9c3595ac45646ce0c03613892a25e987427e/src/JsonMapper.php#L526-L533 |
cweiske/jsonmapper | src/JsonMapper.php | JsonMapper.setProperty | protected function setProperty(
$object, $accessor, $value
) {
if (!$accessor->isPublic() && $this->bIgnoreVisibility) {
$accessor->setAccessible(true);
}
if ($accessor instanceof ReflectionProperty) {
$accessor->setValue($object, $value);
} else {
... | php | protected function setProperty(
$object, $accessor, $value
) {
if (!$accessor->isPublic() && $this->bIgnoreVisibility) {
$accessor->setAccessible(true);
}
if ($accessor instanceof ReflectionProperty) {
$accessor->setValue($object, $value);
} else {
... | [
"protected",
"function",
"setProperty",
"(",
"$",
"object",
",",
"$",
"accessor",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"accessor",
"->",
"isPublic",
"(",
")",
"&&",
"$",
"this",
"->",
"bIgnoreVisibility",
")",
"{",
"$",
"accessor",
"->",
... | Set a property on a given object to a given value.
Checks if the setter or the property are public are made before
calling this method.
@param object $object Object to set property on
@param object $accessor ReflectionMethod or ReflectionProperty
@param mixed $value Value of property
@return void | [
"Set",
"a",
"property",
"on",
"a",
"given",
"object",
"to",
"a",
"given",
"value",
"."
] | train | https://github.com/cweiske/jsonmapper/blob/258e9c3595ac45646ce0c03613892a25e987427e/src/JsonMapper.php#L547-L559 |
cweiske/jsonmapper | src/JsonMapper.php | JsonMapper.createInstance | public function createInstance(
$class, $useParameter = false, $jvalue = null
) {
if (isset($this->classMap[$class])) {
if (is_callable($mapper = $this->classMap[$class])) {
$class = $mapper($class, $jvalue);
} else {
$class = $this->classMap[$... | php | public function createInstance(
$class, $useParameter = false, $jvalue = null
) {
if (isset($this->classMap[$class])) {
if (is_callable($mapper = $this->classMap[$class])) {
$class = $mapper($class, $jvalue);
} else {
$class = $this->classMap[$... | [
"public",
"function",
"createInstance",
"(",
"$",
"class",
",",
"$",
"useParameter",
"=",
"false",
",",
"$",
"jvalue",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"classMap",
"[",
"$",
"class",
"]",
")",
")",
"{",
"if",
"(",
... | Create a new object of the given type.
This method exists to be overwritten in child classes,
so you can do dependency injection or so.
@param string $class Class name to instantiate
@param boolean $useParameter Pass $parameter to the constructor or not
@param mixed $jvalue Constructor parameter (the ... | [
"Create",
"a",
"new",
"object",
"of",
"the",
"given",
"type",
"."
] | train | https://github.com/cweiske/jsonmapper/blob/258e9c3595ac45646ce0c03613892a25e987427e/src/JsonMapper.php#L573-L588 |
cweiske/jsonmapper | src/JsonMapper.php | JsonMapper.isSimpleType | protected function isSimpleType($type)
{
return $type == 'string'
|| $type == 'boolean' || $type == 'bool'
|| $type == 'integer' || $type == 'int'
|| $type == 'double' || $type == 'float'
|| $type == 'array' || $type == 'object';
} | php | protected function isSimpleType($type)
{
return $type == 'string'
|| $type == 'boolean' || $type == 'bool'
|| $type == 'integer' || $type == 'int'
|| $type == 'double' || $type == 'float'
|| $type == 'array' || $type == 'object';
} | [
"protected",
"function",
"isSimpleType",
"(",
"$",
"type",
")",
"{",
"return",
"$",
"type",
"==",
"'string'",
"||",
"$",
"type",
"==",
"'boolean'",
"||",
"$",
"type",
"==",
"'bool'",
"||",
"$",
"type",
"==",
"'integer'",
"||",
"$",
"type",
"==",
"'int'... | Checks if the given type is a "simple type"
@param string $type type name from gettype()
@return boolean True if it is a simple PHP type
@see isFlatType() | [
"Checks",
"if",
"the",
"given",
"type",
"is",
"a",
"simple",
"type"
] | train | https://github.com/cweiske/jsonmapper/blob/258e9c3595ac45646ce0c03613892a25e987427e/src/JsonMapper.php#L599-L606 |
cweiske/jsonmapper | src/JsonMapper.php | JsonMapper.isObjectOfSameType | protected function isObjectOfSameType($type, $value)
{
if (false === is_object($value)) {
return false;
}
return is_a($value, $type);
} | php | protected function isObjectOfSameType($type, $value)
{
if (false === is_object($value)) {
return false;
}
return is_a($value, $type);
} | [
"protected",
"function",
"isObjectOfSameType",
"(",
"$",
"type",
",",
"$",
"value",
")",
"{",
"if",
"(",
"false",
"===",
"is_object",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"is_a",
"(",
"$",
"value",
",",
"$",
"type"... | Checks if the object is of this type or has this type as one of its parents
@param string $type class name of type being required
@param mixed $value Some PHP value to be tested
@return boolean True if $object has type of $type | [
"Checks",
"if",
"the",
"object",
"is",
"of",
"this",
"type",
"or",
"has",
"this",
"type",
"as",
"one",
"of",
"its",
"parents"
] | train | https://github.com/cweiske/jsonmapper/blob/258e9c3595ac45646ce0c03613892a25e987427e/src/JsonMapper.php#L616-L623 |
cweiske/jsonmapper | src/JsonMapper.php | JsonMapper.isFlatType | protected function isFlatType($type)
{
return $type == 'NULL'
|| $type == 'string'
|| $type == 'boolean' || $type == 'bool'
|| $type == 'integer' || $type == 'int'
|| $type == 'double' || $type == 'float';
} | php | protected function isFlatType($type)
{
return $type == 'NULL'
|| $type == 'string'
|| $type == 'boolean' || $type == 'bool'
|| $type == 'integer' || $type == 'int'
|| $type == 'double' || $type == 'float';
} | [
"protected",
"function",
"isFlatType",
"(",
"$",
"type",
")",
"{",
"return",
"$",
"type",
"==",
"'NULL'",
"||",
"$",
"type",
"==",
"'string'",
"||",
"$",
"type",
"==",
"'boolean'",
"||",
"$",
"type",
"==",
"'bool'",
"||",
"$",
"type",
"==",
"'integer'"... | Checks if the given type is a type that is not nested
(simple type except array and object)
@param string $type type name from gettype()
@return boolean True if it is a non-nested PHP type
@see isSimpleType() | [
"Checks",
"if",
"the",
"given",
"type",
"is",
"a",
"type",
"that",
"is",
"not",
"nested",
"(",
"simple",
"type",
"except",
"array",
"and",
"object",
")"
] | train | https://github.com/cweiske/jsonmapper/blob/258e9c3595ac45646ce0c03613892a25e987427e/src/JsonMapper.php#L635-L642 |
cweiske/jsonmapper | src/JsonMapper.php | JsonMapper.parseAnnotations | protected static function parseAnnotations($docblock)
{
$annotations = array();
// Strip away the docblock header and footer
// to ease parsing of one line annotations
$docblock = substr($docblock, 3, -2);
$re = '/@(?P<name>[A-Za-z_-]+)(?:[ \t]+(?P<value>.*?))?[ \t]*\r?$/m';... | php | protected static function parseAnnotations($docblock)
{
$annotations = array();
// Strip away the docblock header and footer
// to ease parsing of one line annotations
$docblock = substr($docblock, 3, -2);
$re = '/@(?P<name>[A-Za-z_-]+)(?:[ \t]+(?P<value>.*?))?[ \t]*\r?$/m';... | [
"protected",
"static",
"function",
"parseAnnotations",
"(",
"$",
"docblock",
")",
"{",
"$",
"annotations",
"=",
"array",
"(",
")",
";",
"// Strip away the docblock header and footer",
"// to ease parsing of one line annotations",
"$",
"docblock",
"=",
"substr",
"(",
"$"... | Copied from PHPUnit 3.7.29, Util/Test.php
@param string $docblock Full method docblock
@return array | [
"Copied",
"from",
"PHPUnit",
"3",
".",
"7",
".",
"29",
"Util",
"/",
"Test",
".",
"php"
] | train | https://github.com/cweiske/jsonmapper/blob/258e9c3595ac45646ce0c03613892a25e987427e/src/JsonMapper.php#L694-L711 |
kriswallsmith/assetic | src/Assetic/Asset/BaseAsset.php | BaseAsset.doLoad | protected function doLoad($content, FilterInterface $additionalFilter = null)
{
$filter = clone $this->filters;
if ($additionalFilter) {
$filter->ensure($additionalFilter);
}
$asset = clone $this;
$asset->setContent($content);
$filter->filterLoad($asset)... | php | protected function doLoad($content, FilterInterface $additionalFilter = null)
{
$filter = clone $this->filters;
if ($additionalFilter) {
$filter->ensure($additionalFilter);
}
$asset = clone $this;
$asset->setContent($content);
$filter->filterLoad($asset)... | [
"protected",
"function",
"doLoad",
"(",
"$",
"content",
",",
"FilterInterface",
"$",
"additionalFilter",
"=",
"null",
")",
"{",
"$",
"filter",
"=",
"clone",
"$",
"this",
"->",
"filters",
";",
"if",
"(",
"$",
"additionalFilter",
")",
"{",
"$",
"filter",
"... | Encapsulates asset loading logic.
@param string $content The asset content
@param FilterInterface $additionalFilter An additional filter | [
"Encapsulates",
"asset",
"loading",
"logic",
"."
] | train | https://github.com/kriswallsmith/assetic/blob/e911c437dbdf006a8f62c2f59b15b2d69a5e0aa1/src/Assetic/Asset/BaseAsset.php#L84-L98 |
kriswallsmith/assetic | src/Assetic/Asset/AssetCache.php | AssetCache.getCacheKey | private static function getCacheKey(AssetInterface $asset, FilterInterface $additionalFilter = null, $salt = '')
{
if ($additionalFilter) {
$asset = clone $asset;
$asset->ensureFilter($additionalFilter);
}
$cacheKey = $asset->getSourceRoot();
$cacheKey .= $a... | php | private static function getCacheKey(AssetInterface $asset, FilterInterface $additionalFilter = null, $salt = '')
{
if ($additionalFilter) {
$asset = clone $asset;
$asset->ensureFilter($additionalFilter);
}
$cacheKey = $asset->getSourceRoot();
$cacheKey .= $a... | [
"private",
"static",
"function",
"getCacheKey",
"(",
"AssetInterface",
"$",
"asset",
",",
"FilterInterface",
"$",
"additionalFilter",
"=",
"null",
",",
"$",
"salt",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"additionalFilter",
")",
"{",
"$",
"asset",
"=",
"clon... | Returns a cache key for the current asset.
The key is composed of everything but an asset's content:
* source root
* source path
* target url
* last modified
* filters
@param AssetInterface $asset The asset
@param FilterInterface $additionalFilter Any additional filter being applied
@param string ... | [
"Returns",
"a",
"cache",
"key",
"for",
"the",
"current",
"asset",
"."
] | train | https://github.com/kriswallsmith/assetic/blob/e911c437dbdf006a8f62c2f59b15b2d69a5e0aa1/src/Assetic/Asset/AssetCache.php#L147-L173 |
kriswallsmith/assetic | src/Assetic/AssetManager.php | AssetManager.get | public function get($name)
{
if (!isset($this->assets[$name])) {
throw new \InvalidArgumentException(sprintf('There is no "%s" asset.', $name));
}
return $this->assets[$name];
} | php | public function get($name)
{
if (!isset($this->assets[$name])) {
throw new \InvalidArgumentException(sprintf('There is no "%s" asset.', $name));
}
return $this->assets[$name];
} | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"assets",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'There is no \"%s\" asset.'"... | Gets an asset by name.
@param string $name The asset name
@return AssetInterface The asset
@throws \InvalidArgumentException If there is no asset by that name | [
"Gets",
"an",
"asset",
"by",
"name",
"."
] | train | https://github.com/kriswallsmith/assetic/blob/e911c437dbdf006a8f62c2f59b15b2d69a5e0aa1/src/Assetic/AssetManager.php#L34-L41 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.