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 |
|---|---|---|---|---|---|---|---|---|---|---|
ramsey/uuid-doctrine | src/UuidBinaryOrderedTimeType.php | UuidBinaryOrderedTimeType.convertToPHPValue | public function convertToPHPValue($value, AbstractPlatform $platform)
{
if (empty($value)) {
return null;
}
if ($value instanceof UuidInterface) {
return $value;
}
try {
return $this->decode($value);
} catch (InvalidArgumentExcept... | php | public function convertToPHPValue($value, AbstractPlatform $platform)
{
if (empty($value)) {
return null;
}
if ($value instanceof UuidInterface) {
return $value;
}
try {
return $this->decode($value);
} catch (InvalidArgumentExcept... | [
"public",
"function",
"convertToPHPValue",
"(",
"$",
"value",
",",
"AbstractPlatform",
"$",
"platform",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"$",
"value",
"instanceof",
"UuidInterface",
")... | {@inheritdoc}
@param string|UuidInterface|null $value
@param \Doctrine\DBAL\Platforms\AbstractPlatform $platform | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/ramsey/uuid-doctrine/blob/b1c6b9a8cc6c93faf7ce45abc6988fb0dd8628de/src/UuidBinaryOrderedTimeType.php#L58-L73 |
ramsey/uuid-doctrine | src/UuidBinaryOrderedTimeType.php | UuidBinaryOrderedTimeType.convertToDatabaseValue | public function convertToDatabaseValue($value, AbstractPlatform $platform)
{
if (empty($value)) {
return null;
}
if ($value instanceof UuidInterface) {
return $this->encode($value);
}
try {
if (is_string($value) || method_exists($value, '... | php | public function convertToDatabaseValue($value, AbstractPlatform $platform)
{
if (empty($value)) {
return null;
}
if ($value instanceof UuidInterface) {
return $this->encode($value);
}
try {
if (is_string($value) || method_exists($value, '... | [
"public",
"function",
"convertToDatabaseValue",
"(",
"$",
"value",
",",
"AbstractPlatform",
"$",
"platform",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"$",
"value",
"instanceof",
"UuidInterface",... | {@inheritdoc}
@param UuidInterface|string|null $value
@param \Doctrine\DBAL\Platforms\AbstractPlatform $platform | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/ramsey/uuid-doctrine/blob/b1c6b9a8cc6c93faf7ce45abc6988fb0dd8628de/src/UuidBinaryOrderedTimeType.php#L81-L102 |
ramsey/uuid-doctrine | src/UuidBinaryOrderedTimeType.php | UuidBinaryOrderedTimeType.assertUuidV1 | private function assertUuidV1(UuidInterface $value)
{
if (1 !== $value->getVersion()) {
throw ConversionException::conversionFailed(
$value->toString(),
self::NAME
);
}
} | php | private function assertUuidV1(UuidInterface $value)
{
if (1 !== $value->getVersion()) {
throw ConversionException::conversionFailed(
$value->toString(),
self::NAME
);
}
} | [
"private",
"function",
"assertUuidV1",
"(",
"UuidInterface",
"$",
"value",
")",
"{",
"if",
"(",
"1",
"!==",
"$",
"value",
"->",
"getVersion",
"(",
")",
")",
"{",
"throw",
"ConversionException",
"::",
"conversionFailed",
"(",
"$",
"value",
"->",
"toString",
... | Using this type only makes sense with Uuid version 1 as this is the only
kind of UUID that can be time-ordered. Passing any other UUID into
this type is likely a mistake
@param UuidInterface $value
@throws ConversionException | [
"Using",
"this",
"type",
"only",
"makes",
"sense",
"with",
"Uuid",
"version",
"1",
"as",
"this",
"is",
"the",
"only",
"kind",
"of",
"UUID",
"that",
"can",
"be",
"time",
"-",
"ordered",
".",
"Passing",
"any",
"other",
"UUID",
"into",
"this",
"type",
"is... | train | https://github.com/ramsey/uuid-doctrine/blob/b1c6b9a8cc6c93faf7ce45abc6988fb0dd8628de/src/UuidBinaryOrderedTimeType.php#L159-L167 |
ramsey/uuid-doctrine | src/UuidType.php | UuidType.convertToDatabaseValue | public function convertToDatabaseValue($value, AbstractPlatform $platform)
{
if (empty($value)) {
return null;
}
if (
$value instanceof UuidInterface
|| (
(is_string($value) || method_exists($value, '__toString'))
&& Uuid::... | php | public function convertToDatabaseValue($value, AbstractPlatform $platform)
{
if (empty($value)) {
return null;
}
if (
$value instanceof UuidInterface
|| (
(is_string($value) || method_exists($value, '__toString'))
&& Uuid::... | [
"public",
"function",
"convertToDatabaseValue",
"(",
"$",
"value",
",",
"AbstractPlatform",
"$",
"platform",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"$",
"value",
"instanceof",
"UuidInterface",... | {@inheritdoc}
@param UuidInterface|string|null $value
@param \Doctrine\DBAL\Platforms\AbstractPlatform $platform | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/ramsey/uuid-doctrine/blob/b1c6b9a8cc6c93faf7ce45abc6988fb0dd8628de/src/UuidType.php#L78-L95 |
spatie/async | src/Runtime/ParentRuntime.php | ParentRuntime.createProcess | public static function createProcess($task): Runnable
{
if (! self::$isInitialised) {
self::init();
}
if (! Pool::isSupported()) {
return SynchronousProcess::create($task, self::getId());
}
$process = new Process(implode(' ', [
'exec php'... | php | public static function createProcess($task): Runnable
{
if (! self::$isInitialised) {
self::init();
}
if (! Pool::isSupported()) {
return SynchronousProcess::create($task, self::getId());
}
$process = new Process(implode(' ', [
'exec php'... | [
"public",
"static",
"function",
"createProcess",
"(",
"$",
"task",
")",
":",
"Runnable",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"isInitialised",
")",
"{",
"self",
"::",
"init",
"(",
")",
";",
"}",
"if",
"(",
"!",
"Pool",
"::",
"isSupported",
"(",
... | @param \Spatie\Async\Task|callable $task
@return \Spatie\Async\Process\Runnable | [
"@param",
"\\",
"Spatie",
"\\",
"Async",
"\\",
"Task|callable",
"$task"
] | train | https://github.com/spatie/async/blob/c454f7e0522f3a7766c2632cdd5e4fcf24f90e7a/src/Runtime/ParentRuntime.php#L56-L74 |
spatie/async | src/Runtime/ParentRuntime.php | ParentRuntime.encodeTask | public static function encodeTask($task): string
{
if ($task instanceof Closure) {
$task = new SerializableClosure($task);
}
return base64_encode(serialize($task));
} | php | public static function encodeTask($task): string
{
if ($task instanceof Closure) {
$task = new SerializableClosure($task);
}
return base64_encode(serialize($task));
} | [
"public",
"static",
"function",
"encodeTask",
"(",
"$",
"task",
")",
":",
"string",
"{",
"if",
"(",
"$",
"task",
"instanceof",
"Closure",
")",
"{",
"$",
"task",
"=",
"new",
"SerializableClosure",
"(",
"$",
"task",
")",
";",
"}",
"return",
"base64_encode"... | @param \Spatie\Async\Task|callable $task
@return string | [
"@param",
"\\",
"Spatie",
"\\",
"Async",
"\\",
"Task|callable",
"$task"
] | train | https://github.com/spatie/async/blob/c454f7e0522f3a7766c2632cdd5e4fcf24f90e7a/src/Runtime/ParentRuntime.php#L81-L88 |
spatie/async | src/Pool.php | Pool.add | public function add($process): Runnable
{
if (! is_callable($process) && ! $process instanceof Runnable) {
throw new InvalidArgumentException('The process passed to Pool::add should be callable.');
}
if (! $process instanceof Runnable) {
$process = ParentRuntime::cre... | php | public function add($process): Runnable
{
if (! is_callable($process) && ! $process instanceof Runnable) {
throw new InvalidArgumentException('The process passed to Pool::add should be callable.');
}
if (! $process instanceof Runnable) {
$process = ParentRuntime::cre... | [
"public",
"function",
"add",
"(",
"$",
"process",
")",
":",
"Runnable",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"process",
")",
"&&",
"!",
"$",
"process",
"instanceof",
"Runnable",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'The proc... | @param \Spatie\Async\Process\Runnable|callable $process
@return \Spatie\Async\Process\Runnable | [
"@param",
"\\",
"Spatie",
"\\",
"Async",
"\\",
"Process",
"\\",
"Runnable|callable",
"$process"
] | train | https://github.com/spatie/async/blob/c454f7e0522f3a7766c2632cdd5e4fcf24f90e7a/src/Pool.php#L111-L124 |
phpsysinfo/phpsysinfo | plugins/updatenotifier/class.updatenotifier.inc.php | UpdateNotifier.execute | public function execute()
{
if (empty($this->_filecontent)) {
return;
}
if (defined('PSI_PLUGIN_UPDATENOTIFIER_UBUNTU_LANDSCAPE_FORMAT') && (PSI_PLUGIN_UPDATENOTIFIER_UBUNTU_LANDSCAPE_FORMAT === true)) {
/*
Ubuntu Landscape format:
- line 1:... | php | public function execute()
{
if (empty($this->_filecontent)) {
return;
}
if (defined('PSI_PLUGIN_UPDATENOTIFIER_UBUNTU_LANDSCAPE_FORMAT') && (PSI_PLUGIN_UPDATENOTIFIER_UBUNTU_LANDSCAPE_FORMAT === true)) {
/*
Ubuntu Landscape format:
- line 1:... | [
"public",
"function",
"execute",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_filecontent",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"defined",
"(",
"'PSI_PLUGIN_UPDATENOTIFIER_UBUNTU_LANDSCAPE_FORMAT'",
")",
"&&",
"(",
"PSI_PLUGIN_UPDATEN... | 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/updatenotifier/class.updatenotifier.inc.php#L65-L97 |
phpsysinfo/phpsysinfo | plugins/updatenotifier/class.updatenotifier.inc.php | UpdateNotifier.xml | public function xml()
{
if (!empty($this->_result)) {
$xmluu = $this->xml->addChild("UpdateNotifier");
$xmluu->addChild("packages", $this->_result[0]);
$xmluu->addChild("security", $this->_result[1]);
}
return $this->xml->getSimpleXmlElement();
} | php | public function xml()
{
if (!empty($this->_result)) {
$xmluu = $this->xml->addChild("UpdateNotifier");
$xmluu->addChild("packages", $this->_result[0]);
$xmluu->addChild("security", $this->_result[1]);
}
return $this->xml->getSimpleXmlElement();
} | [
"public",
"function",
"xml",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"_result",
")",
")",
"{",
"$",
"xmluu",
"=",
"$",
"this",
"->",
"xml",
"->",
"addChild",
"(",
"\"UpdateNotifier\"",
")",
";",
"$",
"xmluu",
"->",
"addChild... | 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/updatenotifier/class.updatenotifier.inc.php#L104-L113 |
phpsysinfo/phpsysinfo | plugins/stablebit/class.stablebit.inc.php | StableBit.execute | public function execute()
{
if (PSI_OS == 'WINNT') {
try {
$objLocator = new COM('WbemScripting.SWbemLocator');
$wmi = $objLocator->ConnectServer('', 'root\StableBit\Scanner');
$this->_result = CommonFunctions::getWMI($wmi, 'Disks', $this->stablebi... | php | public function execute()
{
if (PSI_OS == 'WINNT') {
try {
$objLocator = new COM('WbemScripting.SWbemLocator');
$wmi = $objLocator->ConnectServer('', 'root\StableBit\Scanner');
$this->_result = CommonFunctions::getWMI($wmi, 'Disks', $this->stablebi... | [
"public",
"function",
"execute",
"(",
")",
"{",
"if",
"(",
"PSI_OS",
"==",
"'WINNT'",
")",
"{",
"try",
"{",
"$",
"objLocator",
"=",
"new",
"COM",
"(",
"'WbemScripting.SWbemLocator'",
")",
";",
"$",
"wmi",
"=",
"$",
"objLocator",
"->",
"ConnectServer",
"(... | 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/stablebit/class.stablebit.inc.php#L41-L51 |
phpsysinfo/phpsysinfo | plugins/stablebit/class.stablebit.inc.php | StableBit.xml | public function xml()
{
foreach ($this->_result as $disk_items) {
if (isset($disk_items['Name']) && (trim($disk_items['Name']) !== '')) {
$xmlstablebit_disk = $this->xml->addChild("Disk");
foreach ($this->stablebit_items as $item) {
if (isset($... | php | public function xml()
{
foreach ($this->_result as $disk_items) {
if (isset($disk_items['Name']) && (trim($disk_items['Name']) !== '')) {
$xmlstablebit_disk = $this->xml->addChild("Disk");
foreach ($this->stablebit_items as $item) {
if (isset($... | [
"public",
"function",
"xml",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_result",
"as",
"$",
"disk_items",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"disk_items",
"[",
"'Name'",
"]",
")",
"&&",
"(",
"trim",
"(",
"$",
"disk_items",
"[",
"'Name... | 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/stablebit/class.stablebit.inc.php#L58-L73 |
phpsysinfo/phpsysinfo | includes/ups/class.powersoftplus.inc.php | PowerSoftPlus._info | private function _info()
{
foreach ($this->_output as $ups) {
$dev = new UPSDevice();
// General info
$dev->setName("EVER");
$dev->setMode("PowerSoftPlus");
$maxpwr = 0;
$load = null;
if (preg_match('/^Identifier: UPS Mode... | php | private function _info()
{
foreach ($this->_output as $ups) {
$dev = new UPSDevice();
// General info
$dev->setName("EVER");
$dev->setMode("PowerSoftPlus");
$maxpwr = 0;
$load = null;
if (preg_match('/^Identifier: UPS Mode... | [
"private",
"function",
"_info",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_output",
"as",
"$",
"ups",
")",
"{",
"$",
"dev",
"=",
"new",
"UPSDevice",
"(",
")",
";",
"// General info",
"$",
"dev",
"->",
"setName",
"(",
"\"EVER\"",
")",
";",
... | 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.powersoftplus.inc.php#L52-L102 |
phpsysinfo/phpsysinfo | plugins/iptables/class.iptables.inc.php | iptables.getIptables | private function getIptables()
{
$result = array();
$i = 0;
foreach ($this->_lines as $line) {
$result[$i]['rule'] = $line;
$i++;
}
return $result;
} | php | private function getIptables()
{
$result = array();
$i = 0;
foreach ($this->_lines as $line) {
$result[$i]['rule'] = $line;
$i++;
}
return $result;
} | [
"private",
"function",
"getIptables",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"i",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"_lines",
"as",
"$",
"line",
")",
"{",
"$",
"result",
"[",
"$",
"i",
"]",
"[",
"'rule'"... | get iptables information
@return array iptables in array with label | [
"get",
"iptables",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/plugins/iptables/class.iptables.inc.php#L31-L42 |
phpsysinfo/phpsysinfo | includes/os/class.AIX.inc.php | AIX._kernel | private function _kernel()
{
if (CommonFunctions::executeProgram('oslevel', '', $ret1) && CommonFunctions::executeProgram('oslevel', '-s', $ret2)) {
$this->sys->setKernel($ret1 . ' (' . $ret2 . ')');
}
} | php | private function _kernel()
{
if (CommonFunctions::executeProgram('oslevel', '', $ret1) && CommonFunctions::executeProgram('oslevel', '-s', $ret2)) {
$this->sys->setKernel($ret1 . ' (' . $ret2 . ')');
}
} | [
"private",
"function",
"_kernel",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'oslevel'",
",",
"''",
",",
"$",
"ret1",
")",
"&&",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'oslevel'",
",",
"'-s'",
",",
"$",
"ret2",
")"... | IBM AIX Version
@return void | [
"IBM",
"AIX",
"Version"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.AIX.inc.php#L53-L58 |
phpsysinfo/phpsysinfo | includes/os/class.AIX.inc.php | AIX._uptime | private function _uptime()
{
if (CommonFunctions::executeProgram('uptime', '', $buf)) {
if (preg_match("/up (\d+) day[s]?,\s*(\d+):(\d+),/", $buf, $ar_buf)) {
$min = $ar_buf[3];
$hours = $ar_buf[2];
$days = $ar_buf[1];
$this->sys->s... | php | private function _uptime()
{
if (CommonFunctions::executeProgram('uptime', '', $buf)) {
if (preg_match("/up (\d+) day[s]?,\s*(\d+):(\d+),/", $buf, $ar_buf)) {
$min = $ar_buf[3];
$hours = $ar_buf[2];
$days = $ar_buf[1];
$this->sys->s... | [
"private",
"function",
"_uptime",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'uptime'",
",",
"''",
",",
"$",
"buf",
")",
")",
"{",
"if",
"(",
"preg_match",
"(",
"\"/up (\\d+) day[s]?,\\s*(\\d+):(\\d+),/\"",
",",
"$",
"buf",
",... | 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.AIX.inc.php#L65-L75 |
phpsysinfo/phpsysinfo | includes/os/class.AIX.inc.php | AIX._cpuinfo | private function _cpuinfo()
{
$ncpu = 0;
$tcpu = "";
$vcpu = "";
$ccpu = "";
$scpu = "";
foreach ($this->readaixdata() as $line) {
if (preg_match("/^Number Of Processors:\s+(\d+)/", $line, $ar_buf)) {
$ncpu = $ar_buf[1];
}
... | php | private function _cpuinfo()
{
$ncpu = 0;
$tcpu = "";
$vcpu = "";
$ccpu = "";
$scpu = "";
foreach ($this->readaixdata() as $line) {
if (preg_match("/^Number Of Processors:\s+(\d+)/", $line, $ar_buf)) {
$ncpu = $ar_buf[1];
}
... | [
"private",
"function",
"_cpuinfo",
"(",
")",
"{",
"$",
"ncpu",
"=",
"0",
";",
"$",
"tcpu",
"=",
"\"\"",
";",
"$",
"vcpu",
"=",
"\"\"",
";",
"$",
"ccpu",
"=",
"\"\"",
";",
"$",
"scpu",
"=",
"\"\"",
";",
"foreach",
"(",
"$",
"this",
"->",
"readai... | CPU information
All of the tags here are highly architecture dependant
@return void | [
"CPU",
"information",
"All",
"of",
"the",
"tags",
"here",
"are",
"highly",
"architecture",
"dependant"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.AIX.inc.php#L96-L133 |
phpsysinfo/phpsysinfo | includes/os/class.AIX.inc.php | AIX._pci | private function _pci()
{
foreach ($this->readaixdata() as $line) {
if (preg_match("/^[\*\+]\s\S+\s+\S+\s+(.*PCI.*)/", $line, $ar_buf)) {
$dev = new HWDevice();
$dev->setName(trim($ar_buf[1]));
$this->sys->setPciDevices($dev);
}
... | php | private function _pci()
{
foreach ($this->readaixdata() as $line) {
if (preg_match("/^[\*\+]\s\S+\s+\S+\s+(.*PCI.*)/", $line, $ar_buf)) {
$dev = new HWDevice();
$dev->setName(trim($ar_buf[1]));
$this->sys->setPciDevices($dev);
}
... | [
"private",
"function",
"_pci",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"readaixdata",
"(",
")",
"as",
"$",
"line",
")",
"{",
"if",
"(",
"preg_match",
"(",
"\"/^[\\*\\+]\\s\\S+\\s+\\S+\\s+(.*PCI.*)/\"",
",",
"$",
"line",
",",
"$",
"ar_buf",
")",
... | PCI devices
@return void | [
"PCI",
"devices"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.AIX.inc.php#L139-L148 |
phpsysinfo/phpsysinfo | includes/os/class.AIX.inc.php | AIX._ide | private function _ide()
{
foreach ($this->readaixdata() as $line) {
if (preg_match("/^[\*\+]\s\S+\s+\S+\s+(.*IDE.*)/", $line, $ar_buf)) {
$dev = new HWDevice();
$dev->setName(trim($ar_buf[1]));
$this->sys->setIdeDevices($dev);
}
... | php | private function _ide()
{
foreach ($this->readaixdata() as $line) {
if (preg_match("/^[\*\+]\s\S+\s+\S+\s+(.*IDE.*)/", $line, $ar_buf)) {
$dev = new HWDevice();
$dev->setName(trim($ar_buf[1]));
$this->sys->setIdeDevices($dev);
}
... | [
"private",
"function",
"_ide",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"readaixdata",
"(",
")",
"as",
"$",
"line",
")",
"{",
"if",
"(",
"preg_match",
"(",
"\"/^[\\*\\+]\\s\\S+\\s+\\S+\\s+(.*IDE.*)/\"",
",",
"$",
"line",
",",
"$",
"ar_buf",
")",
... | IDE devices
@return void | [
"IDE",
"devices"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.AIX.inc.php#L154-L163 |
phpsysinfo/phpsysinfo | includes/os/class.AIX.inc.php | AIX._scsi | private function _scsi()
{
foreach ($this->readaixdata() as $line) {
if (preg_match("/^[\*\+]\s\S+\s+\S+\s+(.*SCSI.*)/", $line, $ar_buf)) {
$dev = new HWDevice();
$dev->setName(trim($ar_buf[1]));
$this->sys->setScsiDevices($dev);
}
... | php | private function _scsi()
{
foreach ($this->readaixdata() as $line) {
if (preg_match("/^[\*\+]\s\S+\s+\S+\s+(.*SCSI.*)/", $line, $ar_buf)) {
$dev = new HWDevice();
$dev->setName(trim($ar_buf[1]));
$this->sys->setScsiDevices($dev);
}
... | [
"private",
"function",
"_scsi",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"readaixdata",
"(",
")",
"as",
"$",
"line",
")",
"{",
"if",
"(",
"preg_match",
"(",
"\"/^[\\*\\+]\\s\\S+\\s+\\S+\\s+(.*SCSI.*)/\"",
",",
"$",
"line",
",",
"$",
"ar_buf",
")",... | SCSI devices
@return void | [
"SCSI",
"devices"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.AIX.inc.php#L169-L178 |
phpsysinfo/phpsysinfo | includes/os/class.AIX.inc.php | AIX._usb | private function _usb()
{
foreach ($this->readaixdata() as $line) {
if (preg_match("/^[\*\+]\s\S+\s+\S+\s+(.*USB.*)/", $line, $ar_buf)) {
$dev = new HWDevice();
$dev->setName(trim($ar_buf[1]));
$this->sys->setUsbDevices($dev);
}
... | php | private function _usb()
{
foreach ($this->readaixdata() as $line) {
if (preg_match("/^[\*\+]\s\S+\s+\S+\s+(.*USB.*)/", $line, $ar_buf)) {
$dev = new HWDevice();
$dev->setName(trim($ar_buf[1]));
$this->sys->setUsbDevices($dev);
}
... | [
"private",
"function",
"_usb",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"readaixdata",
"(",
")",
"as",
"$",
"line",
")",
"{",
"if",
"(",
"preg_match",
"(",
"\"/^[\\*\\+]\\s\\S+\\s+\\S+\\s+(.*USB.*)/\"",
",",
"$",
"line",
",",
"$",
"ar_buf",
")",
... | USB devices
@return void | [
"USB",
"devices"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.AIX.inc.php#L184-L193 |
phpsysinfo/phpsysinfo | includes/os/class.AIX.inc.php | AIX._network | private function _network()
{
if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) {
$lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$ar_buf = preg_split("/\s+/", $line);
if (! empty(... | php | private function _network()
{
if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) {
$lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$ar_buf = preg_split("/\s+/", $line);
if (! empty(... | [
"private",
"function",
"_network",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'netstat'",
",",
"'-ni | tail -n +2'",
",",
"$",
"netstat",
")",
")",
"{",
"$",
"lines",
"=",
"preg_split",
"(",
"\"/\\n/\"",
",",
"$",
"netstat",
... | Network devices
includes also rx/tx bytes
@return void | [
"Network",
"devices",
"includes",
"also",
"rx",
"/",
"tx",
"bytes"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.AIX.inc.php#L200-L217 |
phpsysinfo/phpsysinfo | includes/os/class.AIX.inc.php | AIX._memory | private function _memory()
{
$mems = "";
$tswap = "";
$pswap = "";
foreach ($this->readaixdata() as $line) {
if (preg_match("/^Good Memory Size:\s+(\d+)\s+MB/", $line, $ar_buf)) {
$mems = $ar_buf[1];
}
if (preg_match("/^\s*Total Pag... | php | private function _memory()
{
$mems = "";
$tswap = "";
$pswap = "";
foreach ($this->readaixdata() as $line) {
if (preg_match("/^Good Memory Size:\s+(\d+)\s+MB/", $line, $ar_buf)) {
$mems = $ar_buf[1];
}
if (preg_match("/^\s*Total Pag... | [
"private",
"function",
"_memory",
"(",
")",
"{",
"$",
"mems",
"=",
"\"\"",
";",
"$",
"tswap",
"=",
"\"\"",
";",
"$",
"pswap",
"=",
"\"\"",
";",
"foreach",
"(",
"$",
"this",
"->",
"readaixdata",
"(",
")",
"as",
"$",
"line",
")",
"{",
"if",
"(",
... | 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.AIX.inc.php#L223-L267 |
phpsysinfo/phpsysinfo | includes/os/class.AIX.inc.php | AIX._filesystems | private function _filesystems()
{
if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
$mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {
$lines = preg_split("/\n/", $s, -1, P... | php | private function _filesystems()
{
if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
$mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {
$lines = preg_split("/\n/", $s, -1, P... | [
"private",
"function",
"_filesystems",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'df'",
",",
"'-kP'",
",",
"$",
"df",
",",
"PSI_DEBUG",
")",
")",
"{",
"$",
"mounts",
"=",
"preg_split",
"(",
"\"/\\n/\"",
",",
"$",
"df",
... | filesystem information
@return void | [
"filesystem",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.AIX.inc.php#L274-L299 |
phpsysinfo/phpsysinfo | includes/os/class.AIX.inc.php | AIX.readaixdata | private function readaixdata()
{
if (count($this->_aixdata) === 0) {
if (CommonFunctions::executeProgram('prtconf', '', $bufr)) {
$this->_aixdata = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
}
}
return $this->_aixdata;
} | php | private function readaixdata()
{
if (count($this->_aixdata) === 0) {
if (CommonFunctions::executeProgram('prtconf', '', $bufr)) {
$this->_aixdata = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
}
}
return $this->_aixdata;
} | [
"private",
"function",
"readaixdata",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"_aixdata",
")",
"===",
"0",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'prtconf'",
",",
"''",
",",
"$",
"bufr",
")",
")",
"{"... | IBM AIX informations by K.PAZ
@return array | [
"IBM",
"AIX",
"informations",
"by",
"K",
".",
"PAZ"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.AIX.inc.php#L316-L325 |
phpsysinfo/phpsysinfo | includes/mb/class.ipmiutil.inc.php | IPMIutil._temperature | private function _temperature()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if (isset($buffer[2]) && $buffer[2] == "Temperature"
&& $buffer[1] == "Full"
&& isset($buffer[6]) && preg_match("/^(\S+)\sC$/", $buffer[6], $v... | php | private function _temperature()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if (isset($buffer[2]) && $buffer[2] == "Temperature"
&& $buffer[1] == "Full"
&& isset($buffer[6]) && preg_match("/^(\S+)\sC$/", $buffer[6], $v... | [
"private",
"function",
"_temperature",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_lines",
"as",
"$",
"line",
")",
"{",
"$",
"buffer",
"=",
"preg_split",
"(",
"\"/\\s*\\|\\s*/\"",
",",
"$",
"line",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"buf... | get temperature information
@return void | [
"get",
"temperature",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.ipmiutil.inc.php#L51-L74 |
phpsysinfo/phpsysinfo | includes/mb/class.ipmiutil.inc.php | IPMIutil._voltage | private function _voltage()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if (isset($buffer[2]) && $buffer[2] == "Voltage"
&& $buffer[1] == "Full"
&& isset($buffer[6]) && preg_match("/^(\S+)\sV$/", $buffer[6], $value)
... | php | private function _voltage()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if (isset($buffer[2]) && $buffer[2] == "Voltage"
&& $buffer[1] == "Full"
&& isset($buffer[6]) && preg_match("/^(\S+)\sV$/", $buffer[6], $value)
... | [
"private",
"function",
"_voltage",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_lines",
"as",
"$",
"line",
")",
"{",
"$",
"buffer",
"=",
"preg_split",
"(",
"\"/\\s*\\|\\s*/\"",
",",
"$",
"line",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"buffer"... | get voltage information
@return void | [
"get",
"voltage",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.ipmiutil.inc.php#L81-L110 |
phpsysinfo/phpsysinfo | includes/mb/class.ipmiutil.inc.php | IPMIutil._fans | private function _fans()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if (isset($buffer[2]) && $buffer[2] == "Fan"
&& $buffer[1] == "Full"
&& isset($buffer[6]) && preg_match("/^(\S+)\sRPM$/", $buffer[6], $value)
... | php | private function _fans()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if (isset($buffer[2]) && $buffer[2] == "Fan"
&& $buffer[1] == "Full"
&& isset($buffer[6]) && preg_match("/^(\S+)\sRPM$/", $buffer[6], $value)
... | [
"private",
"function",
"_fans",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_lines",
"as",
"$",
"line",
")",
"{",
"$",
"buffer",
"=",
"preg_split",
"(",
"\"/\\s*\\|\\s*/\"",
",",
"$",
"line",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"buffer",
... | get fan information
@return void | [
"get",
"fan",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.ipmiutil.inc.php#L117-L147 |
phpsysinfo/phpsysinfo | includes/mb/class.ipmiutil.inc.php | IPMIutil._other | private function _other()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if (isset($buffer[1]) && $buffer[1] == "Compact"
&& $buffer[5] !== "Init"
&& $buffer[5] !== "Unknown"
&& $buffer[5] !== "NotAvailable... | php | private function _other()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if (isset($buffer[1]) && $buffer[1] == "Compact"
&& $buffer[5] !== "Init"
&& $buffer[5] !== "Unknown"
&& $buffer[5] !== "NotAvailable... | [
"private",
"function",
"_other",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_lines",
"as",
"$",
"line",
")",
"{",
"$",
"buffer",
"=",
"preg_split",
"(",
"\"/\\s*\\|\\s*/\"",
",",
"$",
"line",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"buffer",
... | get other information
@return void | [
"get",
"other",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.ipmiutil.inc.php#L220-L247 |
phpsysinfo/phpsysinfo | includes/mb/class.ipmiutil.inc.php | IPMIutil.build | public function build()
{
$this->_temperature();
$this->_voltage();
$this->_fans();
$this->_power();
$this->_current();
$this->_other();
} | php | public function build()
{
$this->_temperature();
$this->_voltage();
$this->_fans();
$this->_power();
$this->_current();
$this->_other();
} | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"this",
"->",
"_temperature",
"(",
")",
";",
"$",
"this",
"->",
"_voltage",
"(",
")",
";",
"$",
"this",
"->",
"_fans",
"(",
")",
";",
"$",
"this",
"->",
"_power",
"(",
")",
";",
"$",
"this",
"-... | get the information
@see PSI_Interface_Sensor::build()
@return Void | [
"get",
"the",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.ipmiutil.inc.php#L256-L264 |
phpsysinfo/phpsysinfo | includes/mb/class.speedfan.inc.php | SpeedFan._temperature | private function _temperature()
{
if (isset($this->_filecontent["temp"]) && (trim($this->_filecontent["temp"]) !== "")) {
$values = preg_split("/ /", trim($this->_filecontent["temp"]));
foreach ($values as $id=>$value) {
$dev = new SensorDevice();
$dev... | php | private function _temperature()
{
if (isset($this->_filecontent["temp"]) && (trim($this->_filecontent["temp"]) !== "")) {
$values = preg_split("/ /", trim($this->_filecontent["temp"]));
foreach ($values as $id=>$value) {
$dev = new SensorDevice();
$dev... | [
"private",
"function",
"_temperature",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_filecontent",
"[",
"\"temp\"",
"]",
")",
"&&",
"(",
"trim",
"(",
"$",
"this",
"->",
"_filecontent",
"[",
"\"temp\"",
"]",
")",
"!==",
"\"\"",
")",
")"... | get temperature information
@return void | [
"get",
"temperature",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.speedfan.inc.php#L64-L75 |
phpsysinfo/phpsysinfo | includes/mb/class.speedfan.inc.php | SpeedFan._fans | private function _fans()
{
if (isset($this->_filecontent["fans"]) && (trim($this->_filecontent["fans"]) !== "")) {
$values = preg_split("/ /", trim($this->_filecontent["fans"]));
foreach ($values as $id=>$value) {
$dev = new SensorDevice();
$dev->setNa... | php | private function _fans()
{
if (isset($this->_filecontent["fans"]) && (trim($this->_filecontent["fans"]) !== "")) {
$values = preg_split("/ /", trim($this->_filecontent["fans"]));
foreach ($values as $id=>$value) {
$dev = new SensorDevice();
$dev->setNa... | [
"private",
"function",
"_fans",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_filecontent",
"[",
"\"fans\"",
"]",
")",
"&&",
"(",
"trim",
"(",
"$",
"this",
"->",
"_filecontent",
"[",
"\"fans\"",
"]",
")",
"!==",
"\"\"",
")",
")",
"{"... | get fan information
@return void | [
"get",
"fan",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.speedfan.inc.php#L82-L93 |
phpsysinfo/phpsysinfo | includes/mb/class.speedfan.inc.php | SpeedFan._voltage | private function _voltage()
{
if (isset($this->_filecontent["volt"]) && (trim($this->_filecontent["volt"]) !== "")) {
$values = preg_split("/ /", trim($this->_filecontent["volt"]));
foreach ($values as $id=>$value) {
$dev = new SensorDevice();
$dev->se... | php | private function _voltage()
{
if (isset($this->_filecontent["volt"]) && (trim($this->_filecontent["volt"]) !== "")) {
$values = preg_split("/ /", trim($this->_filecontent["volt"]));
foreach ($values as $id=>$value) {
$dev = new SensorDevice();
$dev->se... | [
"private",
"function",
"_voltage",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_filecontent",
"[",
"\"volt\"",
"]",
")",
"&&",
"(",
"trim",
"(",
"$",
"this",
"->",
"_filecontent",
"[",
"\"volt\"",
"]",
")",
"!==",
"\"\"",
")",
")",
... | get voltage information
@return void | [
"get",
"voltage",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.speedfan.inc.php#L100-L111 |
phpsysinfo/phpsysinfo | includes/mb/class.hwmon.inc.php | Hwmon._temperature | protected function _temperature($hwpath)
{
$sensor = glob($hwpath."temp*_input", GLOB_NOSORT);
if (is_array($sensor) && (($total = count($sensor)) > 0)) {
$buf = "";
for ($i = 0; $i < $total; $i++) if (($buf = CommonFunctions::rolv($sensor[$i]))!==null) {
$dev =... | php | protected function _temperature($hwpath)
{
$sensor = glob($hwpath."temp*_input", GLOB_NOSORT);
if (is_array($sensor) && (($total = count($sensor)) > 0)) {
$buf = "";
for ($i = 0; $i < $total; $i++) if (($buf = CommonFunctions::rolv($sensor[$i]))!==null) {
$dev =... | [
"protected",
"function",
"_temperature",
"(",
"$",
"hwpath",
")",
"{",
"$",
"sensor",
"=",
"glob",
"(",
"$",
"hwpath",
".",
"\"temp*_input\"",
",",
"GLOB_NOSORT",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"sensor",
")",
"&&",
"(",
"(",
"$",
"total",
... | get temperature information
@param string $hwpath
@return void | [
"get",
"temperature",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.hwmon.inc.php#L23-L57 |
phpsysinfo/phpsysinfo | includes/mb/class.hwmon.inc.php | Hwmon.build | public function build()
{
$hwpaths = glob("/sys/class/hwmon/hwmon*/", GLOB_NOSORT);
if (is_array($hwpaths) && (count($hwpaths) > 0)) {
$hwpaths = array_merge($hwpaths, glob("/sys/class/hwmon/hwmon*/device/", GLOB_NOSORT));
}
if (is_array($hwpaths) && (($totalh = count($hw... | php | public function build()
{
$hwpaths = glob("/sys/class/hwmon/hwmon*/", GLOB_NOSORT);
if (is_array($hwpaths) && (count($hwpaths) > 0)) {
$hwpaths = array_merge($hwpaths, glob("/sys/class/hwmon/hwmon*/device/", GLOB_NOSORT));
}
if (is_array($hwpaths) && (($totalh = count($hw... | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"hwpaths",
"=",
"glob",
"(",
"\"/sys/class/hwmon/hwmon*/\"",
",",
"GLOB_NOSORT",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"hwpaths",
")",
"&&",
"(",
"count",
"(",
"$",
"hwpaths",
")",
">",
"0",
")",
... | get the information
@see PSI_Interface_Sensor::build()
@return Void | [
"get",
"the",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.hwmon.inc.php#L240-L255 |
phpsysinfo/phpsysinfo | includes/mb/class.k8temp.inc.php | K8Temp._temperature | private function _temperature()
{
foreach ($this->_lines as $line) {
if (preg_match('/(.*):\s*(\d*)/', $line, $data)) {
if ($data[2] > 0) {
$dev = new SensorDevice();
$dev->setName($data[1]);
// $dev->setMax('70.0');
... | php | private function _temperature()
{
foreach ($this->_lines as $line) {
if (preg_match('/(.*):\s*(\d*)/', $line, $data)) {
if ($data[2] > 0) {
$dev = new SensorDevice();
$dev->setName($data[1]);
// $dev->setMax('70.0');
... | [
"private",
"function",
"_temperature",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_lines",
"as",
"$",
"line",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/(.*):\\s*(\\d*)/'",
",",
"$",
"line",
",",
"$",
"data",
")",
")",
"{",
"if",
"(",
"$",
... | get temperature information
@return void | [
"get",
"temperature",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.k8temp.inc.php#L52-L67 |
phpsysinfo/phpsysinfo | plugins/docker/class.docker.inc.php | Docker.getDocker | private function getDocker()
{
$result = array();
$i = 0;
foreach ($this->_lines as $line) {
if ($i > 0) {
$buffer = preg_split("/\s\s+/", $line);
$result[$i]['Name'] = $buffer[0];
$result[$i]['CPUUsage'] = str_replace(',', '.',tri... | php | private function getDocker()
{
$result = array();
$i = 0;
foreach ($this->_lines as $line) {
if ($i > 0) {
$buffer = preg_split("/\s\s+/", $line);
$result[$i]['Name'] = $buffer[0];
$result[$i]['CPUUsage'] = str_replace(',', '.',tri... | [
"private",
"function",
"getDocker",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"i",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"_lines",
"as",
"$",
"line",
")",
"{",
"if",
"(",
"$",
"i",
">",
"0",
")",
"{",
"$",
... | get docker information
@return array docker in array with label | [
"get",
"docker",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/plugins/docker/class.docker.inc.php#L31-L91 |
phpsysinfo/phpsysinfo | includes/os/class.Darwin.inc.php | Darwin.grabkey | protected function grabkey($key)
{
if (CommonFunctions::executeProgram('sysctl', $key, $s, PSI_DEBUG)) {
$s = preg_replace('/'.$key.': /', '', $s);
$s = preg_replace('/'.$key.' = /', '', $s);
return $s;
} else {
return '';
}
} | php | protected function grabkey($key)
{
if (CommonFunctions::executeProgram('sysctl', $key, $s, PSI_DEBUG)) {
$s = preg_replace('/'.$key.': /', '', $s);
$s = preg_replace('/'.$key.' = /', '', $s);
return $s;
} else {
return '';
}
} | [
"protected",
"function",
"grabkey",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'sysctl'",
",",
"$",
"key",
",",
"$",
"s",
",",
"PSI_DEBUG",
")",
")",
"{",
"$",
"s",
"=",
"preg_replace",
"(",
"'/'",
".",
"$"... | get a value from sysctl command
@param string $key key of the value to get
@return string | [
"get",
"a",
"value",
"from",
"sysctl",
"command"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Darwin.inc.php#L49-L59 |
phpsysinfo/phpsysinfo | includes/os/class.Darwin.inc.php | Darwin._grabioreg | private function _grabioreg($key)
{
if (CommonFunctions::executeProgram('ioreg', '-c "'.$key.'"', $s, PSI_DEBUG)) {
/* delete newlines */
$s = preg_replace("/\s+/", " ", $s);
/* new newlines */
$s = preg_replace("/[\|\t ]*\+\-o/", "\n", $s);
/* com... | php | private function _grabioreg($key)
{
if (CommonFunctions::executeProgram('ioreg', '-c "'.$key.'"', $s, PSI_DEBUG)) {
/* delete newlines */
$s = preg_replace("/\s+/", " ", $s);
/* new newlines */
$s = preg_replace("/[\|\t ]*\+\-o/", "\n", $s);
/* com... | [
"private",
"function",
"_grabioreg",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'ioreg'",
",",
"'-c \"'",
".",
"$",
"key",
".",
"'\"'",
",",
"$",
"s",
",",
"PSI_DEBUG",
")",
")",
"{",
"/* delete newlines */",
"... | get a value from ioreg command
@param string $key key of the value to get
@return string | [
"get",
"a",
"value",
"from",
"ioreg",
"command"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Darwin.inc.php#L68-L90 |
phpsysinfo/phpsysinfo | includes/os/class.Darwin.inc.php | Darwin._uptime | private function _uptime()
{
if (CommonFunctions::executeProgram('sysctl', '-n kern.boottime', $a, PSI_DEBUG)) {
$tmp = explode(" ", $a);
if ($tmp[0]=="{") { /* kern.boottime= { sec = 1096732600, usec = 885425 } Sat Oct 2 10:56:40 2004 */
$data = trim($tmp[3], ",");
... | php | private function _uptime()
{
if (CommonFunctions::executeProgram('sysctl', '-n kern.boottime', $a, PSI_DEBUG)) {
$tmp = explode(" ", $a);
if ($tmp[0]=="{") { /* kern.boottime= { sec = 1096732600, usec = 885425 } Sat Oct 2 10:56:40 2004 */
$data = trim($tmp[3], ",");
... | [
"private",
"function",
"_uptime",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'sysctl'",
",",
"'-n kern.boottime'",
",",
"$",
"a",
",",
"PSI_DEBUG",
")",
")",
"{",
"$",
"tmp",
"=",
"explode",
"(",
"\" \"",
",",
"$",
"a",
... | 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.Darwin.inc.php#L98-L109 |
phpsysinfo/phpsysinfo | includes/os/class.Darwin.inc.php | Darwin.cpuinfo | protected function cpuinfo()
{
$dev = new CpuDevice();
if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor type"', $buf, PSI_DEBUG)) {
$dev->setModel(preg_replace('/Processor type: /', '', $buf));
$buf=$this->grabkey('hw.model');
if (!is_null($buf) ... | php | protected function cpuinfo()
{
$dev = new CpuDevice();
if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor type"', $buf, PSI_DEBUG)) {
$dev->setModel(preg_replace('/Processor type: /', '', $buf));
$buf=$this->grabkey('hw.model');
if (!is_null($buf) ... | [
"protected",
"function",
"cpuinfo",
"(",
")",
"{",
"$",
"dev",
"=",
"new",
"CpuDevice",
"(",
")",
";",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'hostinfo'",
",",
"'| grep \"Processor type\"'",
",",
"$",
"buf",
",",
"PSI_DEBUG",
")",
")",
... | get CPU information
@return void | [
"get",
"CPU",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Darwin.inc.php#L116-L168 |
phpsysinfo/phpsysinfo | includes/os/class.Darwin.inc.php | Darwin.pci | protected function pci()
{
if (!$arrResults = Parser::lspci(false)) { //no lspci port
$s = $this->_grabioreg('IOPCIDevice');
$lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$dev = new HWDevice();
if (!p... | php | protected function pci()
{
if (!$arrResults = Parser::lspci(false)) { //no lspci port
$s = $this->_grabioreg('IOPCIDevice');
$lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$dev = new HWDevice();
if (!p... | [
"protected",
"function",
"pci",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"arrResults",
"=",
"Parser",
"::",
"lspci",
"(",
"false",
")",
")",
"{",
"//no lspci port",
"$",
"s",
"=",
"$",
"this",
"->",
"_grabioreg",
"(",
"'IOPCIDevice'",
")",
";",
"$",
"line... | get the pci device information out of ioreg
@return void | [
"get",
"the",
"pci",
"device",
"information",
"out",
"of",
"ioreg"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Darwin.inc.php#L175-L197 |
phpsysinfo/phpsysinfo | includes/os/class.Darwin.inc.php | Darwin.ide | protected function ide()
{
$s = $this->_grabioreg('IOATABlockStorageDevice');
$lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$dev = new HWDevice();
if (!preg_match('/"Product Name"="([^"]*)"/', $line, $ar_buf))
... | php | protected function ide()
{
$s = $this->_grabioreg('IOATABlockStorageDevice');
$lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$dev = new HWDevice();
if (!preg_match('/"Product Name"="([^"]*)"/', $line, $ar_buf))
... | [
"protected",
"function",
"ide",
"(",
")",
"{",
"$",
"s",
"=",
"$",
"this",
"->",
"_grabioreg",
"(",
"'IOATABlockStorageDevice'",
")",
";",
"$",
"lines",
"=",
"preg_split",
"(",
"\"/\\n/\"",
",",
"$",
"s",
",",
"-",
"1",
",",
"PREG_SPLIT_NO_EMPTY",
")",
... | get the ide device information out of ioreg
@return void | [
"get",
"the",
"ide",
"device",
"information",
"out",
"of",
"ioreg"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Darwin.inc.php#L204-L225 |
phpsysinfo/phpsysinfo | includes/os/class.Darwin.inc.php | Darwin.usb | protected function usb()
{
$s = $this->_grabioreg('IOUSBDevice');
$lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$dev = new HWDevice();
if (!preg_match('/"USB Product Name" = "([^"]*)"/', $line, $ar_buf))
... | php | protected function usb()
{
$s = $this->_grabioreg('IOUSBDevice');
$lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$dev = new HWDevice();
if (!preg_match('/"USB Product Name" = "([^"]*)"/', $line, $ar_buf))
... | [
"protected",
"function",
"usb",
"(",
")",
"{",
"$",
"s",
"=",
"$",
"this",
"->",
"_grabioreg",
"(",
"'IOUSBDevice'",
")",
";",
"$",
"lines",
"=",
"preg_split",
"(",
"\"/\\n/\"",
",",
"$",
"s",
",",
"-",
"1",
",",
"PREG_SPLIT_NO_EMPTY",
")",
";",
"for... | get the usb device information out of ioreg
@return void | [
"get",
"the",
"usb",
"device",
"information",
"out",
"of",
"ioreg"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Darwin.inc.php#L232-L255 |
phpsysinfo/phpsysinfo | includes/os/class.Darwin.inc.php | Darwin.scsi | protected function scsi()
{
$s = $this->_grabioreg('IOBlockStorageServices');
$lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$dev = new HWDevice();
if (!preg_match('/"Product Name"="([^"]*)"/', $line, $ar_buf))
... | php | protected function scsi()
{
$s = $this->_grabioreg('IOBlockStorageServices');
$lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$dev = new HWDevice();
if (!preg_match('/"Product Name"="([^"]*)"/', $line, $ar_buf))
... | [
"protected",
"function",
"scsi",
"(",
")",
"{",
"$",
"s",
"=",
"$",
"this",
"->",
"_grabioreg",
"(",
"'IOBlockStorageServices'",
")",
";",
"$",
"lines",
"=",
"preg_split",
"(",
"\"/\\n/\"",
",",
"$",
"s",
",",
"-",
"1",
",",
"PREG_SPLIT_NO_EMPTY",
")",
... | get the scsi device information out of ioreg
@return void | [
"get",
"the",
"scsi",
"device",
"information",
"out",
"of",
"ioreg"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Darwin.inc.php#L262-L273 |
phpsysinfo/phpsysinfo | includes/os/class.Darwin.inc.php | Darwin.memory | protected function memory()
{
$s = $this->grabkey('hw.memsize');
if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
// calculate free memory from page sizes (each page = 4096)
if (preg_match('/^Pages free:\s+(\S+)/m', $pstat, $free_buf)) {
... | php | protected function memory()
{
$s = $this->grabkey('hw.memsize');
if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
// calculate free memory from page sizes (each page = 4096)
if (preg_match('/^Pages free:\s+(\S+)/m', $pstat, $free_buf)) {
... | [
"protected",
"function",
"memory",
"(",
")",
"{",
"$",
"s",
"=",
"$",
"this",
"->",
"grabkey",
"(",
"'hw.memsize'",
")",
";",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'vm_stat'",
",",
"''",
",",
"$",
"pstat",
",",
"PSI_DEBUG",
")",
"... | get memory and swap information
@return void | [
"get",
"memory",
"and",
"swap",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Darwin.inc.php#L280-L338 |
phpsysinfo/phpsysinfo | includes/os/class.Darwin.inc.php | Darwin._tb | protected function _tb()
{
$s = $this->_grabioreg('IOThunderboltPort');
$lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$dev = new HWDevice();
if (!preg_match('/"Description" = "([^"]*)"/', $line, $ar_buf))
... | php | protected function _tb()
{
$s = $this->_grabioreg('IOThunderboltPort');
$lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
$dev = new HWDevice();
if (!preg_match('/"Description" = "([^"]*)"/', $line, $ar_buf))
... | [
"protected",
"function",
"_tb",
"(",
")",
"{",
"$",
"s",
"=",
"$",
"this",
"->",
"_grabioreg",
"(",
"'IOThunderboltPort'",
")",
";",
"$",
"lines",
"=",
"preg_split",
"(",
"\"/\\n/\"",
",",
"$",
"s",
",",
"-",
"1",
",",
"PREG_SPLIT_NO_EMPTY",
")",
";",
... | get the thunderbolt device information out of ioreg
@return void | [
"get",
"the",
"thunderbolt",
"device",
"information",
"out",
"of",
"ioreg"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Darwin.inc.php#L345-L356 |
phpsysinfo/phpsysinfo | includes/os/class.Darwin.inc.php | Darwin._network | private function _network()
{
if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $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()
{
if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $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",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'netstat'",
",",
"'-nbdi | cut -c1-24,42- | grep Link'",
",",
"$",
"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.Darwin.inc.php#L363-L406 |
phpsysinfo/phpsysinfo | includes/os/class.Darwin.inc.php | Darwin.distro | protected function distro()
{
$this->sys->setDistributionIcon('Darwin.png');
if (!CommonFunctions::executeProgram('system_profiler', 'SPSoftwareDataType', $buffer, PSI_DEBUG)) {
parent::distro();
} else {
$arrBuff = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY)... | php | protected function distro()
{
$this->sys->setDistributionIcon('Darwin.png');
if (!CommonFunctions::executeProgram('system_profiler', 'SPSoftwareDataType', $buffer, PSI_DEBUG)) {
parent::distro();
} else {
$arrBuff = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY)... | [
"protected",
"function",
"distro",
"(",
")",
"{",
"$",
"this",
"->",
"sys",
"->",
"setDistributionIcon",
"(",
"'Darwin.png'",
")",
";",
"if",
"(",
"!",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'system_profiler'",
",",
"'SPSoftwareDataType'",
",",
"$",
... | get icon name
@return void | [
"get",
"icon",
"name"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Darwin.inc.php#L413-L440 |
phpsysinfo/phpsysinfo | includes/os/class.Darwin.inc.php | Darwin.build | public function build()
{
parent::build();
if (!$this->blockname || $this->blockname==='vitals') {
$this->_uptime();
$this->_processes();
}
if (!$this->blockname || $this->blockname==='hardware') {
$this->_tb();
}
if (!$this->blockn... | php | public function build()
{
parent::build();
if (!$this->blockname || $this->blockname==='vitals') {
$this->_uptime();
$this->_processes();
}
if (!$this->blockname || $this->blockname==='hardware') {
$this->_tb();
}
if (!$this->blockn... | [
"public",
"function",
"build",
"(",
")",
"{",
"parent",
"::",
"build",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"blockname",
"||",
"$",
"this",
"->",
"blockname",
"===",
"'vitals'",
")",
"{",
"$",
"this",
"->",
"_uptime",
"(",
")",
";",
... | get the information
@see PSI_Interface_OS::build()
@return Void | [
"get",
"the",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Darwin.inc.php#L479-L492 |
phpsysinfo/phpsysinfo | includes/mb/class.thinkpad.inc.php | Thinkpad.build | public function build()
{
if (PSI_OS == 'Linux') {
$hwpaths = glob("/sys/devices/platform/thinkpad_hwmon/", GLOB_NOSORT);
if (is_array($hwpaths) && (count($hwpaths) == 1)) {
$this->_temperature($hwpaths[0]);
$this->_fans($hwpaths[0]);
}
... | php | public function build()
{
if (PSI_OS == 'Linux') {
$hwpaths = glob("/sys/devices/platform/thinkpad_hwmon/", GLOB_NOSORT);
if (is_array($hwpaths) && (count($hwpaths) == 1)) {
$this->_temperature($hwpaths[0]);
$this->_fans($hwpaths[0]);
}
... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"PSI_OS",
"==",
"'Linux'",
")",
"{",
"$",
"hwpaths",
"=",
"glob",
"(",
"\"/sys/devices/platform/thinkpad_hwmon/\"",
",",
"GLOB_NOSORT",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"hwpaths",
")",
"&&"... | get the information
@see PSI_Interface_Sensor::build()
@return Void | [
"get",
"the",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.thinkpad.inc.php#L24-L33 |
phpsysinfo/phpsysinfo | includes/xml/class.XML.inc.php | XML._buildVitals | private function _buildVitals()
{
$vitals = $this->_xml->addChild('Vitals');
$vitals->addAttribute('Hostname', $this->_sys->getHostname());
$vitals->addAttribute('IPAddr', $this->_sys->getIp());
$vitals->addAttribute('Kernel', $this->_sys->getKernel());
$vitals->addAttribute(... | php | private function _buildVitals()
{
$vitals = $this->_xml->addChild('Vitals');
$vitals->addAttribute('Hostname', $this->_sys->getHostname());
$vitals->addAttribute('IPAddr', $this->_sys->getIp());
$vitals->addAttribute('Kernel', $this->_sys->getKernel());
$vitals->addAttribute(... | [
"private",
"function",
"_buildVitals",
"(",
")",
"{",
"$",
"vitals",
"=",
"$",
"this",
"->",
"_xml",
"->",
"addChild",
"(",
"'Vitals'",
")",
";",
"$",
"vitals",
"->",
"addAttribute",
"(",
"'Hostname'",
",",
"$",
"this",
"->",
"_sys",
"->",
"getHostname",... | generate common information
@return void | [
"generate",
"common",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/xml/class.XML.inc.php#L119-L173 |
phpsysinfo/phpsysinfo | includes/xml/class.XML.inc.php | XML._buildNetwork | private function _buildNetwork()
{
$hideDevices = array();
$network = $this->_xml->addChild('Network');
if (defined('PSI_HIDE_NETWORK_INTERFACE')) {
if (is_string(PSI_HIDE_NETWORK_INTERFACE)) {
if (preg_match(ARRAY_EXP, PSI_HIDE_NETWORK_INTERFACE)) {
... | php | private function _buildNetwork()
{
$hideDevices = array();
$network = $this->_xml->addChild('Network');
if (defined('PSI_HIDE_NETWORK_INTERFACE')) {
if (is_string(PSI_HIDE_NETWORK_INTERFACE)) {
if (preg_match(ARRAY_EXP, PSI_HIDE_NETWORK_INTERFACE)) {
... | [
"private",
"function",
"_buildNetwork",
"(",
")",
"{",
"$",
"hideDevices",
"=",
"array",
"(",
")",
";",
"$",
"network",
"=",
"$",
"this",
"->",
"_xml",
"->",
"addChild",
"(",
"'Network'",
")",
";",
"if",
"(",
"defined",
"(",
"'PSI_HIDE_NETWORK_INTERFACE'",... | generate the network information
@return void | [
"generate",
"the",
"network",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/xml/class.XML.inc.php#L180-L207 |
phpsysinfo/phpsysinfo | includes/xml/class.XML.inc.php | XML._buildHardware | private function _buildHardware()
{
$hardware = $this->_xml->addChild('Hardware');
if ($this->_sys->getMachine() != "") {
$hardware->addAttribute('Name', $this->_sys->getMachine());
}
$pci = null;
foreach (System::removeDupsAndCount($this->_sys->getPciDevices()) a... | php | private function _buildHardware()
{
$hardware = $this->_xml->addChild('Hardware');
if ($this->_sys->getMachine() != "") {
$hardware->addAttribute('Name', $this->_sys->getMachine());
}
$pci = null;
foreach (System::removeDupsAndCount($this->_sys->getPciDevices()) a... | [
"private",
"function",
"_buildHardware",
"(",
")",
"{",
"$",
"hardware",
"=",
"$",
"this",
"->",
"_xml",
"->",
"addChild",
"(",
"'Hardware'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_sys",
"->",
"getMachine",
"(",
")",
"!=",
"\"\"",
")",
"{",
"$",
... | generate the hardware information
@return void | [
"generate",
"the",
"hardware",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/xml/class.XML.inc.php#L214-L362 |
phpsysinfo/phpsysinfo | includes/xml/class.XML.inc.php | XML._buildMemory | private function _buildMemory()
{
$memory = $this->_xml->addChild('Memory');
$memory->addAttribute('Free', $this->_sys->getMemFree());
$memory->addAttribute('Used', $this->_sys->getMemUsed());
$memory->addAttribute('Total', $this->_sys->getMemTotal());
$memory->addAttribute('... | php | private function _buildMemory()
{
$memory = $this->_xml->addChild('Memory');
$memory->addAttribute('Free', $this->_sys->getMemFree());
$memory->addAttribute('Used', $this->_sys->getMemUsed());
$memory->addAttribute('Total', $this->_sys->getMemTotal());
$memory->addAttribute('... | [
"private",
"function",
"_buildMemory",
"(",
")",
"{",
"$",
"memory",
"=",
"$",
"this",
"->",
"_xml",
"->",
"addChild",
"(",
"'Memory'",
")",
";",
"$",
"memory",
"->",
"addAttribute",
"(",
"'Free'",
",",
"$",
"this",
"->",
"_sys",
"->",
"getMemFree",
"(... | generate the memory information
@return void | [
"generate",
"the",
"memory",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/xml/class.XML.inc.php#L369-L403 |
phpsysinfo/phpsysinfo | includes/xml/class.XML.inc.php | XML._fillDevice | private function _fillDevice(SimpleXMLExtended $mount, DiskDevice $dev, $i)
{
$mount->addAttribute('MountPointID', $i);
if ($dev->getFsType()!=="") $mount->addAttribute('FSType', $dev->getFsType());
$mount->addAttribute('Name', $dev->getName());
$mount->addAttribute('Free', sprintf("... | php | private function _fillDevice(SimpleXMLExtended $mount, DiskDevice $dev, $i)
{
$mount->addAttribute('MountPointID', $i);
if ($dev->getFsType()!=="") $mount->addAttribute('FSType', $dev->getFsType());
$mount->addAttribute('Name', $dev->getName());
$mount->addAttribute('Free', sprintf("... | [
"private",
"function",
"_fillDevice",
"(",
"SimpleXMLExtended",
"$",
"mount",
",",
"DiskDevice",
"$",
"dev",
",",
"$",
"i",
")",
"{",
"$",
"mount",
"->",
"addAttribute",
"(",
"'MountPointID'",
",",
"$",
"i",
")",
";",
"if",
"(",
"$",
"dev",
"->",
"getF... | fill a xml element with atrributes from a disk device
@param SimpleXmlExtended $mount Xml-Element
@param DiskDevice $dev DiskDevice
@param Integer $i counter
@return Void | [
"fill",
"a",
"xml",
"element",
"with",
"atrributes",
"from",
"a",
"disk",
"device"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/xml/class.XML.inc.php#L414-L435 |
phpsysinfo/phpsysinfo | includes/xml/class.XML.inc.php | XML._buildFilesystems | private function _buildFilesystems()
{
$hideMounts = $hideFstypes = $hideDisks = $ignoreFree = $ignoreUsage = $ignoreThreshold = array();
$i = 1;
if (defined('PSI_HIDE_MOUNTS') && is_string(PSI_HIDE_MOUNTS)) {
if (preg_match(ARRAY_EXP, PSI_HIDE_MOUNTS)) {
$hideMou... | php | private function _buildFilesystems()
{
$hideMounts = $hideFstypes = $hideDisks = $ignoreFree = $ignoreUsage = $ignoreThreshold = array();
$i = 1;
if (defined('PSI_HIDE_MOUNTS') && is_string(PSI_HIDE_MOUNTS)) {
if (preg_match(ARRAY_EXP, PSI_HIDE_MOUNTS)) {
$hideMou... | [
"private",
"function",
"_buildFilesystems",
"(",
")",
"{",
"$",
"hideMounts",
"=",
"$",
"hideFstypes",
"=",
"$",
"hideDisks",
"=",
"$",
"ignoreFree",
"=",
"$",
"ignoreUsage",
"=",
"$",
"ignoreThreshold",
"=",
"array",
"(",
")",
";",
"$",
"i",
"=",
"1",
... | generate the filesysteminformation
@return void | [
"generate",
"the",
"filesysteminformation"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/xml/class.XML.inc.php#L442-L506 |
phpsysinfo/phpsysinfo | includes/xml/class.XML.inc.php | XML._buildMbinfo | private function _buildMbinfo()
{
$mbinfo = $this->_xml->addChild('MBInfo');
$temp = $fan = $volt = $power = $current = $other = null;
if (sizeof(unserialize(PSI_MBINFO))>0) {
foreach (unserialize(PSI_MBINFO) as $mbinfoclass) {
$mbinfo_data = new $mbinfoclass();
... | php | private function _buildMbinfo()
{
$mbinfo = $this->_xml->addChild('MBInfo');
$temp = $fan = $volt = $power = $current = $other = null;
if (sizeof(unserialize(PSI_MBINFO))>0) {
foreach (unserialize(PSI_MBINFO) as $mbinfoclass) {
$mbinfo_data = new $mbinfoclass();
... | [
"private",
"function",
"_buildMbinfo",
"(",
")",
"{",
"$",
"mbinfo",
"=",
"$",
"this",
"->",
"_xml",
"->",
"addChild",
"(",
"'MBInfo'",
")",
";",
"$",
"temp",
"=",
"$",
"fan",
"=",
"$",
"volt",
"=",
"$",
"power",
"=",
"$",
"current",
"=",
"$",
"o... | generate the motherboard information
@return void | [
"generate",
"the",
"motherboard",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/xml/class.XML.inc.php#L513-L617 |
phpsysinfo/phpsysinfo | includes/xml/class.XML.inc.php | XML._buildUpsinfo | private function _buildUpsinfo()
{
$upsinfo = $this->_xml->addChild('UPSInfo');
if (defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) {
$upsinfo->addAttribute('ApcupsdCgiLinks', true);
}
if (sizeof(unserialize(PSI_UPSINFO))>0) {
foreach (uns... | php | private function _buildUpsinfo()
{
$upsinfo = $this->_xml->addChild('UPSInfo');
if (defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) {
$upsinfo->addAttribute('ApcupsdCgiLinks', true);
}
if (sizeof(unserialize(PSI_UPSINFO))>0) {
foreach (uns... | [
"private",
"function",
"_buildUpsinfo",
"(",
")",
"{",
"$",
"upsinfo",
"=",
"$",
"this",
"->",
"_xml",
"->",
"addChild",
"(",
"'UPSInfo'",
")",
";",
"if",
"(",
"defined",
"(",
"'PSI_UPS_APCUPSD_CGI_ENABLE'",
")",
"&&",
"PSI_UPS_APCUPSD_CGI_ENABLE",
")",
"{",
... | generate the ups information
@return void | [
"generate",
"the",
"ups",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/xml/class.XML.inc.php#L624-L683 |
phpsysinfo/phpsysinfo | includes/xml/class.XML.inc.php | XML._buildXml | private function _buildXml()
{
if (!$this->_plugin_request || $this->_complete_request) {
if ($this->_sys === null) {
if (PSI_DEBUG === true) {
// unstable version check
if (!is_numeric(substr(PSI_VERSION, -1))) {
$t... | php | private function _buildXml()
{
if (!$this->_plugin_request || $this->_complete_request) {
if ($this->_sys === null) {
if (PSI_DEBUG === true) {
// unstable version check
if (!is_numeric(substr(PSI_VERSION, -1))) {
$t... | [
"private",
"function",
"_buildXml",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_plugin_request",
"||",
"$",
"this",
"->",
"_complete_request",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sys",
"===",
"null",
")",
"{",
"if",
"(",
"PSI_DEBUG",
"=... | generate the xml document
@return void | [
"generate",
"the",
"xml",
"document"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/xml/class.XML.inc.php#L690-L733 |
phpsysinfo/phpsysinfo | includes/xml/class.XML.inc.php | XML._buildPlugins | private function _buildPlugins()
{
$pluginroot = $this->_xml->addChild("Plugins");
if (($this->_plugin_request || $this->_complete_request) && count($this->_plugins) > 0) {
$plugins = array();
if ($this->_complete_request) {
$plugins = $this->_plugins;
... | php | private function _buildPlugins()
{
$pluginroot = $this->_xml->addChild("Plugins");
if (($this->_plugin_request || $this->_complete_request) && count($this->_plugins) > 0) {
$plugins = array();
if ($this->_complete_request) {
$plugins = $this->_plugins;
... | [
"private",
"function",
"_buildPlugins",
"(",
")",
"{",
"$",
"pluginroot",
"=",
"$",
"this",
"->",
"_xml",
"->",
"addChild",
"(",
"\"Plugins\"",
")",
";",
"if",
"(",
"(",
"$",
"this",
"->",
"_plugin_request",
"||",
"$",
"this",
"->",
"_complete_request",
... | include xml-trees of the plugins to the main xml
@return void | [
"include",
"xml",
"-",
"trees",
"of",
"the",
"plugins",
"to",
"the",
"main",
"xml"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/xml/class.XML.inc.php#L752-L772 |
phpsysinfo/phpsysinfo | includes/xml/class.XML.inc.php | XML._xmlbody | private function _xmlbody()
{
$dom = new DOMDocument('1.0', 'UTF-8');
$root = $dom->createElement("tns:phpsysinfo");
$root->setAttribute('xmlns:tns', 'http://phpsysinfo.sourceforge.net/');
$root->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
$root->s... | php | private function _xmlbody()
{
$dom = new DOMDocument('1.0', 'UTF-8');
$root = $dom->createElement("tns:phpsysinfo");
$root->setAttribute('xmlns:tns', 'http://phpsysinfo.sourceforge.net/');
$root->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
$root->s... | [
"private",
"function",
"_xmlbody",
"(",
")",
"{",
"$",
"dom",
"=",
"new",
"DOMDocument",
"(",
"'1.0'",
",",
"'UTF-8'",
")",
";",
"$",
"root",
"=",
"$",
"dom",
"->",
"createElement",
"(",
"\"tns:phpsysinfo\"",
")",
";",
"$",
"root",
"->",
"setAttribute",
... | build the xml structure where the content can be inserted
@return void | [
"build",
"the",
"xml",
"structure",
"where",
"the",
"content",
"can",
"be",
"inserted"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/xml/class.XML.inc.php#L779-L826 |
phpsysinfo/phpsysinfo | includes/output/class.Webpage.inc.php | Webpage._checkTemplateLanguage | private function _checkTemplateLanguage()
{
if (!defined("PSI_DEFAULT_TEMPLATE") || (($this->_template = strtolower(trim(PSI_DEFAULT_TEMPLATE))) == "") || !file_exists(PSI_APP_ROOT.'/templates/'.$this->_template.".css")) {
$this->_template = 'phpsysinfo';
}
if (!defined("PSI_DEFA... | php | private function _checkTemplateLanguage()
{
if (!defined("PSI_DEFAULT_TEMPLATE") || (($this->_template = strtolower(trim(PSI_DEFAULT_TEMPLATE))) == "") || !file_exists(PSI_APP_ROOT.'/templates/'.$this->_template.".css")) {
$this->_template = 'phpsysinfo';
}
if (!defined("PSI_DEFA... | [
"private",
"function",
"_checkTemplateLanguage",
"(",
")",
"{",
"if",
"(",
"!",
"defined",
"(",
"\"PSI_DEFAULT_TEMPLATE\"",
")",
"||",
"(",
"(",
"$",
"this",
"->",
"_template",
"=",
"strtolower",
"(",
"trim",
"(",
"PSI_DEFAULT_TEMPLATE",
")",
")",
")",
"==",... | checking phpsysinfo.ini setting for template, if not supportet set phpsysinfo.css as default
checking phpsysinfo.ini setting for language, if not supported set en as default
@return void | [
"checking",
"phpsysinfo",
".",
"ini",
"setting",
"for",
"template",
"if",
"not",
"supportet",
"set",
"phpsysinfo",
".",
"css",
"as",
"default",
"checking",
"phpsysinfo",
".",
"ini",
"setting",
"for",
"language",
"if",
"not",
"supported",
"set",
"en",
"as",
"... | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/output/class.Webpage.inc.php#L109-L123 |
phpsysinfo/phpsysinfo | includes/output/class.Webpage.inc.php | Webpage._getTemplateList | private function _getTemplateList()
{
$dirlist = CommonFunctions::gdc(PSI_APP_ROOT.'/templates/');
sort($dirlist);
foreach ($dirlist as $file) {
$tpl_ext = substr($file, strlen($file) - 4);
$tpl_name = substr($file, 0, strlen($file) - 4);
if ($tpl_ext === ... | php | private function _getTemplateList()
{
$dirlist = CommonFunctions::gdc(PSI_APP_ROOT.'/templates/');
sort($dirlist);
foreach ($dirlist as $file) {
$tpl_ext = substr($file, strlen($file) - 4);
$tpl_name = substr($file, 0, strlen($file) - 4);
if ($tpl_ext === ... | [
"private",
"function",
"_getTemplateList",
"(",
")",
"{",
"$",
"dirlist",
"=",
"CommonFunctions",
"::",
"gdc",
"(",
"PSI_APP_ROOT",
".",
"'/templates/'",
")",
";",
"sort",
"(",
"$",
"dirlist",
")",
";",
"foreach",
"(",
"$",
"dirlist",
"as",
"$",
"file",
... | get all available tamplates and store them in internal array
@return void | [
"get",
"all",
"available",
"tamplates",
"and",
"store",
"them",
"in",
"internal",
"array"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/output/class.Webpage.inc.php#L130-L145 |
phpsysinfo/phpsysinfo | includes/output/class.Webpage.inc.php | Webpage._getLanguageList | private function _getLanguageList()
{
$dirlist = CommonFunctions::gdc(PSI_APP_ROOT.'/language/');
sort($dirlist);
foreach ($dirlist as $file) {
$lang_ext = strtolower(substr($file, strlen($file) - 4));
$lang_name = strtolower(substr($file, 0, strlen($file) - 4));
... | php | private function _getLanguageList()
{
$dirlist = CommonFunctions::gdc(PSI_APP_ROOT.'/language/');
sort($dirlist);
foreach ($dirlist as $file) {
$lang_ext = strtolower(substr($file, strlen($file) - 4));
$lang_name = strtolower(substr($file, 0, strlen($file) - 4));
... | [
"private",
"function",
"_getLanguageList",
"(",
")",
"{",
"$",
"dirlist",
"=",
"CommonFunctions",
"::",
"gdc",
"(",
"PSI_APP_ROOT",
".",
"'/language/'",
")",
";",
"sort",
"(",
"$",
"dirlist",
")",
";",
"foreach",
"(",
"$",
"dirlist",
"as",
"$",
"file",
"... | get all available translations and store them in internal array
@return void | [
"get",
"all",
"available",
"translations",
"and",
"store",
"them",
"in",
"internal",
"array"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/output/class.Webpage.inc.php#L152-L163 |
phpsysinfo/phpsysinfo | includes/output/class.Webpage.inc.php | Webpage.run | public function run()
{
$this->_checkTemplateLanguage();
$tpl = new Template("/templates/html/index_".$this->_indexname.".html");
$tpl->set("template", $this->_template);
$tpl->set("templates", $this->_templates);
$tpl->set("bootstraptemplate", $this->_bootstrap_template);
... | php | public function run()
{
$this->_checkTemplateLanguage();
$tpl = new Template("/templates/html/index_".$this->_indexname.".html");
$tpl->set("template", $this->_template);
$tpl->set("templates", $this->_templates);
$tpl->set("bootstraptemplate", $this->_bootstrap_template);
... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"this",
"->",
"_checkTemplateLanguage",
"(",
")",
";",
"$",
"tpl",
"=",
"new",
"Template",
"(",
"\"/templates/html/index_\"",
".",
"$",
"this",
"->",
"_indexname",
".",
"\".html\"",
")",
";",
"$",
"tpl",
"... | render the page
@return void | [
"render",
"the",
"page"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/output/class.Webpage.inc.php#L170-L220 |
phpsysinfo/phpsysinfo | includes/mb/class.lmsensors.inc.php | LMSensors._temperature | private function _temperature()
{
$applesmc = false;
$sname = '';
foreach ($this->_lines as $line) {
if ((trim($line) !== "") && (strpos($line, ':') === false)) {
//$applesmc = preg_match("/^applesmc-/", $line);
$sname = trim($line);
... | php | private function _temperature()
{
$applesmc = false;
$sname = '';
foreach ($this->_lines as $line) {
if ((trim($line) !== "") && (strpos($line, ':') === false)) {
//$applesmc = preg_match("/^applesmc-/", $line);
$sname = trim($line);
... | [
"private",
"function",
"_temperature",
"(",
")",
"{",
"$",
"applesmc",
"=",
"false",
";",
"$",
"sname",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"_lines",
"as",
"$",
"line",
")",
"{",
"if",
"(",
"(",
"trim",
"(",
"$",
"line",
")",
"!=="... | get temperature information
@return void | [
"get",
"temperature",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.lmsensors.inc.php#L55-L148 |
phpsysinfo/phpsysinfo | includes/mb/class.lmsensors.inc.php | LMSensors._fans | private function _fans()
{
$sname = '';
foreach ($this->_lines as $line) {
if ((trim($line) !== "") && (strpos($line, ':') === false)) {
$sname = trim($line);
if (preg_match('/^([^-]+)-/', $sname, $snamebuf)) {
$sname = ' ('.$snamebuf[1... | php | private function _fans()
{
$sname = '';
foreach ($this->_lines as $line) {
if ((trim($line) !== "") && (strpos($line, ':') === false)) {
$sname = trim($line);
if (preg_match('/^([^-]+)-/', $sname, $snamebuf)) {
$sname = ' ('.$snamebuf[1... | [
"private",
"function",
"_fans",
"(",
")",
"{",
"$",
"sname",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"_lines",
"as",
"$",
"line",
")",
"{",
"if",
"(",
"(",
"trim",
"(",
"$",
"line",
")",
"!==",
"\"\"",
")",
"&&",
"(",
"strpos",
"(",
... | get fan information
@return void | [
"get",
"fan",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.lmsensors.inc.php#L155-L199 |
phpsysinfo/phpsysinfo | includes/mb/class.lmsensors.inc.php | LMSensors._other | private function _other()
{
$sname = '';
foreach ($this->_lines as $line) {
if ((trim($line) !== "") && (strpos($line, ':') === false)) {
$sname = trim($line);
if (preg_match('/^([^-]+)-/', $sname, $snamebuf)) {
$sname = ' ('.$snamebuf[... | php | private function _other()
{
$sname = '';
foreach ($this->_lines as $line) {
if ((trim($line) !== "") && (strpos($line, ':') === false)) {
$sname = trim($line);
if (preg_match('/^([^-]+)-/', $sname, $snamebuf)) {
$sname = ' ('.$snamebuf[... | [
"private",
"function",
"_other",
"(",
")",
"{",
"$",
"sname",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"_lines",
"as",
"$",
"line",
")",
"{",
"if",
"(",
"(",
"trim",
"(",
"$",
"line",
")",
"!==",
"\"\"",
")",
"&&",
"(",
"strpos",
"(",... | get other information
@return void | [
"get",
"other",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.lmsensors.inc.php#L371-L401 |
phpsysinfo/phpsysinfo | includes/mb/class.coretemp.inc.php | Coretemp.build | public function build()
{
if (PSI_OS == 'Linux') {
$hwpaths = glob("/sys/devices/platform/coretemp.*/", GLOB_NOSORT);
if (is_array($hwpaths) && (count($hwpaths) > 0)) {
$hwpaths = array_merge($hwpaths, glob("/sys/devices/platform/coretemp.*/hwmon/hwmon*/", GLOB_NOSORT... | php | public function build()
{
if (PSI_OS == 'Linux') {
$hwpaths = glob("/sys/devices/platform/coretemp.*/", GLOB_NOSORT);
if (is_array($hwpaths) && (count($hwpaths) > 0)) {
$hwpaths = array_merge($hwpaths, glob("/sys/devices/platform/coretemp.*/hwmon/hwmon*/", GLOB_NOSORT... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"PSI_OS",
"==",
"'Linux'",
")",
"{",
"$",
"hwpaths",
"=",
"glob",
"(",
"\"/sys/devices/platform/coretemp.*/\"",
",",
"GLOB_NOSORT",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"hwpaths",
")",
"&&",
... | get the information
@see PSI_Interface_Sensor::build()
@return Void | [
"get",
"the",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/mb/class.coretemp.inc.php#L26-L53 |
phpsysinfo/phpsysinfo | includes/error/class.PSI_Error.inc.php | PSI_Error.singleton | public static function singleton()
{
if (!isset(self::$_instance)) {
$c = __CLASS__;
self::$_instance = new $c;
}
return self::$_instance;
} | php | public static function singleton()
{
if (!isset(self::$_instance)) {
$c = __CLASS__;
self::$_instance = new $c;
}
return self::$_instance;
} | [
"public",
"static",
"function",
"singleton",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"_instance",
")",
")",
"{",
"$",
"c",
"=",
"__CLASS__",
";",
"self",
"::",
"$",
"_instance",
"=",
"new",
"$",
"c",
";",
"}",
"return",
"s... | Singleton function
@return PSI_Error instance of the class | [
"Singleton",
"function"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/error/class.PSI_Error.inc.php#L64-L72 |
phpsysinfo/phpsysinfo | includes/error/class.PSI_Error.inc.php | PSI_Error._addError | private function _addError($strCommand, $strMessage)
{
$index = count($this->_arrErrorList) + 1;
$this->_arrErrorList[$index]['command'] = $strCommand;
$this->_arrErrorList[$index]['message'] = $strMessage;
$this->_errors++;
} | php | private function _addError($strCommand, $strMessage)
{
$index = count($this->_arrErrorList) + 1;
$this->_arrErrorList[$index]['command'] = $strCommand;
$this->_arrErrorList[$index]['message'] = $strMessage;
$this->_errors++;
} | [
"private",
"function",
"_addError",
"(",
"$",
"strCommand",
",",
"$",
"strMessage",
")",
"{",
"$",
"index",
"=",
"count",
"(",
"$",
"this",
"->",
"_arrErrorList",
")",
"+",
"1",
";",
"$",
"this",
"->",
"_arrErrorList",
"[",
"$",
"index",
"]",
"[",
"'... | adds an error to the internal list
@param string $strCommand Command, which cause the Error
@param string $strMessage message, that describe the Error
@return void | [
"adds",
"an",
"error",
"to",
"the",
"internal",
"list"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/error/class.PSI_Error.inc.php#L105-L111 |
phpsysinfo/phpsysinfo | includes/error/class.PSI_Error.inc.php | PSI_Error.addWarning | public function addWarning($strMessage)
{
$index = count($this->_arrErrorList) + 1;
$this->_arrErrorList[$index]['command'] = "WARN";
$this->_arrErrorList[$index]['message'] = $strMessage;
} | php | public function addWarning($strMessage)
{
$index = count($this->_arrErrorList) + 1;
$this->_arrErrorList[$index]['command'] = "WARN";
$this->_arrErrorList[$index]['message'] = $strMessage;
} | [
"public",
"function",
"addWarning",
"(",
"$",
"strMessage",
")",
"{",
"$",
"index",
"=",
"count",
"(",
"$",
"this",
"->",
"_arrErrorList",
")",
"+",
"1",
";",
"$",
"this",
"->",
"_arrErrorList",
"[",
"$",
"index",
"]",
"[",
"'command'",
"]",
"=",
"\"... | adds a waraning to the internal list
@param string $strMessage Warning message to display
@return void | [
"adds",
"a",
"waraning",
"to",
"the",
"internal",
"list"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/error/class.PSI_Error.inc.php#L146-L151 |
phpsysinfo/phpsysinfo | includes/error/class.PSI_Error.inc.php | PSI_Error.errorsAsXML | public function errorsAsXML()
{
$dom = new DOMDocument('1.0', 'UTF-8');
$root = $dom->createElement("phpsysinfo");
$dom->appendChild($root);
$xml = new SimpleXMLExtended(simplexml_import_dom($dom), 'UTF-8');
$generation = $xml->addChild('Generation');
$generation->add... | php | public function errorsAsXML()
{
$dom = new DOMDocument('1.0', 'UTF-8');
$root = $dom->createElement("phpsysinfo");
$dom->appendChild($root);
$xml = new SimpleXMLExtended(simplexml_import_dom($dom), 'UTF-8');
$generation = $xml->addChild('Generation');
$generation->add... | [
"public",
"function",
"errorsAsXML",
"(",
")",
"{",
"$",
"dom",
"=",
"new",
"DOMDocument",
"(",
"'1.0'",
",",
"'UTF-8'",
")",
";",
"$",
"root",
"=",
"$",
"dom",
"->",
"createElement",
"(",
"\"phpsysinfo\"",
")",
";",
"$",
"dom",
"->",
"appendChild",
"(... | converts the internal error and warning list to a XML file
@return void | [
"converts",
"the",
"internal",
"error",
"and",
"warning",
"list",
"to",
"a",
"XML",
"file"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/error/class.PSI_Error.inc.php#L158-L178 |
phpsysinfo/phpsysinfo | includes/error/class.PSI_Error.inc.php | PSI_Error.errorsAddToXML | public function errorsAddToXML($encoding)
{
$dom = new DOMDocument('1.0', 'UTF-8');
$root = $dom->createElement("Errors");
$dom->appendChild($root);
$xml = simplexml_import_dom($dom);
$xmlerr = new SimpleXMLExtended($xml, $encoding);
foreach ($this->_arrErrorList as $... | php | public function errorsAddToXML($encoding)
{
$dom = new DOMDocument('1.0', 'UTF-8');
$root = $dom->createElement("Errors");
$dom->appendChild($root);
$xml = simplexml_import_dom($dom);
$xmlerr = new SimpleXMLExtended($xml, $encoding);
foreach ($this->_arrErrorList as $... | [
"public",
"function",
"errorsAddToXML",
"(",
"$",
"encoding",
")",
"{",
"$",
"dom",
"=",
"new",
"DOMDocument",
"(",
"'1.0'",
",",
"'UTF-8'",
")",
";",
"$",
"root",
"=",
"$",
"dom",
"->",
"createElement",
"(",
"\"Errors\"",
")",
";",
"$",
"dom",
"->",
... | add the errors to an existing xml document
@param String $encoding encoding
@return SimpleXmlElement | [
"add",
"the",
"errors",
"to",
"an",
"existing",
"xml",
"document"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/error/class.PSI_Error.inc.php#L186-L201 |
phpsysinfo/phpsysinfo | includes/error/class.PSI_Error.inc.php | PSI_Error._trace | private function _trace($strMessage)
{
$arrTrace = array_reverse(debug_backtrace());
$strFunc = '';
$strBacktrace = htmlspecialchars($strMessage)."\n\n";
foreach ($arrTrace as $val) {
// avoid the last line, which says the error is from the error class
if ($va... | php | private function _trace($strMessage)
{
$arrTrace = array_reverse(debug_backtrace());
$strFunc = '';
$strBacktrace = htmlspecialchars($strMessage)."\n\n";
foreach ($arrTrace as $val) {
// avoid the last line, which says the error is from the error class
if ($va... | [
"private",
"function",
"_trace",
"(",
"$",
"strMessage",
")",
"{",
"$",
"arrTrace",
"=",
"array_reverse",
"(",
"debug_backtrace",
"(",
")",
")",
";",
"$",
"strFunc",
"=",
"''",
";",
"$",
"strBacktrace",
"=",
"htmlspecialchars",
"(",
"$",
"strMessage",
")",... | generate a function backtrace for error diagnostic, function is genearally based on code submitted in the php reference page
@param string $strMessage additional message to display
@return string formatted string of the backtrace | [
"generate",
"a",
"function",
"backtrace",
"for",
"error",
"diagnostic",
"function",
"is",
"genearally",
"based",
"on",
"code",
"submitted",
"in",
"the",
"php",
"reference",
"page"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/error/class.PSI_Error.inc.php#L222-L255 |
phpsysinfo/phpsysinfo | includes/error/class.PSI_Error.inc.php | PSI_Error._printVar | private function _printVar($var)
{
if (is_string($var)) {
$search = array("\x00", "\x0a", "\x0d", "\x1a", "\x09");
$replace = array('\0', '\n', '\r', '\Z', '\t');
return ('"'.str_replace($search, $replace, $var).'"');
} elseif (is_bool($var)) {
if ($v... | php | private function _printVar($var)
{
if (is_string($var)) {
$search = array("\x00", "\x0a", "\x0d", "\x1a", "\x09");
$replace = array('\0', '\n', '\r', '\Z', '\t');
return ('"'.str_replace($search, $replace, $var).'"');
} elseif (is_bool($var)) {
if ($v... | [
"private",
"function",
"_printVar",
"(",
"$",
"var",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"var",
")",
")",
"{",
"$",
"search",
"=",
"array",
"(",
"\"\\x00\"",
",",
"\"\\x0a\"",
",",
"\"\\x0d\"",
",",
"\"\\x1a\"",
",",
"\"\\x09\"",
")",
";",
"$... | convert some special vars into better readable output
@param mixed $var value, which should be formatted
@return string formatted string | [
"convert",
"some",
"special",
"vars",
"into",
"better",
"readable",
"output"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/error/class.PSI_Error.inc.php#L263-L289 |
phpsysinfo/phpsysinfo | includes/output/class.Template.inc.php | Template.set | public function set($name, $value)
{
$this->_vars[$name] = is_object($value) ? $value->fetch() : $value;
} | php | public function set($name, $value)
{
$this->_vars[$name] = is_object($value) ? $value->fetch() : $value;
} | [
"public",
"function",
"set",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_vars",
"[",
"$",
"name",
"]",
"=",
"is_object",
"(",
"$",
"value",
")",
"?",
"$",
"value",
"->",
"fetch",
"(",
")",
":",
"$",
"value",
";",
"}"
] | Set a template variable.
@param string $name variable name
@param string|array|Template $value variable value | [
"Set",
"a",
"template",
"variable",
"."
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/output/class.Template.inc.php#L59-L62 |
phpsysinfo/phpsysinfo | includes/output/class.Template.inc.php | Template.fetch | public function fetch($file=null)
{
if (!$file) {
$file = $this->_file;
}
// Extract the vars to local namespace
extract($this->_vars);
// Start output buffering
ob_start();
include(PSI_APP_ROOT.$file);
// Get the contents of the buffer... | php | public function fetch($file=null)
{
if (!$file) {
$file = $this->_file;
}
// Extract the vars to local namespace
extract($this->_vars);
// Start output buffering
ob_start();
include(PSI_APP_ROOT.$file);
// Get the contents of the buffer... | [
"public",
"function",
"fetch",
"(",
"$",
"file",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"file",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"_file",
";",
"}",
"// Extract the vars to local namespace",
"extract",
"(",
"$",
"this",
"->",
"_vars",... | Open, parse, and return the template file.
@param string $file
@return string | [
"Open",
"parse",
"and",
"return",
"the",
"template",
"file",
"."
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/output/class.Template.inc.php#L71-L92 |
phpsysinfo/phpsysinfo | plugins/smart/class.smart.inc.php | SMART.execute | public function execute()
{
if (empty($this->_filecontent) || empty($this->_ids)) {
return;
}
foreach ($this->_filecontent as $disk=>$result) {
// set the start and end offset in the result string at the beginning and end respectively
// just in case we do... | php | public function execute()
{
if (empty($this->_filecontent) || empty($this->_ids)) {
return;
}
foreach ($this->_filecontent as $disk=>$result) {
// set the start and end offset in the result string at the beginning and end respectively
// just in case we do... | [
"public",
"function",
"execute",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_filecontent",
")",
"||",
"empty",
"(",
"$",
"this",
"->",
"_ids",
")",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"_filecontent",
"a... | 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/smart/class.smart.inc.php#L161-L322 |
phpsysinfo/phpsysinfo | plugins/smart/class.smart.inc.php | SMART.xml | public function xml()
{
if (empty($this->_result) || empty($this->_ids)) {
return $this->xml->getSimpleXmlElement();
}
$columnsChild = $this->xml->addChild('columns');
// Fill the xml with preferences
foreach ($this->_ids as $id=>$column_name) {
$colu... | php | public function xml()
{
if (empty($this->_result) || empty($this->_ids)) {
return $this->xml->getSimpleXmlElement();
}
$columnsChild = $this->xml->addChild('columns');
// Fill the xml with preferences
foreach ($this->_ids as $id=>$column_name) {
$colu... | [
"public",
"function",
"xml",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_result",
")",
"||",
"empty",
"(",
"$",
"this",
"->",
"_ids",
")",
")",
"{",
"return",
"$",
"this",
"->",
"xml",
"->",
"getSimpleXmlElement",
"(",
")",
";",
... | 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/smart/class.smart.inc.php#L329-L364 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._machine | private function _machine()
{
$machine = "";
if ((CommonFunctions::rfts('/var/log/dmesg', $result, 0, 4096, false)
&& preg_match('/^[\s\[\]\.\d]*DMI:\s*(.*)/m', $result, $ar_buf))
||(CommonFunctions::executeProgram('dmesg', '', $result, false)
&& preg_match('/^... | php | private function _machine()
{
$machine = "";
if ((CommonFunctions::rfts('/var/log/dmesg', $result, 0, 4096, false)
&& preg_match('/^[\s\[\]\.\d]*DMI:\s*(.*)/m', $result, $ar_buf))
||(CommonFunctions::executeProgram('dmesg', '', $result, false)
&& preg_match('/^... | [
"private",
"function",
"_machine",
"(",
")",
"{",
"$",
"machine",
"=",
"\"\"",
";",
"if",
"(",
"(",
"CommonFunctions",
"::",
"rfts",
"(",
"'/var/log/dmesg'",
",",
"$",
"result",
",",
"0",
",",
"4096",
",",
"false",
")",
"&&",
"preg_match",
"(",
"'/^[\\... | Machine
@return void | [
"Machine"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Linux.inc.php#L39-L97 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._hostname | protected function _hostname()
{
if (PSI_USE_VHOST === true) {
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
} else {
if (CommonFunctions::rfts('/proc/sys/kernel/hostname', $result, 1, 4096, PSI_DEBUG && (PSI_OS != 'Android'))) {
... | php | protected function _hostname()
{
if (PSI_USE_VHOST === true) {
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
} else {
if (CommonFunctions::rfts('/proc/sys/kernel/hostname', $result, 1, 4096, PSI_DEBUG && (PSI_OS != 'Android'))) {
... | [
"protected",
"function",
"_hostname",
"(",
")",
"{",
"if",
"(",
"PSI_USE_VHOST",
"===",
"true",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"readenv",
"(",
"'SERVER_NAME'",
",",
"$",
"hnm",
")",
")",
"$",
"this",
"->",
"sys",
"->",
"setHostname",
"(",
... | Hostname
@return void | [
"Hostname"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Linux.inc.php#L104-L120 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._kernel | private function _kernel()
{
$result = "";
if (CommonFunctions::executeProgram($uname="uptrack-uname", '-r', $strBuf, false) || // show effective kernel if ksplice uptrack is installed
CommonFunctions::executeProgram($uname="uname", '-r', $strBuf, PSI_DEBUG)) {
$result = $str... | php | private function _kernel()
{
$result = "";
if (CommonFunctions::executeProgram($uname="uptrack-uname", '-r', $strBuf, false) || // show effective kernel if ksplice uptrack is installed
CommonFunctions::executeProgram($uname="uname", '-r', $strBuf, PSI_DEBUG)) {
$result = $str... | [
"private",
"function",
"_kernel",
"(",
")",
"{",
"$",
"result",
"=",
"\"\"",
";",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"$",
"uname",
"=",
"\"uptrack-uname\"",
",",
"'-r'",
",",
"$",
"strBuf",
",",
"false",
")",
"||",
"// show effectiv... | Kernel Version
@return void | [
"Kernel",
"Version"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Linux.inc.php#L127-L163 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._uptime | protected function _uptime()
{
if (CommonFunctions::rfts('/proc/uptime', $buf, 1, 4096, PSI_OS != 'Android')) {
$ar_buf = preg_split('/ /', $buf);
$this->sys->setUptime(trim($ar_buf[0]));
} elseif (CommonFunctions::executeProgram('uptime', '', $buf)) {
if (preg_ma... | php | protected function _uptime()
{
if (CommonFunctions::rfts('/proc/uptime', $buf, 1, 4096, PSI_OS != 'Android')) {
$ar_buf = preg_split('/ /', $buf);
$this->sys->setUptime(trim($ar_buf[0]));
} elseif (CommonFunctions::executeProgram('uptime', '', $buf)) {
if (preg_ma... | [
"protected",
"function",
"_uptime",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"rfts",
"(",
"'/proc/uptime'",
",",
"$",
"buf",
",",
"1",
",",
"4096",
",",
"PSI_OS",
"!=",
"'Android'",
")",
")",
"{",
"$",
"ar_buf",
"=",
"preg_split",
"(",
"'/ /'... | 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.Linux.inc.php#L171-L195 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._loadavg | protected function _loadavg()
{
if (CommonFunctions::rfts('/proc/loadavg', $buf, 1, 4096, PSI_OS != 'Android')) {
$result = preg_split("/\s/", $buf, 4);
// don't need the extra values, only first three
unset($result[3]);
$this->sys->setLoad(implode(' ', $resul... | php | protected function _loadavg()
{
if (CommonFunctions::rfts('/proc/loadavg', $buf, 1, 4096, PSI_OS != 'Android')) {
$result = preg_split("/\s/", $buf, 4);
// don't need the extra values, only first three
unset($result[3]);
$this->sys->setLoad(implode(' ', $resul... | [
"protected",
"function",
"_loadavg",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"rfts",
"(",
"'/proc/loadavg'",
",",
"$",
"buf",
",",
"1",
",",
"4096",
",",
"PSI_OS",
"!=",
"'Android'",
")",
")",
"{",
"$",
"result",
"=",
"preg_split",
"(",
"\"/... | 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.Linux.inc.php#L203-L216 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._parseProcStat | protected function _parseProcStat($cpuline)
{
if (is_null($this->_cpu_loads)) {
$this->_cpu_loads = array();
$cpu_tmp = array();
if (CommonFunctions::rfts('/proc/stat', $buf)) {
if (preg_match_all('/^(cpu[0-9]*) (.*)/m', $buf, $matches, PREG_SET_ORDER)) {... | php | protected function _parseProcStat($cpuline)
{
if (is_null($this->_cpu_loads)) {
$this->_cpu_loads = array();
$cpu_tmp = array();
if (CommonFunctions::rfts('/proc/stat', $buf)) {
if (preg_match_all('/^(cpu[0-9]*) (.*)/m', $buf, $matches, PREG_SET_ORDER)) {... | [
"protected",
"function",
"_parseProcStat",
"(",
"$",
"cpuline",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"_cpu_loads",
")",
")",
"{",
"$",
"this",
"->",
"_cpu_loads",
"=",
"array",
"(",
")",
";",
"$",
"cpu_tmp",
"=",
"array",
"(",
")",... | fill the load for a individual cpu, through parsing /proc/stat for the specified cpu
@param String $cpuline cpu for which load should be meassured
@return Integer | [
"fill",
"the",
"load",
"for",
"a",
"individual",
"cpu",
"through",
"parsing",
"/",
"proc",
"/",
"stat",
"for",
"the",
"specified",
"cpu"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Linux.inc.php#L225-L284 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._cpuinfo | protected function _cpuinfo()
{
if (CommonFunctions::rfts('/proc/cpuinfo', $bufr)) {
$cpulist = null;
$raslist = null;
// sparc
if (preg_match('/\nCpu(\d+)Bogo\s*:/i', $bufr)) {
$bufr = preg_replace('/\nCpu(\d+)ClkTck\s*:/i', "\nCpu0ClkTck:", ... | php | protected function _cpuinfo()
{
if (CommonFunctions::rfts('/proc/cpuinfo', $bufr)) {
$cpulist = null;
$raslist = null;
// sparc
if (preg_match('/\nCpu(\d+)Bogo\s*:/i', $bufr)) {
$bufr = preg_replace('/\nCpu(\d+)ClkTck\s*:/i', "\nCpu0ClkTck:", ... | [
"protected",
"function",
"_cpuinfo",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"rfts",
"(",
"'/proc/cpuinfo'",
",",
"$",
"bufr",
")",
")",
"{",
"$",
"cpulist",
"=",
"null",
";",
"$",
"raslist",
"=",
"null",
";",
"// sparc",
"if",
"(",
"preg_ma... | CPU information
All of the tags here are highly architecture dependant.
@return void | [
"CPU",
"information",
"All",
"of",
"the",
"tags",
"here",
"are",
"highly",
"architecture",
"dependant",
"."
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Linux.inc.php#L292-L568 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._pci | private function _pci()
{
if ($arrResults = Parser::lspci()) {
foreach ($arrResults as $dev) {
$this->sys->setPciDevices($dev);
}
} elseif (CommonFunctions::rfts('/proc/pci', $strBuf, 0, 4096, false)) {
$booDevice = false;
$arrBuf = pre... | php | private function _pci()
{
if ($arrResults = Parser::lspci()) {
foreach ($arrResults as $dev) {
$this->sys->setPciDevices($dev);
}
} elseif (CommonFunctions::rfts('/proc/pci', $strBuf, 0, 4096, false)) {
$booDevice = false;
$arrBuf = pre... | [
"private",
"function",
"_pci",
"(",
")",
"{",
"if",
"(",
"$",
"arrResults",
"=",
"Parser",
"::",
"lspci",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"arrResults",
"as",
"$",
"dev",
")",
"{",
"$",
"this",
"->",
"sys",
"->",
"setPciDevices",
"(",
"$",
... | PCI devices
@return void | [
"PCI",
"devices"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Linux.inc.php#L575-L631 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._scsi | private function _scsi()
{
$getline = 0;
$device = null;
$scsiid = null;
if (CommonFunctions::executeProgram('lsscsi', '-c', $bufr, PSI_DEBUG) || CommonFunctions::rfts('/proc/scsi/scsi', $bufr, 0, 4096, PSI_DEBUG)) {
$bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMP... | php | private function _scsi()
{
$getline = 0;
$device = null;
$scsiid = null;
if (CommonFunctions::executeProgram('lsscsi', '-c', $bufr, PSI_DEBUG) || CommonFunctions::rfts('/proc/scsi/scsi', $bufr, 0, 4096, PSI_DEBUG)) {
$bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMP... | [
"private",
"function",
"_scsi",
"(",
")",
"{",
"$",
"getline",
"=",
"0",
";",
"$",
"device",
"=",
"null",
";",
"$",
"scsiid",
"=",
"null",
";",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'lsscsi'",
",",
"'-c'",
",",
"$",
"bufr",
",",... | SCSI devices
@return void | [
"SCSI",
"devices"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Linux.inc.php#L665-L709 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._usb | protected function _usb()
{
$usbarray = array();
if (CommonFunctions::executeProgram('lsusb', (PSI_OS != 'Android')?'':'2>/dev/null', $bufr, PSI_DEBUG && (PSI_OS != 'Android'), 5) && ($bufr !== "")) {
$bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
foreach ($bufe ... | php | protected function _usb()
{
$usbarray = array();
if (CommonFunctions::executeProgram('lsusb', (PSI_OS != 'Android')?'':'2>/dev/null', $bufr, PSI_DEBUG && (PSI_OS != 'Android'), 5) && ($bufr !== "")) {
$bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
foreach ($bufe ... | [
"protected",
"function",
"_usb",
"(",
")",
"{",
"$",
"usbarray",
"=",
"array",
"(",
")",
";",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'lsusb'",
",",
"(",
"PSI_OS",
"!=",
"'Android'",
")",
"?",
"''",
":",
"'2>/dev/null'",
",",
"$",
"... | USB devices
@return void | [
"USB",
"devices"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Linux.inc.php#L716-L856 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._i2c | protected function _i2c()
{
$i2cdevices = glob('/sys/bus/i2c/devices/*/name', GLOB_NOSORT);
if (is_array($i2cdevices) && (($total = count($i2cdevices)) > 0)) {
$buf = "";
for ($i = 0; $i < $total; $i++) {
if (CommonFunctions::rfts($i2cdevices[$i], $buf, 1, 409... | php | protected function _i2c()
{
$i2cdevices = glob('/sys/bus/i2c/devices/*/name', GLOB_NOSORT);
if (is_array($i2cdevices) && (($total = count($i2cdevices)) > 0)) {
$buf = "";
for ($i = 0; $i < $total; $i++) {
if (CommonFunctions::rfts($i2cdevices[$i], $buf, 1, 409... | [
"protected",
"function",
"_i2c",
"(",
")",
"{",
"$",
"i2cdevices",
"=",
"glob",
"(",
"'/sys/bus/i2c/devices/*/name'",
",",
"GLOB_NOSORT",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"i2cdevices",
")",
"&&",
"(",
"(",
"$",
"total",
"=",
"count",
"(",
"$",
... | I2C devices
@return void | [
"I2C",
"devices"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Linux.inc.php#L863-L876 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._nvme | protected function _nvme()
{
if (CommonFunctions::executeProgram('nvme', 'list', $bufr, PSI_DEBUG) && ($bufr!="")) {
$bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
$count = 0;
$nlocate = array();
$nsize = array();
foreach ($bufe as $bu... | php | protected function _nvme()
{
if (CommonFunctions::executeProgram('nvme', 'list', $bufr, PSI_DEBUG) && ($bufr!="")) {
$bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
$count = 0;
$nlocate = array();
$nsize = array();
foreach ($bufe as $bu... | [
"protected",
"function",
"_nvme",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"executeProgram",
"(",
"'nvme'",
",",
"'list'",
",",
"$",
"bufr",
",",
"PSI_DEBUG",
")",
"&&",
"(",
"$",
"bufr",
"!=",
"\"\"",
")",
")",
"{",
"$",
"bufe",
"=",
"preg... | NVMe devices
@return void | [
"NVMe",
"devices"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Linux.inc.php#L883-L954 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._network | protected function _network()
{
if (CommonFunctions::rfts('/proc/net/dev', $bufr, 0, 4096, PSI_DEBUG)) {
$bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
foreach ($bufe as $buf) {
if (preg_match('/:/', $buf)) {
list($dev_name, $stats_lis... | php | protected function _network()
{
if (CommonFunctions::rfts('/proc/net/dev', $bufr, 0, 4096, PSI_DEBUG)) {
$bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
foreach ($bufe as $buf) {
if (preg_match('/:/', $buf)) {
list($dev_name, $stats_lis... | [
"protected",
"function",
"_network",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"rfts",
"(",
"'/proc/net/dev'",
",",
"$",
"bufr",
",",
"0",
",",
"4096",
",",
"PSI_DEBUG",
")",
")",
"{",
"$",
"bufe",
"=",
"preg_split",
"(",
"\"/\\n/\"",
",",
"$"... | Network devices
includes also rx/tx bytes
@return void | [
"Network",
"devices",
"includes",
"also",
"rx",
"/",
"tx",
"bytes"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Linux.inc.php#L962-L1206 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._memory | protected function _memory()
{
if (CommonFunctions::rfts('/proc/meminfo', $mbuf)) {
$bufe = preg_split("/\n/", $mbuf, -1, PREG_SPLIT_NO_EMPTY);
foreach ($bufe as $buf) {
if (preg_match('/^MemTotal:\s+(\d+)\s*kB/i', $buf, $ar_buf)) {
$this->sys->set... | php | protected function _memory()
{
if (CommonFunctions::rfts('/proc/meminfo', $mbuf)) {
$bufe = preg_split("/\n/", $mbuf, -1, PREG_SPLIT_NO_EMPTY);
foreach ($bufe as $buf) {
if (preg_match('/^MemTotal:\s+(\d+)\s*kB/i', $buf, $ar_buf)) {
$this->sys->set... | [
"protected",
"function",
"_memory",
"(",
")",
"{",
"if",
"(",
"CommonFunctions",
"::",
"rfts",
"(",
"'/proc/meminfo'",
",",
"$",
"mbuf",
")",
")",
"{",
"$",
"bufe",
"=",
"preg_split",
"(",
"\"/\\n/\"",
",",
"$",
"mbuf",
",",
"-",
"1",
",",
"PREG_SPLIT_... | 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.Linux.inc.php#L1213-L1248 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._filesystems | private function _filesystems()
{
$df_args = "";
$hideFstypes = array();
if (defined('PSI_HIDE_FS_TYPES') && is_string(PSI_HIDE_FS_TYPES)) {
if (preg_match(ARRAY_EXP, PSI_HIDE_FS_TYPES)) {
$hideFstypes = eval(PSI_HIDE_FS_TYPES);
} else {
... | php | private function _filesystems()
{
$df_args = "";
$hideFstypes = array();
if (defined('PSI_HIDE_FS_TYPES') && is_string(PSI_HIDE_FS_TYPES)) {
if (preg_match(ARRAY_EXP, PSI_HIDE_FS_TYPES)) {
$hideFstypes = eval(PSI_HIDE_FS_TYPES);
} else {
... | [
"private",
"function",
"_filesystems",
"(",
")",
"{",
"$",
"df_args",
"=",
"\"\"",
";",
"$",
"hideFstypes",
"=",
"array",
"(",
")",
";",
"if",
"(",
"defined",
"(",
"'PSI_HIDE_FS_TYPES'",
")",
"&&",
"is_string",
"(",
"PSI_HIDE_FS_TYPES",
")",
")",
"{",
"i... | filesystem information
@return void | [
"filesystem",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Linux.inc.php#L1255-L1278 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._distro | protected function _distro()
{
$this->sys->setDistribution("Linux");
$list = @parse_ini_file(PSI_APP_ROOT."/data/distros.ini", true);
if (!$list) {
return;
}
// We have the '2>/dev/null' because Ubuntu gives an error on this command which causes the distro to be u... | php | protected function _distro()
{
$this->sys->setDistribution("Linux");
$list = @parse_ini_file(PSI_APP_ROOT."/data/distros.ini", true);
if (!$list) {
return;
}
// We have the '2>/dev/null' because Ubuntu gives an error on this command which causes the distro to be u... | [
"protected",
"function",
"_distro",
"(",
")",
"{",
"$",
"this",
"->",
"sys",
"->",
"setDistribution",
"(",
"\"Linux\"",
")",
";",
"$",
"list",
"=",
"@",
"parse_ini_file",
"(",
"PSI_APP_ROOT",
".",
"\"/data/distros.ini\"",
",",
"true",
")",
";",
"if",
"(",
... | Distribution
@return void | [
"Distribution"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Linux.inc.php#L1285-L1599 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux._processes | protected function _processes()
{
$process = glob('/proc/*/status', GLOB_NOSORT);
if (is_array($process) && (($total = count($process)) > 0)) {
$processes['*'] = 0;
$buf = "";
for ($i = 0; $i < $total; $i++) {
if (CommonFunctions::rfts($process[$i]... | php | protected function _processes()
{
$process = glob('/proc/*/status', GLOB_NOSORT);
if (is_array($process) && (($total = count($process)) > 0)) {
$processes['*'] = 0;
$buf = "";
for ($i = 0; $i < $total; $i++) {
if (CommonFunctions::rfts($process[$i]... | [
"protected",
"function",
"_processes",
"(",
")",
"{",
"$",
"process",
"=",
"glob",
"(",
"'/proc/*/status'",
",",
"GLOB_NOSORT",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"process",
")",
"&&",
"(",
"(",
"$",
"total",
"=",
"count",
"(",
"$",
"process",
... | Processes
@return void | [
"Processes"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Linux.inc.php#L1606-L1629 |
phpsysinfo/phpsysinfo | includes/os/class.Linux.inc.php | Linux.build | public function build()
{
if (!$this->blockname || $this->blockname==='vitals') {
$this->_distro();
$this->_hostname();
$this->_kernel();
$this->_uptime();
$this->_users();
$this->_loadavg();
$this->_processes();
}
... | php | public function build()
{
if (!$this->blockname || $this->blockname==='vitals') {
$this->_distro();
$this->_hostname();
$this->_kernel();
$this->_uptime();
$this->_users();
$this->_loadavg();
$this->_processes();
}
... | [
"public",
"function",
"build",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"blockname",
"||",
"$",
"this",
"->",
"blockname",
"===",
"'vitals'",
")",
"{",
"$",
"this",
"->",
"_distro",
"(",
")",
";",
"$",
"this",
"->",
"_hostname",
"(",
")",
... | get the information
@see PSI_Interface_OS::build()
@return Void | [
"get",
"the",
"information"
] | train | https://github.com/phpsysinfo/phpsysinfo/blob/0f8d250045c7f5b5f8e721ae195fcfdf73e4eeba/includes/os/class.Linux.inc.php#L1638-L1668 |
phpsysinfo/phpsysinfo | plugins/snmppinfo/class.snmppinfo.inc.php | SNMPPInfo.execute | public function execute()
{
if (empty($this->_filecontent)) {
return;
}
foreach ($this->_filecontent as $printer=>$result) {
$result = preg_replace('/End of MIB\r?\n/', '', $result);
$result = preg_replace('/\s\r?\n([^\.])/', ' $1', $result);
$... | php | public function execute()
{
if (empty($this->_filecontent)) {
return;
}
foreach ($this->_filecontent as $printer=>$result) {
$result = preg_replace('/End of MIB\r?\n/', '', $result);
$result = preg_replace('/\s\r?\n([^\.])/', ' $1', $result);
$... | [
"public",
"function",
"execute",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_filecontent",
")",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"_filecontent",
"as",
"$",
"printer",
"=>",
"$",
"result",
")",
"{",
"... | 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/snmppinfo/class.snmppinfo.inc.php#L177-L224 |
phpsysinfo/phpsysinfo | plugins/snmppinfo/class.snmppinfo.inc.php | SNMPPInfo.xml | public function xml()
{
foreach ($this->_result as $printer=>$markersupplies_item) {
$xmlsnmppinfo_printer = $this->xml->addChild("Printer");
$xmlsnmppinfo_printer->addAttribute("Device", $printer);
if (isset($markersupplies_item[1]) &&
isset($markersuppli... | php | public function xml()
{
foreach ($this->_result as $printer=>$markersupplies_item) {
$xmlsnmppinfo_printer = $this->xml->addChild("Printer");
$xmlsnmppinfo_printer->addAttribute("Device", $printer);
if (isset($markersupplies_item[1]) &&
isset($markersuppli... | [
"public",
"function",
"xml",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_result",
"as",
"$",
"printer",
"=>",
"$",
"markersupplies_item",
")",
"{",
"$",
"xmlsnmppinfo_printer",
"=",
"$",
"this",
"->",
"xml",
"->",
"addChild",
"(",
"\"Printer\"",
... | 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/snmppinfo/class.snmppinfo.inc.php#L231-L278 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.