本文整理汇总了PHP中FileSystem::file_uid方法的典型用法代码示例。如果您正苦于以下问题:PHP FileSystem::file_uid方法的具体用法?PHP FileSystem::file_uid怎么用?PHP FileSystem::file_uid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSystem
的用法示例。
在下文中一共展示了FileSystem::file_uid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetExpectedPerms_file
static function GetExpectedPerms_file($file)
{
if (!FileSystem::HasFunctions()) {
return '666';
}
//if user id's match
$puid = posix_geteuid();
$suid = FileSystem::file_uid($file);
if ($suid !== false && $puid == $suid) {
return '644';
}
//if group id's match
$pgid = posix_getegid();
$sgid = FileSystem::file_group($file);
if ($sgid !== false && $pgid == $sgid) {
return '664';
}
//if user is a member of group
$snam = FileSystem::file_owner($file);
$pmem = FileSystem::process_members();
if (in_array($suid, $pmem) || in_array($snam, $pmem)) {
return '664';
}
return '666';
}
示例2: CheckFile
function CheckFile($path, $type = 'dir')
{
$current = '?';
$expected = '777';
$euid = '?';
if (FileSystem::HasFunctions()) {
$current = @substr(decoct(@fileperms($path)), -3);
if ($type == 'file') {
$expected = FileSystem::getExpectedPerms_file($path);
} else {
$expected = FileSystem::getExpectedPerms($path);
}
if (FileSystem::perm_compare($expected, $current)) {
$this->passed_count++;
return;
}
$euid = FileSystem::file_uid($path);
} elseif (gp_is_writable($path)) {
$this->passed_count++;
return;
}
$this->failed_count++;
if ($this->failed_count > $this->show_failed_max) {
return;
}
echo '<tr><td>';
echo substr($path, $this->check_dir_len);
echo '</td><td>';
echo $current;
echo '</td><td>';
echo $expected;
echo '</td><td>';
echo $euid;
echo '</td><td>';
echo $this->euid;
echo '</td></tr>';
}