intval($perm2{0})) { return false; } if (intval($perm1{1}) > intval($perm2{1})) { return false; } if (intval($perm1{2}) > intval($perm2{2})) { return false; } return true; } public static function ValidPermission(&$permission){ if( strlen($permission) == 3 ){ return true; } if( strlen($permission) == 4 ){ if( intval($permission{0}) === 0 ){ $permission = substr($permission,1); return true; } } return false; } /** * @description Gets name of the file owner * @return string The name of the file owner * */ public static function file_owner($file) { $info = self::file_info($file); if (is_array($info)) { if (isset($info['name'])) { return $info['name']; } else if (isset($info['uid'])) { return $info['uid']; } } return false; } /** * @description Gets Groups members of the PHP Engine * @return array The Group members of the PHP Engine * */ public static function process_members() { $info = self::process_info(); if (isset($info['members'])) { return $info['members']; } return array(); } /** * @description Gets User ID of the file owner * @return int The user ID of the file owner * */ public static function file_uid($file) { $info = self::file_info($file); if (is_array($info)) { if (isset($info['uid'])) { return $info['uid']; } } return false; } /** * @description Gets Group ID of the file owner * @return int The user Group of the file owner * */ public static function file_group($file) { $info = self::file_info($file); if (is_array($info) && isset($info['gid'])) { return $info['gid']; } return false; } /** * @description Gets Info array of the file owner * @return array The Info array of the file owner * */ public static function file_info($file) { return posix_getpwuid(@fileowner($file)); } /** * @description Gets Group Info of the PHP Engine * @return array The Group Info of the PHP Engine * */ public static function process_info() { return posix_getgrgid(posix_getegid()); } }