当前位置: 首页>>代码示例>>PHP>>正文


PHP hide_mount函数代码示例

本文整理汇总了PHP中hide_mount函数的典型用法代码示例。如果您正苦于以下问题:PHP hide_mount函数的具体用法?PHP hide_mount怎么用?PHP hide_mount使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了hide_mount函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parse_filesystems

 function parse_filesystems()
 {
     global $show_bind, $show_inodes;
     $j = 0;
     $df = execute_program('df', '-k' . $this->df_param);
     $df = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
     if ($show_inodes) {
         $df2 = execute_program('df', '-i' . $this->df_param);
         $df2 = preg_split("/\n/", $df2, -1, PREG_SPLIT_NO_EMPTY);
     }
     $mount = execute_program('mount');
     $mount = preg_split("/\n/", $mount, -1, PREG_SPLIT_NO_EMPTY);
     foreach ($df as $df_line) {
         $df_buf1 = preg_split("/(\\%\\s)/", $df_line, 2);
         if (count($df_buf1) != 2) {
             continue;
         }
         preg_match("/(.*)(\\s+)(([0-9]+)(\\s+)([0-9]+)(\\s+)([0-9]+)(\\s+)([0-9]+)\$)/", $df_buf1[0], $df_buf2);
         $df_buf = array($df_buf2[1], $df_buf2[4], $df_buf2[6], $df_buf2[8], $df_buf2[10], $df_buf1[1]);
         if ($show_inodes) {
             preg_match_all("/([0-9]+)%/", $df2[$j + 1], $inode_buf, PREG_SET_ORDER);
         }
         if (count($df_buf) == 6) {
             if (hide_mount($df_buf[5])) {
                 continue;
             }
             $df_buf[0] = trim(str_replace("\$", "\\\$", $df_buf[0]));
             $df_buf[5] = trim($df_buf[5]);
             $current = 0;
             foreach ($mount as $mount_line) {
                 $current++;
                 if (preg_match("#" . $df_buf[0] . " on " . $df_buf[5] . " type (.*) \\((.*)\\)#", $mount_line, $mount_buf)) {
                     $mount_buf[1] .= "," . $mount_buf[2];
                 } elseif (!preg_match("#" . $df_buf[0] . "(.*) on " . $df_buf[5] . " \\((.*)\\)#", $mount_line, $mount_buf)) {
                     continue;
                 }
                 if ($show_bind || !stristr($mount_buf[2], "bind")) {
                     $results[$j] = array();
                     $results[$j]['disk'] = str_replace("\\\$", "\$", $df_buf[0]);
                     $results[$j]['size'] = $df_buf[1];
                     $results[$j]['used'] = $df_buf[2];
                     $results[$j]['free'] = $df_buf[3];
                     $results[$j]['percent'] = round($results[$j]['used'] * 100 / $results[$j]['size']);
                     $results[$j]['mount'] = $df_buf[5];
                     $results[$j]['fstype'] = substr($mount_buf[1], 0, strpos($mount_buf[1], ","));
                     $results[$j]['options'] = substr($mount_buf[1], strpos($mount_buf[1], ",") + 1, strlen($mount_buf[1]));
                     if ($show_inodes && isset($inode_buf[count($inode_buf) - 1][1])) {
                         $results[$j]['inodes'] = $inode_buf[count($inode_buf) - 1][1];
                     }
                     $j++;
                     unset($mount[$current - 1]);
                     sort($mount);
                     break;
                 }
             }
         }
     }
     return $results;
 }
开发者ID:shamimhasan,项目名称:Vtiger-CRM-5.4.0,代码行数:59,代码来源:class.parseProgs.inc.php

示例2: filesystems

 public function filesystems()
 {
     if (!execute_program('df', '-k', $df, $this->debug)) {
         $df = '';
     }
     $mounts = split("\n", $df);
     if (!execute_program('df', '-n', $dftypes, $this->debug)) {
         $dftypes = '';
     }
     $mounttypes = split("\n", $dftypes);
     for ($i = 1, $j = 0, $max = sizeof($mounts); $i < $max; $i++) {
         $ar_buf = preg_split('/\\s+/', $mounts[$i], 6);
         $ty_buf = split(':', $mounttypes[$i - 1], 2);
         if (hide_mount($ar_buf[5])) {
             continue;
         }
         $results[$j] = array();
         $results[$j]['disk'] = $ar_buf[0];
         $results[$j]['size'] = $ar_buf[1];
         $results[$j]['used'] = $ar_buf[2];
         $results[$j]['free'] = $ar_buf[3];
         $results[$j]['percent'] = round($results[$j]['used'] * 100 / $results[$j]['size']);
         $results[$j]['mount'] = $ar_buf[5];
         $results[$j]['fstype'] = $ty_buf[1];
         $j++;
     }
     return $results;
 }
开发者ID:rohdoor,项目名称:ehcp,代码行数:28,代码来源:class.SunOS.inc.php

示例3: filesystems

 public function filesystems()
 {
     $typearray = array("Unknown", "No Root Directory", "Removable Disk", "Local Disk", "Network Drive", "Compact Disc", "RAM Disk");
     $floppyarray = array("Unknown", "5 1/4 in.", "3 1/2 in.", "3 1/2 in.", "3 1/2 in.", "3 1/2 in.", "5 1/4 in.", "5 1/4 in.", "5 1/4 in.", "5 1/4 in.", "5 1/4 in.", "Other", "HD", "3 1/2 in.", "3 1/2 in.", "5 1/4 in.", "5 1/4 in.", "3 1/2 in.", "3 1/2 in.", "5 1/4 in.", "3 1/2 in.", "3 1/2 in.", "8 in.");
     $buffer = $this->GetWMI("Win32_LogicalDisk", array("Name", "Size", "FreeSpace", "FileSystem", "DriveType", "MediaType"));
     $k = 0;
     foreach ($buffer as $filesystem) {
         if (hide_mount($filesystem["Name"])) {
             continue;
         }
         $results[$k]['mount'] = $filesystem["Name"];
         $results[$k]['size'] = $filesystem["Size"] / 1024;
         $results[$k]['used'] = ($filesystem["Size"] - $filesystem["FreeSpace"]) / 1024;
         $results[$k]['free'] = $filesystem["FreeSpace"] / 1024;
         @($results[$k]['percent'] = ceil($results[$k]['used'] / $results[$k]['size'] * 100));
         // silence this line, nobody is having a floppy in the drive everytime
         $results[$k]['fstype'] = $filesystem["FileSystem"];
         $results[$k]['disk'] = $typearray[$filesystem["DriveType"]];
         if ($filesystem["MediaType"] != "" && $filesystem["DriveType"] == 2) {
             $results[$k]['disk'] .= " (" . $floppyarray[$filesystem["MediaType"]] . ")";
         }
         $k += 1;
     }
     return $results;
 }
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:25,代码来源:class.WINNT.inc.php

示例4: filesystems

  function filesystems () {
    $df = execute_program('df', '-k');
    $mounts = preg_split("/\n/", $df);

    $dftypes = execute_program('df', '-n');
    $mounttypes = preg_split("/\n/", $dftypes);

    for ($i = 1, $j = 0, $max = sizeof($mounts); $i < $max; $i++) {
      $ar_buf = preg_split('/\s+/', $mounts[$i], 6);
      $ty_buf = preg_split('/:/', $mounttypes[$i-1], 2);

      if (hide_mount($ar_buf[5])) {
        continue;
      }

      $results[$j] = array();

      $results[$j]['disk'] = $ar_buf[0];
      $results[$j]['size'] = $ar_buf[1];
      $results[$j]['used'] = $ar_buf[2];
      $results[$j]['free'] = $ar_buf[3];
      $results[$j]['percent'] = round(($results[$j]['used'] * 100) / $results[$j]['size']);
      $results[$j]['mount'] = $ar_buf[5];
      $results[$j]['fstype'] = $ty_buf[1];
      $j++;
    } 
    return $results;
  } 
开发者ID:nixonch,项目名称:a2billing,代码行数:28,代码来源:class.SunOS.inc.php

示例5: filesystems

  function filesystems () {
    $df = execute_program('df', '-kP');
    $mounts = preg_split("/\n/", $df);
    $fstype = array();

    $s = execute_program('mount', '-v');
    $lines = explode("\n", $s);

    $i = 0;
    while (list(, $line) = each($lines)) {
      $a = preg_split('/ /', $line);
      $fsdev[$a[0]] = $a[4];
    } 

    for ($i = 1, $j = 0, $max = sizeof($mounts); $i < $max; $i++) {
      $ar_buf = preg_split("/\s+/", $mounts[$i], 6);

      if (hide_mount($ar_buf[5])) {
        continue;
      }

      $results[$j] = array();

      $results[$j]['disk'] = $ar_buf[0];
      $results[$j]['size'] = $ar_buf[1];
      $results[$j]['used'] = $ar_buf[2];
      $results[$j]['free'] = $ar_buf[3];
      $results[$j]['percent'] = $ar_buf[4];
      $results[$j]['mount'] = $ar_buf[5];
      ($fstype[$ar_buf[5]]) ? $results[$j]['fstype'] = $fstype[$ar_buf[5]] : $results[$j]['fstype'] = $fsdev[$ar_buf[0]];
      $j++;
    } 
    return $results;
  } 
开发者ID:nixonch,项目名称:a2billing,代码行数:34,代码来源:class.HP-UX.inc.php

示例6: filesystems

 function filesystems()
 {
     global $show_bind;
     $fstype = array();
     $fsoptions = array();
     $df = execute_program('df', '-kP');
     $mounts = split("\n", $df);
     $buffer = execute_program("mount");
     $buffer = explode("\n", $buffer);
     $j = 0;
     foreach ($buffer as $line) {
         preg_match("/(.*) on (.*) type (.*) \\((.*)\\)/", $line, $result);
         if (count($result) == 5) {
             $dev = $result[1];
             $mpoint = $result[2];
             $type = $result[3];
             $options = $result[4];
             $fstype[$mpoint] = $type;
             $fsdev[$dev] = $type;
             $fsoptions[$mpoint] = $options;
             foreach ($mounts as $line2) {
                 if (preg_match("#^" . str_replace("\$", "\\\$", $result[1]) . "#", $line2)) {
                     $line2 = preg_replace("#^" . str_replace("\$", "\\\$", $result[1]) . "#", "", $line2);
                     $ar_buf = preg_split("/(\\s+)/", $line2, 6);
                     $ar_buf[0] = $result[1];
                     if (hide_mount($ar_buf[5]) || $ar_buf[0] == "") {
                         continue;
                     }
                     if ($show_bind || !stristr($fsoptions[$ar_buf[5]], "bind")) {
                         $results[$j] = array();
                         $results[$j]['disk'] = $ar_buf[0];
                         $results[$j]['size'] = $ar_buf[1];
                         $results[$j]['used'] = $ar_buf[2];
                         $results[$j]['free'] = $ar_buf[3];
                         $results[$j]['percent'] = round($results[$j]['used'] * 100 / $results[$j]['size']);
                         $results[$j]['mount'] = $ar_buf[5];
                         $fstype[$ar_buf[5]] ? $results[$j]['fstype'] = $fstype[$ar_buf[5]] : ($results[$j]['fstype'] = $fsdev[$ar_buf[0]]);
                         $results[$j]['options'] = $fsoptions[$ar_buf[5]];
                         $j++;
                     }
                 }
             }
         }
     }
     return $results;
 }
开发者ID:BackupTheBerlios,项目名称:nas4nega,代码行数:46,代码来源:class.Linux.inc.php

示例7: parse_filesystems

 public function parse_filesystems()
 {
     $results = array();
     $j = 0;
     if (execute_program('df', '-k' . $this->df_param, $df, $this->debug) || !empty($df)) {
         $df = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
         natsort($df);
         if (showInodes) {
             if (execute_program('df', '-i' . $this->df_param, $df2, $this->debug) || !empty($df)) {
                 $df2 = preg_split("/\n/", $df2, -1, PREG_SPLIT_NO_EMPTY);
                 // Store inode use% in an associative array (df_inodes) for later use
                 foreach ($df2 as $df2_line) {
                     if (preg_match("/^(\\S+).*\\s([0-9]+)%/", $df2_line, $inode_buf)) {
                         $df_inodes[$inode_buf[1]] = $inode_buf[2];
                     }
                 }
                 unset($df2, $df2_line, $inode_buf);
             }
         }
         if (execute_program('mount', '', $mount, $this->debug)) {
             $mount = preg_split("/\n/", $mount, -1, PREG_SPLIT_NO_EMPTY);
             foreach ($mount as $mount_line) {
                 if (preg_match("/\\S+ on (\\S+) type (.*) \\((.*)\\)/", $mount_line, $mount_buf)) {
                     $mount_parm[$mount_buf[1]]['fstype'] = $mount_buf[2];
                     $mount_parm[$mount_buf[1]]['options'] = $mount_buf[3];
                 } elseif (preg_match("/\\S+ (.*) on (\\S+) \\((.*)\\)/", $mount_line, $mount_buf)) {
                     $mount_parm[$mount_buf[2]]['fstype'] = $mount_buf[1];
                     $mount_parm[$mount_buf[2]]['options'] = $mount_buf[3];
                 } elseif (preg_match("/\\S+ on (\\S+) \\((\\S+)(,\\s(.*))?\\)/", $mount_line, $mount_buf)) {
                     $mount_parm[$mount_buf[1]]['fstype'] = $mount_buf[2];
                     $mount_parm[$mount_buf[1]]['options'] = isset($mount_buf[4]) ? $mount_buf[4] : '';
                 }
             }
             unset($mount, $mount_line, $mount_buf);
             foreach ($df as $df_line) {
                 $df_buf1 = preg_split("/(\\%\\s)/", $df_line, 2);
                 if (count($df_buf1) != 2) {
                     continue;
                 }
                 preg_match("/(.*)(\\s+)(([0-9]+)(\\s+)([0-9]+)(\\s+)([0-9]+)(\\s+)([0-9]+)\$)/", $df_buf1[0], $df_buf2);
                 $df_buf = array($df_buf2[1], $df_buf2[4], $df_buf2[6], $df_buf2[8], $df_buf2[10], $df_buf1[1]);
                 if (count($df_buf) == 6) {
                     $df_buf[5] = trim($df_buf[5]);
                     if (hide_mount($df_buf[5])) {
                         continue;
                     }
                     $df_buf[0] = trim(str_replace("\$", "\\\$", $df_buf[0]));
                     if (hide_fstype($mount_parm[$df_buf[5]]['fstype'])) {
                         continue;
                     }
                     if (!showBind && stristr($mount_parm[$df_buf[5]]['options'], "bind")) {
                         continue;
                     }
                     $results[$j] = array();
                     $results[$j]['disk'] = str_replace("\\\$", "\$", $df_buf[0]);
                     $results[$j]['size'] = $df_buf[1];
                     $results[$j]['used'] = $df_buf[2];
                     $results[$j]['free'] = $df_buf[3];
                     if ($results[$j]['used'] < 0) {
                         $results[$j]['size'] = $results[$j]['free'];
                         $results[$j]['free'] = 0;
                         $results[$j]['used'] = $results[$j]['size'];
                     }
                     if ($results[$j]['size'] == 0) {
                         continue;
                     }
                     $results[$j]['percent'] = round($results[$j]['used'] * 100 / $results[$j]['size']);
                     $results[$j]['mount'] = $df_buf[5];
                     $results[$j]['fstype'] = $mount_parm[$df_buf[5]]['fstype'];
                     $results[$j]['options'] = $mount_parm[$df_buf[5]]['options'];
                     if (showInodes && isset($df_inodes[$results[$j]['disk']])) {
                         $results[$j]['inodes'] = $df_inodes[$results[$j]['disk']];
                     }
                     $j++;
                 }
             }
             return $results;
         } else {
             return array();
         }
     } else {
         return array();
     }
 }
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:84,代码来源:class.parseProgs.inc.php

示例8: filesystems

 function filesystems()
 {
     $df = execute_program('df', '-k');
     $mounts = split("\n", $df);
     $fstype = array();
     $s = execute_program('mount');
     $lines = explode("\n", $s);
     $i = 0;
     while (list(, $line) = each($lines)) {
         ereg('(.*) \\((.*)\\)', $line, $a);
         $m = explode(' ', $a[0]);
         $fsdev[$m[0]] = $a[2];
     }
     for ($i = 1, $j = 0, $max = sizeof($mounts); $i < $max; $i++) {
         $ar_buf = preg_split("/\\s+/", $mounts[$i], 6);
         switch ($ar_buf[0]) {
             case 'automount':
                 // skip the automount entries
             // skip the automount entries
             case 'devfs':
                 // skip the dev filesystem
             // skip the dev filesystem
             case 'fdesc':
                 // skip the fdesc
             // skip the fdesc
             case 'procfs':
                 // skip the proc filesystem
             // skip the proc filesystem
             case '<volfs>':
                 // skip the vol filesystem
                 continue 2;
                 break;
         }
         if (hide_mount($ar_buf[5])) {
             continue;
         }
         $results[$j] = array();
         $results[$j]['disk'] = $ar_buf[0];
         $results[$j]['size'] = $ar_buf[1];
         $results[$j]['used'] = $ar_buf[2];
         $results[$j]['free'] = $ar_buf[3];
         $results[$j]['percent'] = $ar_buf[4];
         $results[$j]['mount'] = $ar_buf[5];
         $fstype[$ar_buf[5]] ? $results[$j]['fstype'] = $fstype[$ar_buf[5]] : ($results[$j]['fstype'] = $fsdev[$ar_buf[0]]);
         $j++;
     }
     return $results;
 }
开发者ID:hardikk,项目名称:HNH,代码行数:48,代码来源:class.Darwin.inc.php


注:本文中的hide_mount函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。