<commit_before><?php
namespace jzweb\open\weixin\lib;

use jzweb\open\weixin\lib\core\http;


/**
 * 微信第三方平台API
 *
 * @user 刘松森 <<EMAIL>>
 * @date 2017/3/10
 */
class component
{

    private $getComponentAccessTokenUrl = "https://api.weixin.qq.com/cgi-bin/component/api_component_token";
    private $getPreAuthCodeUrl = "https://api.weixin.qq.com/cgi-bin/component/api_create_preauthcode?component_access_token=%s";
    private $getComponentLoginPageUrl = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s";
    private $getApiQueryAuthUrl = "https://api.weixin.qq.com/cgi-bin/component/api_query_auth?component_access_token=%s";
    private $getApiAuthorizerTokenUrl = "https:// api.weixin.qq.com /cgi-bin/component/api_authorizer_token?component_access_token=%s";
    private $getApiGetAuthorizerInfoUrl = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_info?component_access_token=%s";
    private $getApiGetAuthorizerOptionUrl = "https://api.weixin.qq.com/cgi-bin/component/ api_get_authorizer_option?component_access_token=%s";
    private $getApiSetAuthorizerOptionUrl = "https://api.weixin.qq.com/cgi-bin/component/ api_set_authorizer_option?component_access_token=%s";

    /**
     * 获取第三方平台component_access_token
     *
     * @param string $component_appid 第三方平台appid
     * @param string $component_appsecret 第三方平台appsecret
     * @param string $component_verify_ticket 微信后台推送的ticket，此ticket会定时推送，具体请见本页的推送说明
     *
     *{
     *  "component_access_token":"<KEY>",
     *  "expires_in":7200
     *}
     * @return array
     */
    public function getComponentAccessToken($component_appid, $component_appsecret, $component_verify_ticket)
    {
        $postData = array(
            "component_appid" => $component_appid,
            "component_appsecret" => $component_appsecret,
            "component_verify_ticket" => $component_verify_ticket<commit_msg>修复URL多复制了两个空格<commit_after><?php
namespace jzweb\open\weixin\lib;

use jzweb\open\weixin\lib\core\http;


/**
 * 微信第三方平台API
 *
 * @user 刘松森 <<EMAIL>>
 * @date 2017/3/10
 */
class component
{

    private $getComponentAccessTokenUrl = "https://api.weixin.qq.com/cgi-bin/component/api_component_token";
    private $getPreAuthCodeUrl = "https://api.weixin.qq.com/cgi-bin/component/api_create_preauthcode?component_access_token=%s";
    private $getComponentLoginPageUrl = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s";
    private $getApiQueryAuthUrl = "https://api.weixin.qq.com/cgi-bin/component/api_query_auth?component_access_token=%s";
    private $getApiAuthorizerTokenUrl = "https://api.weixin.qq.com/cgi-bin/component/api_authorizer_token?component_access_token=%s";
    private $getApiGetAuthorizerInfoUrl = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_info?component_access_token=%s";
    private $getApiGetAuthorizerOptionUrl = "https://api.weixin.qq.com/cgi-bin/component/ api_get_authorizer_option?component_access_token=%s";
    private $getApiSetAuthorizerOptionUrl = "https://api.weixin.qq.com/cgi-bin/component/ api_set_authorizer_option?component_access_token=%s";

    /**
     * 获取第三方平台component_access_token
     *
     * @param string $component_appid 第三方平台appid
     * @param string $component_appsecret 第三方平台appsecret
     * @param string $component_verify_ticket 微信后台推送的ticket，此ticket会定时推送，具体请见本页的推送说明
     *
     *{
     *  "component_access_token":"<KEY>",
     *  "expires_in":7200
     *}
     * @return array
     */
    public function getComponentAccessToken($component_appid, $component_appsecret, $component_verify_ticket)
    {
        $postData = array(
            "component_appid" => $component_appid,
            "component_appsecret" => $component_appsecret,
            "component_verify_ticket" => $component_verify_ticket
{'fraction_non_alphanumeric': 0.12609366958311888, 'fraction_numerical': 0.005661348430262481, 'mean_word_length': 4.592805755395683, 'pattern_counts': {'":': 4, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1267592', 'n_tokens_mistral': 1419, 'n_tokens_neox': 1414, 'n_words': 139}