获取JSSDK签名.

@author Tian

@date   2015-12-08

@return string
5701
public function getSignature()
    {
        /** @var int $timestamp */
        $timestamp = $this->getTimeStamp();
        $nonceStr  = $this->getnonceStr();
        $ticket    = $this->getTicket();

        $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";

        $url = "$protocol$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";

        /** @var array $signature_array */
        $signature_array              = [];
        $signature_array['appId']     = $this->getAppId();
        $signature_array['nonceStr']  = $nonceStr;
        $signature_array['timestamp'] = $timestamp;
        $signature_array['signature'] = $this->getSignatures($ticket, $nonceStr, $timestamp, $url);

        return $signature_array;
    }
963648
public static function fullName()
    {
        $fullName = '';
        $format = static::$formats[array_rand(static::$formats)];

        foreach ($format as $functionName) {
            $fullName .= static::$functionName() . ' ';
        }

        return trim($fullName);
    }
1356981
public static function GetName () {
		$class_name = static::class;
		if (!isset(static::$_nameList[$class_name])) {
			if (defined($class_name.'::NAME')) {
				$name = $class_name::NAME;
			} else {
				preg_match("/^(.+)Model$/", str_replace("\\", '/', $class_name), $matches);
				$name = basename($matches[1]);
				if (static::$_useSnakeCase) {
					$name = Strings::ToSnakeCase($name);
				}
			}
			static::$_nameList[$class_name] = $name;
		}
		return static::$_nameList[$class_name];
	}
1005723
public function hiddenSid()
    {
        $sSid = $sToken = '';
        if ($this->isSidNeeded()) {
            $sSid = "<input type=\"hidden\" name=\"" . $this->getForcedName() . "\" value=\"" . $this->getId() . "\" />";
        }
        if ($this->getId()) {
            $sToken = "<input type=\"hidden\" name=\"stoken\" value=\"" . $this->getSessionChallengeToken() . "\" />";
        }

        return $sToken . $sSid;
    }
1122525
static function get_jsapi_signature($jsapi_ticket, $nonceStr, $timestamp, $url)
    {
        //排序
        try {
            $str = "jsapi_ticket=$jsapi_ticket&noncestr=$nonceStr&timestamp=$timestamp&url=$url";
            return sha1($str);
        } catch (\Exception $e) {
            @error_log('get_jsapi_signature Error: ' . $e->getMessage(), 0);
            return FALSE;
        }
    }
927219
public function getJavaScriptCode()
    {
        $realTranslations = [];
        $translationsBinding = [];

        foreach ($this->translations as $key => $value) {
            $hash = HashService::get()->getHash($value);
            $realTranslations[$hash] = $value;
            $translationsBinding[$key] = $hash;
        }

        $jsonRealTranslations = $this->handleRealTranslations(ArrayService::get()->arrayToJavaScriptJson($realTranslations));
        $jsonTranslationsBinding = $this->handleTranslationsBinding(ArrayService::get()->arrayToJavaScriptJson($translationsBinding));

        return <<<JS
Fz.Localization.addLocalization($jsonRealTranslations, $jsonTranslationsBinding);
JS;
    }
1287095
private function getUniqueKernelKey(): string
    {
        if ($this->undescoredKernelName !== null) {
            return $this->undescoredKernelName;
        }

        $classParts = explode('\\', self::class);

        $bareClassName = array_pop($classParts);
        $bareClassNameWithoutSuffix = Strings::substring($bareClassName, 0, -strlen('Kernel'));
        $bareClassNameWithoutSuffix = lcfirst($bareClassNameWithoutSuffix);

        $this->undescoredKernelName = Strings::replace(
            $bareClassNameWithoutSuffix,
            '#[A-Z]#',
            function (array $matches): string {
                return '_' . strtolower($matches[0]);
            }
        );

        return $this->undescoredKernelName;
    }
671585
protected function GetStepAsAjax($sStepName = null)
    {
        $sHTML = '';
        if (is_null($sStepName)) {
            $sStepName = $this->global->GetUserData('sStepName');
        }
        $oStep = TdbShopOrderStep::GetStep($sStepName);
        if ($oStep) {
            $sModuleSpotName = $this->sModuleSpotName;
            $sHTML = $oStep->Render($sModuleSpotName);
        }

        return $sHTML;
    }
1100914
protected function getNameInput()
    {
        $input = $input = studly_case(trim($this->argument('name')));
        $suffix = Config::get('service-classes.suffix');

        if (Config::get('service-classes.override_duplicate_suffix')) {
            return str_finish($input, $suffix);
        }

        return $input.$suffix;
    }
1071825
public function name() {
		$res = $this->_match;
		$count = count($res);

		if (empty($this->_stub['name'])) {
			return '';
		}
		$name = $this->_stub['name'];

		for ($i = 1; $i <= $count; $i++) {
			$name = str_ireplace('$' . $i, $res[$i - 1], $name);
		}
		return $name;
	}
235085
public function getName()
    {
        if ($this->name) {
            return $this->name;
        }
        // Get from composer
        $json = $this->getJson();
        if (isset($json['name'])) {
            $this->name = $json['name'];
        }
        return $this->name;
    }
319890
public function name()
    {
        $atoms = $this->atoms();
        $numAtoms = count($atoms);

        if ($numAtoms > 0) {
            return $atoms[$numAtoms - 1];
        }

        return '';
    }
1106266
final public function name(): string
    {
        if ($this->name === null) {
            $constants = self::getMembers();
            $this->name = array_search($this->value, $constants, true);
        }

        return $this->name;
    }
143501
protected function getName(): string
    {
        if (!isset($this->name) || !$this->name) {
            $this->name = @stream_socket_get_name($this->socket, true);
        }
        return $this->name;
    }
1166666
public function getDsn() {
		// Handle sqlite
		if ($this->driver === 'sqlite') {
			return "sqlite:$this->schema";
		}

		$opts = [];
		$opts['host'] = $this->host;

		if ($this->schema) {
			$opts['dbname'] = $this->schema;
		}

		$dsnOpts = array_merge([], $this->dsnOpts, $opts);
		return "$this->driver:" . implode(';', Map::zip('=', $dsnOpts));
	}
1129336
public function getJavaScriptCode()
    {
        $fieldsJavaScriptCode = [];
        $formConfiguration = $this->getFormObject()->getConfiguration();

        foreach ($formConfiguration->getFields() as $field) {
            $fieldsJavaScriptCode[] = $this->processField($field);
        }

        $formName = GeneralUtility::quoteJSvalue($this->getFormObject()->getName());
        $fieldsJavaScriptCode = implode(CRLF, $fieldsJavaScriptCode);

        return <<<JS
(function() {
    Fz.Form.get(
        $formName,
        function(form) {
            var field = null;

$fieldsJavaScriptCode
        }
    );
})();
JS;
    }
1278112
public function getToken() : string {
        if (($this->token === null) || ($this->token->isExpired())) {
            $jwtBuilder = new Builder();
            $jwtBuilder->set('iss', $this->credentialPublicKey);
            $jwtBuilder->set('sub', $this->userName);

            $this->token = $jwtBuilder
                ->sign(new Sha256(), $this->credentialPrivateKey)
                ->getToken();
        }

        return (string) $this->token;
    }