从第三方平台跳转至微信公众平台授权注册页面, 授权注册小程序.

@param string $callbackUrl
@param bool   $copyWxVerify

@return string
343286
public function getFastRegistrationUrl(string $callbackUrl, bool $copyWxVerify = true): string
    {
        $queries = [
            'copy_wx_verify' => $copyWxVerify,
            'component_appid' => $this->component['config']['app_id'],
            'appid' => $this->app['config']['app_id'],
            'redirect_uri' => $callbackUrl,
        ];

        return 'https://mp.weixin.qq.com/cgi-bin/fastregisterauth?'.http_build_query($queries);
    }
1227313
function _getProxyClassCode($r)
    {
        $this->debug("in getProxy endpointType=$this->endpointType");
        $this->appendDebug("wsdl=" . $this->varDump($this->wsdl));
        if ($this->endpointType != 'wsdl') {
            $evalStr = 'A proxy can only be created for a WSDL client';
            $this->setError($evalStr);
            $evalStr = "echo \"$evalStr\";";

            return $evalStr;
        }
        if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
            $this->loadWSDL();
            if ($this->getError()) {
                return "echo \"" . $this->getError() . "\";";
            }
        }
        $evalStr = '';
        foreach ($this->operations as $operation => $opData) {
            if ($operation != '') {
                // create param string and param comment string
                if (sizeof($opData['input']['parts']) > 0) {
                    $paramStr        = '';
                    $paramArrayStr   = '';
                    $paramCommentStr = '';
                    foreach ($opData['input']['parts'] as $name => $type) {
                        $paramStr        .= "\$$name, ";
                        $paramArrayStr   .= "'$name' => \$$name, ";
                        $paramCommentStr .= "$type \$$name, ";
                    }
                    $paramStr        = substr($paramStr, 0, strlen($paramStr) - 2);
                    $paramArrayStr   = substr($paramArrayStr, 0, strlen($paramArrayStr) - 2);
                    $paramCommentStr = substr($paramCommentStr, 0, strlen($paramCommentStr) - 2);
                } else {
                    $paramStr        = '';
                    $paramArrayStr   = '';
                    $paramCommentStr = 'void';
                }
                $opData['namespace'] = !isset($opData['namespace']) ? 'http://testuri.com' : $opData['namespace'];
                $evalStr             .= "// $paramCommentStr
	function " . str_replace('.', '__', $operation) . "($paramStr) {
		\$params = array($paramArrayStr);
		return \$this->call('$operation', \$params, '" . $opData['namespace'] . "', '" . (isset($opData['soapAction']) ? $opData['soapAction'] : '') . "');
	}
	";
                unset($paramStr);
                unset($paramCommentStr);
            }
        }
        $evalStr = 'class nusoap_proxy_' . $r . ' extends nusoap_client {
	' . $evalStr . '
}';

        return $evalStr;
    }
1282789
public function getWxPayJsApiParameters($prepayId)
    {
        // 获取jsapi支付的参数
        $input = [
            //微信分配的公众账号ID WxPayConfig::APPID
            'appId' => $this->appId,
            //设置支付时间戳
            'timeStamp' => (string)time(),
            //随机字符串
            'nonceStr' => SHA1::get_random_str(32),
            //订单详情扩展字符串
            'package' => 'prepay_id='.$prepayId,
            //签名方式
            'signType' => 'MD5',
        ];
        // 签名
        $input['paySign'] = SHA1::getSign2($input, 'key='.$this->key);
        return json_encode($input);
    }
1198700
function(url, constructReceiver, user_callback) {
    var id = 'a' + utils.random_string(6);
    var url_id = url + '?c=' + escape(WPrefix + '.' + id);
    // Callback will be called exactly once.
    var callback = function(frame) {
        delete _window[WPrefix][id];
        user_callback(frame);
    };

    var close_script = constructReceiver(url_id, callback);
    _window[WPrefix][id] = close_script;
    var stop = function() {
        if (_window[WPrefix][id]) {
            _window[WPrefix][id](utils.closeFrame(1000, "JSONP user aborted read"));
        }
    };
    return stop;
}
898278
public static function getBacklinksTotal($url = false)
    {
        $url   = parent::getUrl($url);
        $query = urlencode("link:{$url}");

        return self::getSearchResultsTotal($query);
    }
121974
function(callback) {
          if (!context.copyOriginal) {
            return callback(null);
          }
          var suffix = 'original.' + context.extension;
          var tempFile = context.tempFolder + '/' + suffix;
          if (context.extension !== 'jpg') {
            // Don't forget to tell the caller that we did the work,
            // even if it was just a copy
            context.adjustedOriginal = tempFile;
            return copyFile(context.workingPath, tempFile, callback);
          }

          var args = [ context.workingPath ];
          if (context.crop) {
            args.push('-crop');
            args.push(context.crop.left);
            args.push(context.crop.top);
            args.push(context.crop.width);
            args.push(context.crop.height);
          }
          args.push('-write');
          args.push(tempFile);
          context.adjustedOriginal = tempFile;

          var proc = childProcess.spawn('imagecrunch', args);
          proc.on('close', function(code) {
            if (code !== 0) {
              return callback(code);
            }
            return callback(null);
          });
        }
1346663
public function getAuthUrl($callbackUrl = null, $state = null, $scope = null)
	{
		$option = array(
			'client_id'			=>	$this->appid,
			'redirect_uri'		=>	null === $callbackUrl ? $this->callbackUrl : $callbackUrl,
			'scope'				=>	null === $scope ? $this->scope : $scope,
			'state'				=>	$this->getState($state),
			'allow_signup'		=>	$this->allowSignup,
		);
		if(null === $this->loginAgentUrl)
		{
			return $this->getAuthLoginUrl('login/oauth/authorize', $option);
		}
		else
		{
			return $this->loginAgentUrl . '?' . $this->http_build_query($option);
		}
	}
1180624
public static String generateValidXLinkUrl(XLinkUrlBlueprint template, 
            ModelDescription modelInformation, 
            String contextId,
            String objectAsJsonString) {
        String completeUrl = template.getBaseUrl();    
        completeUrl += "&" + template.getKeyNames()
            .getModelClassKeyName() + "=" + urlEncodeParameter(modelInformation.getModelClassName());
        completeUrl += "&" + template.getKeyNames()
            .getModelVersionKeyName() + "=" + urlEncodeParameter(modelInformation.getVersionString());
        completeUrl += "&" + template.getKeyNames()
            .getContextIdKeyName() + "=" + urlEncodeParameter(contextId);   
        completeUrl += "&" + template.getKeyNames()
            .getIdentifierKeyName() + "=" + urlEncodeParameter(objectAsJsonString);
        return completeUrl;
    }
521727
public function exportCallable($callback): string
    {
        $wrappedCallback = null;

        while ($callback instanceof WrappedInvocable) {
            $wrappedCallback = $callback;
            $callback = $callback->callback();
        }

        $label = '';

        if ($wrappedCallback) {
            if ($wrappedCallback->isAnonymous()) {
                return $this->export($wrappedCallback);
            }

            $label = $wrappedCallback->label();

            if ('' !== $label) {
                $label = '[' . $label . ']';
            }
        }

        if ($callback instanceof Closure) {
            return $this->export($callback) . $label;
        }

        $reflector = $this->invocableInspector->callbackReflector($callback);

        if (!$reflector instanceof ReflectionMethod) {
            return $reflector->getName() . $label;
        }

        $class = $reflector->getDeclaringClass();
        $name = $reflector->getName();

        if ($class->implementsInterface(Mock::class)) {
            if (
                ($parentClass = $class->getParentClass()) &&
                $parentClass->hasMethod($name)
            ) {
                $class = $parentClass;
            } else {
                try {
                    $prototype = $reflector->getPrototype();
                    $class = $prototype->getDeclaringClass();
                } catch (ReflectionException $e) {
                    // ignore
                }
            }
        }

        $atoms = explode('\\', $class->getName());
        $rendered = array_pop($atoms);

        if ($wrappedCallback instanceof WrappedMethod) {
            $name = $wrappedCallback->name();
            $handle = $wrappedCallback->handle();

            if ($handle instanceof InstanceHandle) {
                $label = $handle->label();

                if ('' !== $label) {
                    $rendered .= '[' . $label . ']';
                }
            }
        }

        if ($reflector->isStatic()) {
            $callOperator = '::';
        } else {
            $callOperator = '->';
        }

        return $rendered . $callOperator . $name;
    }
1167860
public function getAccessToken($code, $callback_url = 'https://api.vk.com/blank.html')
    {
        if (!is_null($this->access_token) && $this->auth) {
            throw new VKException('Already authorized.');
        }

        $parameters = array(
            'client_id' => $this->app_id,
            'client_secret' => $this->api_secret,
            'code' => $code,
            'redirect_uri' => $callback_url
        );

        $rs = json_decode($this->request(
            $this->createUrl(self::ACCESS_TOKEN_URL, $parameters)), true);

        if (isset($rs['error'])) {
            throw new VKException($rs['error'] .
                (!isset($rs['error_description']) ?: ': ' . $rs['error_description']));
        } else {
            $this->auth = true;
            $this->access_token = $rs['access_token'];
            return $rs;
        }
    }
1363414
public function getConsentTextForWebsite($consentUrl, $websiteId)
    {
        if (! isset($this->consentText[$websiteId])) {
            $this->consentText[$websiteId] = $this->configHelper->getConsentSubscriberText($websiteId);
        }
        $consentText = $this->consentText[$websiteId];

        if (! isset($this->customerConsentText[$websiteId])) {
            $this->customerConsentText[$websiteId] = $this->configHelper->getConsentCustomerText($websiteId);
        }
        $customerConsentText = $this->customerConsentText[$websiteId];

        //customer checkout and registration if consent text not empty
        if ($this->isLinkMatchCustomerRegistrationOrCheckout($consentUrl) && strlen($customerConsentText)) {
            $consentText = $customerConsentText;
        }

        return $consentText;
    }
169455
public function GetRateURL($bPositiveLink = true, $bUseFullUrl = false)
    {
        if ($bPositiveLink) {
            $bPositiveLink = '1';
        } else {
            $bPositiveLink = '0';
        }
        $aParameter = array('bRate' => $bPositiveLink, TdbShopArticleReview::URL_PARAM_REVIEW_ID => $this->id);
        $sRatePositiveLink = TTools::GetExecuteMethodOnCurrentModuleURL('RateReview', $aParameter, $bUseFullUrl);

        return $sRatePositiveLink;
    }
213919
public function isVerified($signatureUrl, $fileUrl)
    {
        $data = $this->downloader->download($fileUrl);
        $signatureData = $this->downloader->download($signatureUrl);

        $tmpFile = rtrim(sys_get_temp_dir(), '/') . '/_tool';
        $this->filesystem->createFile($tmpFile, $data);

        $tmpSignFile = rtrim(sys_get_temp_dir(), '/') . '/_tool.sign';
        $this->filesystem->createFile($tmpSignFile, $signatureData);

        $result = $this->verifier->checkGPGSignature($tmpSignFile, $tmpFile);

        unlink($tmpFile);
        unlink($tmpSignFile);

        return $result;
    }
11100
public static function var_dump($var, $return = false, $expandLevel = 1)
    {
        self::$hasArray = false;
        $toggScript = 'var colToggle = function(toggID) {var img = document.getElementById(toggID);if (document.getElementById(toggID + "-collapsable").style.display == "none") {document.getElementById(toggID + "-collapsable").style.display = "inline";setImg(toggID, 0);var previousSibling = document.getElementById(toggID + "-collapsable").previousSibling;while (previousSibling != null && (previousSibling.nodeType != 1 || previousSibling.tagName.toLowerCase() != "br")) {previousSibling = previousSibling.previousSibling;}} else {document.getElementById(toggID + "-collapsable").style.display = "none";setImg(toggID, 1);var previousSibling = document.getElementById(toggID + "-collapsable").previousSibling; while (previousSibling != null && (previousSibling.nodeType != 1 || previousSibling.tagName.toLowerCase() != "br")) {previousSibling = previousSibling.previousSibling;}}};';
        $imgScript = 'var setImg = function(objID,imgID,addStyle) {var imgStore = ["data:image/png;base64,' . self::$icon_collapse . '", "data:image/png;base64,' . self::$icon_expand . '"];if (objID) {document.getElementById(objID).setAttribute("src", imgStore[imgID]);if (addStyle){document.getElementById(objID).setAttribute("style", "position:relative;left:-5px;top:-1px;cursor:pointer;");}}};';
        $jsCode = preg_replace('/ +/', ' ', '<script>' . $toggScript . $imgScript . '</script>');
        $html = '<pre style="margin-bottom: 18px;' .
            'background: #f7f7f9;' .
            'border: 1px solid #e1e1e8;' .
            'padding: 8px;' .
            'border-radius: 4px;' .
            '-moz-border-radius: 4px;' .
            '-webkit-border radius: 4px;' .
            'display: block;' .
            'font-size: 12.05px;' .
            'white-space: pre-wrap;' .
            'word-wrap: break-word;' .
            'color: #333;' .
            'font-family: Menlo,Monaco,Consolas,\'Courier New\',monospace;">';
        $done  = array();
        $html .= self::recursiveVarDumpHelper($var, intval($expandLevel), 0, $done);
        $html .= '</pre>';

        if (self::$hasArray) {
            $html = $jsCode . $html;
        }

        if (!$return) {
            echo $html;
        }

        return $html;
    }
249286
public function skipByToken($token, $copy = false)
    {
        $string = $this->$token;

        return $this->skip($string, $copy);
    }
648992
public function sendWxcard($toUser, $card_id, array $card_ext = array())
    {
        $ret = array();
        $ret['touser'] = $toUser;
        $ret['msgtype'] = 'wxcard';
        $ret['wxcard']['card_id'] = $card_id;
        if (! empty($card_ext)) {
            $ret['wxcard']['card_ext'] = json_encode($card_ext);
        }
        return $this->send($ret);
    }
1344975
public static function getWebhookPayload($returnObject = false) {
        $data = file_get_contents("php://input");
        if ($data) {
            return self::jsonDecode($data, !$returnObject);
        } else {
            return null;
        }
    }