导入账户
@param string $identifier
@param string $nickname
@param string $faceUrl
@param int $type
@return BaseResponse
@throws Exception\TIMException
508580
public function accountImport($identifier, $nickname, $faceUrl, $type = 0)
    {
        $request = new AccountImportRequest($identifier, $nickname, $faceUrl, $type);
        $response = new BaseResponse();
        return $this->client->sendRequest($request, $response);
    }
387349
protected function createParsedIdentifier(SchemaIdentifierInterface $identifier): ParserIdentifierInterface
    {
        return $this->factory->createParsedIdentifier($this->position, $identifier);
    }
436249
public function getCache(string $identifier): FrontendInterface
    {
        if ($this->hasCache($identifier) === false) {
            throw new NoSuchCacheException('A cache with identifier "' . $identifier . '" does not exist.', 1203699034);
        }
        if (!isset($this->caches[$identifier])) {
            $this->createCache($identifier);
        }

        return $this->caches[$identifier];
    }
23292
private function doLTI11Service($type, $url, $xml)
    {

        $ok = false;
        $this->extRequest = null;
        $this->extRequestHeaders = '';
        $this->extResponse = null;
        $this->extResponseHeaders = '';
        if (!empty($url)) {
            $id = uniqid();
            $xmlRequest = <<< EOD
<?xml version = "1.0" encoding = "UTF-8"?>
<imsx_POXEnvelopeRequest xmlns = "http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0">
  <imsx_POXHeader>
    <imsx_POXRequestHeaderInfo>
      <imsx_version>V1.0</imsx_version>
      <imsx_messageIdentifier>{$id}</imsx_messageIdentifier>
    </imsx_POXRequestHeaderInfo>
  </imsx_POXHeader>
  <imsx_POXBody>
    <{$type}Request>
{$xml}
    </{$type}Request>
  </imsx_POXBody>
</imsx_POXEnvelopeRequest>
EOD;
// Calculate body hash
            $hash = base64_encode(sha1($xmlRequest, true));
            $params = array('oauth_body_hash' => $hash);

// Add OAuth signature
            $hmacMethod = new OAuth\OAuthSignatureMethod_HMAC_SHA1();
            $consumer = new OAuth\OAuthConsumer($this->getConsumer()->getKey(), $this->getConsumer()->secret, null);
            $req = OAuth\OAuthRequest::from_consumer_and_token($consumer, null, 'POST', $url, $params);
            $req->sign_request($hmacMethod, $consumer, null);
            $params = $req->get_parameters();
            $header = $req->to_header();
            $header .= "\nContent-Type: application/xml";
// Connect to tool consumer
            $http = new HTTPMessage($url, 'POST', $xmlRequest, $header);
// Parse XML response
            if ($http->send()) {
                $this->extResponse = $http->response;
                $this->extResponseHeaders = $http->responseHeaders;
                try {
                    $this->extDoc = new DOMDocument();
                    $this->extDoc->loadXML($http->response);
                    $this->extNodes = $this->domnodeToArray($this->extDoc->documentElement);
                    if (isset($this->extNodes['imsx_POXHeader']['imsx_POXResponseHeaderInfo']['imsx_statusInfo']['imsx_codeMajor']) &&
                        ($this->extNodes['imsx_POXHeader']['imsx_POXResponseHeaderInfo']['imsx_statusInfo']['imsx_codeMajor'] === 'success')) {
                        $ok = true;
                    }
                } catch (\Exception $e) {
                }
            }
            $this->extRequest = $http->request;
            $this->extRequestHeaders = $http->requestHeaders;
        }

        return $ok;

    }
1042609
public function add(SourceTypeInterface $type, $alias)
    {
        if ($alias !== $type->getName()) {
            throw new SourceTypeException(sprintf('Mapper source type %s alias is not valid!', $alias));
        }

        $this->types[$alias] = $type;
    }
881746
public static function start($identifier = null, $addInfo = null)
    {
        if (!self::$_enabled) return null;
        return new Kwf_Benchmark_Profile($identifier, $addInfo);
    }
1316183
public function getClient($identifier)
    {
        if ($identifier !== PgArray::getSubType($identifier)) {
            return parent::getClient('array');
        } else {
            return parent::getClient($identifier);
        }
    }
828008
public static FaceAPI authenticate(String baseUrl, final String subscriptionKey) {
        ServiceClientCredentials serviceClientCredentials = new ServiceClientCredentials() {
            @Override
            public void applyCredentialsFilter(OkHttpClient.Builder builder) {
                builder.addNetworkInterceptor(
                        new Interceptor() {
                            @Override
                            public Response intercept(Chain chain) throws IOException {
                                Request request = null;
                                Request original = chain.request();
                                // Request customization: add request headers
                                Request.Builder requestBuilder = original.newBuilder()
                                        .addHeader("Ocp-Apim-Subscription-Key", subscriptionKey);
                                request = requestBuilder.build();
                                return chain.proceed(request);
                            }
                        });
            }
        };
        return authenticate(baseUrl, serviceClientCredentials);
    }
236390
public function read(int $identifier): ?TokenInterface
    {
        try {
            return $this->readResource($identifier);
        } catch (RepositoryException $exception) {
            $message = 'Token reading failed.';
            throw new RepositoryException($message, 0, $exception);
        }
    }
999468
protected static function getRatingByStringIdentifier(string $identifier): int
    {
        switch ($identifier) {
            case 's':
                return PostInterface::RATING_SAFE;

            case 'q':
                return PostInterface::RATING_QUESTIONABLE;

            case 'e':
                return PostInterface::RATING_EXPLICIT;

            default:
                throw new InvalidArgumentException('Unknown rating identifier');
        }
    }
144091
public function loadObjectStateGroupDataByIdentifier($identifier)
    {
        try {
            return $this->innerGateway->loadObjectStateGroupDataByIdentifier($identifier);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
527658
public function retrieveByToken($identifier, $token) {
        /** @var RecordInterface|Authenticatable $userRecord */
        if (!$this->isValidIdentifierValue($identifier)) {
            return null;
        }
        $userRecord = $this->createEmptyUserRecord();
        /** @var RecordInterface $user */
        $user = $userRecord->fromDb([
            $userRecord->getAuthIdentifierName() => $identifier,
            $userRecord->getRememberTokenName() => $token,
        ], [], $this->getRelationsToFetch());

        return $this->validateUser($user, null);
    }
502691
public static function doEscapeIdentifier($Identifier, $instance=null) {
		self::prepareInstance($instance);
		return self::$instances[$instance]->escapeIdentifier($Identifier);
	}
823397
public function getVenue(Identifier $identifier)
    {
        $url = $this->getUrl(sprintf('venues/%s', urlencode($identifier)));

        $response = $this->httpClient->get($url, $this->getDefaultHeaders());

        $content = $this->parseResponse($response);

        if (!isset($content->response->venue)) {
            throw InvalidResponseException::invalidResponseBody($response, 'response.venue');
        }

        return $this->venueFactory->create(new Description($content->response->venue));
    }
1010956
public function submitItem($identifier, $item)
    {
        $job = $this->getJobFromId($identifier);
        if ($job === null) {
            throw new \RuntimeException(
                "The identifier does not exist: $identifier"
            );
        }
        $idNum = $job->id();
        return $this->processor->submit($item, $idNum);
    }
485231
public function getByIdentifier(Identifier $identifier)
    {
        $className = $identifier->class->getName();
        $mapId     = $identifier->getSerialized();

        return $this->identityMap[$className][$mapId];
    }
598259
static function fetchByIdentifier( $identifier, $asObject = true )
    {
        return eZPersistentObject::fetchObject( eZContentObjectAttribute::definition(),
                                                null,
                                                array( 'sort_key_string' => $identifier, 'data_type_string' => 'ezstring' ),
                                                $asObject );
    }