<commit_before><?php

/**
 * The core class of this library.
 */
class Payplug {

    const VERSION = "1.1.1";

    /**
     * The merchant's parameters which will be used to generate payment URLS.
     */
    private static $parameters;

    public static function getConfig() {
        return self::$parameters;
    }

    /**
     * Connects to Payplug, and retrieves the e-commerce parameters associated
     * to the account `email`.
     */
    public static function loadParameters($email, $password, $is_test=false) {
        $answer;
        $configUrl = 'https://www.payplug.fr/portal/ecommerce/autoconfig';
        if ($is_test === true) {
            $configUrl = 'https://www.payplug.fr/portal/test/ecommerce/autoconfig';
        }
        $curlErrNo;
        $curlErrMsg;
        $httpCode;
        $httpMsg;
        $parameters;
        $process = curl_init($configUrl);

        curl_setopt($process, CURLOPT_HEADER, true);
        curl_setopt($process, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($process, CURLOPT_SSL_VERIFYPEER, true);
        curl_setopt($process, CURLOPT_SSL_VERIFYHOST, true);
        curl_setopt($process, CURLOPT_USERPWD, $email . ':' . $password);

        $answer = curl_exec($process);
        $headerSize = curl_getinfo($process, CURLINFO_HEADER_SIZE);
        // HTTP response code (200, 401, 404...)
        $httpCode = curl_getinfo($process, CURLINFO_HTTP_CODE);

        // Extracts JSON
        $body = substr($answer, $headerSize);
        // Extracts headers
        $headers = substr($answer, 0, $headerSize);
        // Splits the string containing the headers into lines in an array
        $headers = explode("\r\n", $headers);

        /*
         * Splits the first line (containing HTTP response details) by spaces
         * for the 2 first matches. The last one will contains the remaining
         * text which is equivalent to the readable HTTP response message.
         */<commit_msg>Fix CURLOPT_SSL_VERIFYHOST notice, notice begin in 7.21<commit_after><?php

/**
 * The core class of this library.
 */
class Payplug {

    const VERSION = "1.1.1";

    /**
     * The merchant's parameters which will be used to generate payment URLS.
     */
    private static $parameters;

    public static function getConfig() {
        return self::$parameters;
    }

    /**
     * Connects to Payplug, and retrieves the e-commerce parameters associated
     * to the account `email`.
     */
    public static function loadParameters($email, $password, $is_test=false) {
        $answer;
        $configUrl = 'https://www.payplug.fr/portal/ecommerce/autoconfig';
        if ($is_test === true) {
            $configUrl = 'https://www.payplug.fr/portal/test/ecommerce/autoconfig';
        }
        $curlErrNo;
        $curlErrMsg;
        $httpCode;
        $httpMsg;
        $parameters;
        $process = curl_init($configUrl);
        $curl_version = curl_version();

        curl_setopt($process, CURLOPT_HEADER, true);
        curl_setopt($process, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($process, CURLOPT_SSL_VERIFYPEER, true);
        # >= 7.26 to 7.28.1 add a notice message for value 1 will be remove
        curl_setopt($process, CURLOPT_SSL_VERIFYHOST, (version_compare($curl_version['version'], '7.21', '<') ? true : 2));
        curl_setopt($process, CURLOPT_USERPWD, $email . ':' . $password);

        $answer = curl_exec($process);
        $headerSize = curl_getinfo($process, CURLINFO_HEADER_SIZE);
        // HTTP response code (200, 401, 404...)
        $httpCode = curl_getinfo($process, CURLINFO_HTTP_CODE);

        // Extracts JSON
        $body = substr($answer, $headerSize);
        // Extracts headers
        $headers = substr($answer, 0, $headerSize);
        // Splits the string containing the headers into lines in an array
        $headers = explode("\r\n", $headers);

        /*
         * Splits the first line (containing HTTP response details) by spaces
         * for the 2 first matches. The last one will contains the remaining
         * text which is equivalent to the readable HTTP response message.
         */
{'fraction_non_alphanumeric': 0.11517057827244133, 'fraction_numerical': 0.010404064843939027, 'mean_word_length': 2.49746192893401, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, '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': '2096356', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1169, 'n_words': 330}