本文整理汇总了PHP中CommonFunctions::gdc方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonFunctions::gdc方法的具体用法?PHP CommonFunctions::gdc怎么用?PHP CommonFunctions::gdc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonFunctions
的用法示例。
在下文中一共展示了CommonFunctions::gdc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _ide
/**
* IDE devices
*
* @return void
*/
private function _ide()
{
$bufd = CommonFunctions::gdc('/proc/ide', false);
foreach ($bufd as $file) {
if (preg_match('/^hd/', $file)) {
$dev = new HWDevice();
$dev->setName(trim($file));
if (CommonFunctions::rfts("/proc/ide/" . $file . "/media", $buf, 1)) {
if (trim($buf) == 'disk') {
if (CommonFunctions::rfts("/proc/ide/" . $file . "/capacity", $buf, 1, 4096, false) || CommonFunctions::rfts("/sys/block/" . $file . "/size", $buf, 1, 4096, false)) {
$dev->setCapacity(trim($buf) * 512 / 1024);
}
}
}
if (CommonFunctions::rfts("/proc/ide/" . $file . "/model", $buf, 1)) {
$dev->setName($dev->getName() . ": " . trim($buf));
}
$this->sys->setIdeDevices($dev);
}
}
}
示例2: _getLanguageList
/**
* get all available translations and store them in internal array
*
* @return void
*/
private function _getLanguageList()
{
$dirlist = CommonFunctions::gdc(APP_ROOT . '/language/');
sort($dirlist);
foreach ($dirlist as $file) {
$lang_ext = substr($file, strlen($file) - 4);
$lang_name = substr($file, 0, strlen($file) - 4);
if ($lang_ext == ".xml") {
array_push($this->_languages, $lang_name);
}
}
}
示例3: CronTime
private function CronTime() {
$crons = CommonFunctions::gdc('/etc/cron.d/');
$file = '';
foreach($crons as $cron) {
$path = '/etc/cron.d/'.$cron;
if(is_file($path) && $cron == 'lcse3-monitor') {
$file = $path;
break;
}
}
if($file == '')
return;
if(CommonFunctions::rfts($file, $buffer)) {
$lines = explode("\n",$buffer);
foreach($lines as $line) {
if(empty($line) || $line[0] == '#' || ereg("(.*)=(.*)", $line, $assign) || $line[0] == '@')
continue;
else {
$data = explode(" ", $line, 7);
break;
}
}
if($data == array())
return;
list($minute, $heure, $jour, $mois, $jourSemaine, $user, $cmd) = $data;
$cron = new CronParser();
$cron->calcNextRan(implode(" ", array($minute, $heure, $jour, $mois, $jourSemaine)));
$stamp = $cron->getLastRanUnix();
return '<NextUpdate unix="'.$stamp.'">'.date('r',$stamp).'</NextUpdate>';
}
}