获取权限组对应的权限列表
@param $gid
@param int $type
@return array|mixed
179689
public function getGroupAuthList($gid, $type = 1)
    {
        // 转换表名
        $auth_group = $this->config['auth_group'];
        $auth_rule = $this->config['auth_rule'];
        // 执行查询
        $rules = Db::name($auth_group)->where(['status'=>1, 'id'=>$gid])->value('rules');
        // 格式化access表id
        $ids = explode(',', trim($rules, ','));
        $ids = array_unique($ids);
        $map = array(
            'id' => ['in', $ids],
            'type' => $type,
            'status' => 1,
        );
        //读取用户组所有权限规则
        $rules = Db::name($auth_rule)->where($map)->column('title,name,condition');

        return $rules;
    }
794884
public function updateGroup($gid, $name = null) {
		$group = WechatUserGroup::findOne($gid);
		if(!$group) {
			throw new ErrorException('数据查询失败');
		}

		$data = $this->getData('/cgi-bin/groups/update', [
			'access_token' => $this->getAccessToken(),
		], Json::encode([
			'group' => ['id' => $group->gid, 'name' => $name ? : $group->name],
		]));

		$result = $this->errcode == 0;
		if($result && $name) {
			$group->name = $name;
			$group->save();
		}

		return $result;
	}
1306114
public static function fetchType($type): string
    {
        if(\is_int($type)) {
            switch($type) {
                case self::TYPE_UNKNOWN:
                    return "unknown";
                case self::TYPE_INT:
                    return "integer";
                case self::TYPE_LONG:
                    return "long";
                case self::TYPE_SHORT:
                    return "short";
                case self::TYPE_BOOLEAN:
                    return "boolean";
                case self::TYPE_FLOAT:
                    return "float";
                case self::TYPE_STRING:
                    return "string";
                case self::TYPE_CHAR:
                    return "char";
                case self::TYPE_VARCHAR:
                    return "varchar";
                case self::TYPE_ARRAY:
                    return "array";
                case self::TYPE_OBJECT:
                    return "object";
                case self::TYPE_DATE:
                    return "date";
            }
        }
        return (string) $type;
    }
883757
protected function getGraphQLType(?string $type):?string
    {
        switch ($type) {
            case DoctrineType::BOOLEAN:
                $type = Types::BOOLEAN;
                break;
            case DoctrineType::DECIMAL:
            case DoctrineType::FLOAT:
                $type = Types::FLOAT;
                break;
            case DoctrineType::INTEGER:
            case DoctrineType::BIGINT:
            case DoctrineType::SMALLINT:
                $type = Types::INT;
                break;
            case DoctrineType::STRING:
            case DoctrineType::TEXT:
            case DoctrineType::GUID:
                $type = Types::STRING;
                break;
            case DoctrineType::TARRAY:
            case DoctrineType::SIMPLE_ARRAY:
            case DoctrineType::JSON_ARRAY:
                $type = Types::nonNull(Types::listOf(Types::STRING));
                break;
            case DoctrineType::TIME:
            case DoctrineType::TIME_IMMUTABLE:
                $type = Types::TIME;
                break;
            case DoctrineType::DATE:
                $type = Types::DATE;
                break;
            case DoctrineType::DATETIME:
                $type = Types::DATETIME;
                break;
        }

        return $type;
    }
933264
public static function getList($pkgID = null)
    {
        $db = Database::connection();
        $queryBuilder = $db->createQueryBuilder()
            ->select('e.*')
            ->from('ConversationEditors', 'e')
            ->orderBy('cnvEditorHandle', 'asc');
        if ($pkgID !== null) {
            $queryBuilder->andWhere('e.pkgID = :pkgID')->setParameter('pkgID', $pkgID);
        }

        $cnvEditors = $db->fetchAll($queryBuilder->getSQL(), $queryBuilder->getParameters());
        $editors = array();
        foreach ($cnvEditors as $editorRecord) {
            $cnvEditor = static::createFromRecord($editorRecord);
            $editors[] = $cnvEditor;
        }

        return $editors;
    }
747517
public function getGid()
    {
        if (!array_key_exists(self::GID, $this->group)) {
            throw new \Exception('Could not get group\'s group id from group id.');
        }
        return $this->group[self::GID];
    }
616138
public function getRules(int $crud = NULL, string $type = NULL): array
    {
        // first pass to match crud filter
        if ($crud == NULL) {
            $ruleSet = $this->rules;
        } else {
            $ruleSet = [];
            foreach ($this->rules as $rule) {
                if ($rule->crud & $crud) {
                    $ruleSet[] = $rule;
                }
            }

        }

        // first pass to match crud filter
        if ($type == NULL) {
            return $ruleSet;
        } else {
            $filteredRuleSet = [];
            foreach ($ruleSet as $rule) {
                $reflection = new \ReflectionClass($rule);
                $className = $reflection->getShortName();
                if ($className == $type) {
                    $filteredRuleSet[] = $rule;
                }
            }
            return $filteredRuleSet;
        }
    }
942481
def gid
      return group.kind_of?(Integer) ? group : Etc.getgrnam(group.to_s).gid if group
      return Etc.getpwuid(uid).gid if using_login?
      nil
    end
677119
public function checkAvatar($uid, $size = 'middle', $type = 'virtual')
    {
        $url = $this->config['api'] . '/avatar.php';
        $query = [
            'uid' => (int)$uid,
            'size' => in_array(strtolower($size), ['big', 'middle', 'small']) ? strtolower($size) : 'big',
            'type' => in_array(strtolower($type), ['real', 'virtual']) ? strtolower($type) : 'virtual',
            'check_file_exists' => 1,
        ];

        $client = new \GuzzleHttp\Client([]);
        $response = $client->request('GET', $url, [
            'query' => $query
        ]);
        return $response->getBody()->getContents() == '1';
    }
588291
private function glyphToChar($gid)
	{
		return (ord($this->glyphIDtoUni[$gid * 3]) << 16) + (ord($this->glyphIDtoUni[$gid * 3 + 1]) << 8) + ord($this->glyphIDtoUni[$gid * 3 + 2]);
	}
1372458
@NotNull
    @ObjectiveCName("getGroupTypingWithGid:")
    public ValueModel<int[]> getGroupTyping(int gid) {
        return modules.getTypingModule().getGroupTyping(gid).getActive();
    }
182790
public static function getMeasures($type)
    {
        /** @var ActiveQuery $query */
        $query = static::find()->select(['name', 'id'])->indexBy('id');
        if (empty($type) === false) {
            $query->where(['type' => $type]);
        }
        return $query->column();
    }
954977
public function chown($uid, $gid = -1, $cb = null, $pri = EIO_PRI_DEFAULT)
    {
        $cb = CallbackWrapper::forceWrap($cb);
        if (!$this->fd) {
            if ($cb) {
                $cb($this, false);
            }
            return false;
        }
        if (!FileSystem::$supported) {
            $r = chown($this->path, $uid);
            if ($gid !== -1) {
                $r = $r && chgrp($this->path, $gid);
            }
            if ($cb) {
                $cb($this, $r);
            }
            return false;
        }
        return eio_fchown($this->fd, $uid, $gid, $pri, $cb, $this);
    }
1386
public static function getTypes($fid)
  {
    $parts = explode(':', $fid);
    switch(count($parts))
    {
      case 5:
        return [$parts[1], $parts[2]];
      case 4:
        return [$parts[1], $parts[1]];
      default:
        throw new InvalidFidException("Invalid FID Passed '$fid'", 500);
    }
  }
573537
public function unBindUid($uid, $fd)
    {
        //更新共享内存
        $in_table_uid = $this->uid_fd_table->get($uid);
        $in_table_fd = $this->fd_uid_table->get($fd);
        //判断共享内存中存储的uid与fd配对是否为当前要删除的配对，如果确认是，再进行删除
        if (!empty($in_table_uid) && $in_table_uid['fd'] == $fd) {
            $this->uid_fd_table->del($uid);
        }

        if (!empty($in_table_fd) && $in_table_fd['uid'] == $uid) {
            echo "\n 【当前共享内存中存储的fd与uid配对成功，进行删除】";
            $this->fd_uid_table->del($fd);
        }
        //这里无论是不是集群都需要调用
        ProcessManager::getInstance()->getRpcCall(ClusterProcess::class, true)->my_removeUid($uid);
        if (!$this->isCluster()) {
            get_instance()->pub('$SYS/uidcount', $this->uid_fd_table->count());
        }
    }
337451
public function findByGuidOrFail($guid, $columns = [])
    {
        if ($this->schema->objectGuidRequiresConversion()) {
            $guid = Utilities::stringGuidToHex($guid);
        }

        return $this->select($columns)->whereRaw([
            $this->schema->objectGuid() => $guid
        ])->firstOrFail();
    }
679313
public function getUserinfo($uid = null)
	{
		$ret = array();
		if (extension_loaded('posix')) {
			if (is_null($uid)) {
				$uid = posix_geteuid();	// get effective userid
			} elseif (is_string($uid)) {
				// username passed?
				$ret = posix_getpwnam($uid);
			}
			if (empty($ret)) {
				$ret = posix_getpwuid($uid);
			}
			$ret['group'] = posix_getgrgid($uid_info['gid']);
			unset($ret['gid']);	// is inside group array
		}
		return $ret;
	}