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


PHP Monitor::_getOwnerAndGroup方法代码示例

本文整理汇总了PHP中Monitor::_getOwnerAndGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP Monitor::_getOwnerAndGroup方法的具体用法?PHP Monitor::_getOwnerAndGroup怎么用?PHP Monitor::_getOwnerAndGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Monitor的用法示例。


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

示例1: checkConfiguration

 /**
  * Checks on the status of the required configuration and auxiliary files
  * and directories.
  *
  * @access  public
  * @param   array $required_files An array of files that should be checked on.
  */
 function checkConfiguration($required_files)
 {
     foreach ($required_files as $file_path => $options) {
         // check if file exists
         if (!file_exists($file_path)) {
             echo "ERROR: File could not be found (path: {$file_path})\n";
             continue;
         }
         // check the owner and group for these files
         list($owner, $group) = Monitor::_getOwnerAndGroup($file_path);
         if (@$options['check_owner'] && $options['owner'] != $owner) {
             echo "ERROR: File owner mismatch (path: {$file_path}; current owner: {$owner}; correct owner: " . $options['owner'] . ")\n";
         }
         if (@$options['check_group'] && $options['group'] != $group) {
             echo "ERROR: File group mismatch (path: {$file_path}; current group: {$group}; correct group: " . $options['group'] . ")\n";
         }
         // check permission bits
         $perm = Monitor::_getOctalPerms($file_path);
         if (@$options['check_permission'] && $options['permission'] != $perm) {
             echo "ERROR: File permission mismatch (path: {$file_path}; current perm: {$perm}; correct perm: " . $options['permission'] . ")\n";
         }
         // check filesize
         if (@$options['check_filesize'] && filesize($file_path) < $options['filesize']) {
             echo "ERROR: File size mismatch (path: {$file_path}; current filesize: " . filesize($file_path) . ")\n";
         }
     }
     $required_directories = array(APP_PATH . 'misc/routed_emails' => array('check_permission' => true, 'permission' => 770), APP_PATH . 'misc/routed_notes' => array('check_permission' => true, 'permission' => 770), APP_PATH . 'setup' => array('check_permission' => true, 'permission' => 100));
     foreach ($required_directories as $dir_path => $options) {
         // check if directory exists
         if (!file_exists($dir_path)) {
             echo "ERROR: Directory could not be found (path: {$dir_path})\n";
             continue;
         }
         // check permission bits
         $perm = Monitor::_getOctalPerms($dir_path);
         if (@$options['check_permission'] && $options['permission'] != $perm) {
             echo "ERROR: Directory permission mismatch (path: {$dir_path}; current perm: {$perm}; correct perm: " . $options['permission'] . ")\n";
         }
     }
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:47,代码来源:class.monitor.php


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