<commit_before><?php
/**
 * Created by PhpStorm.
 * User: Princelo
 * Date: 8/17/15
 * Time: 17:12
 */
function sms_send($template = 1, $mobile, $content_arr)
{
    switch(intval($template))
    {
        case 1:
            $content = "【{title}】您的验证码为{code}，在{time}分钟内有效。";
            break;
        case 2:
            $content = "【{title}】尊敬的会员，感谢您在{store}进行消费，您的本次消费合计使用{volume}，您的账户当前积分为{total}。";
            break;
        case 3:
            $content = "【{title}】尊敬的会员，感谢您在{store}进行消费，您的本次消费合计{volume}，获得积分{reward}。您的账户当前积分为{total}。";
            break;
        default:
            $content = "【{title}】您的验证码为{code}，在{time}分钟内有效。";
            break;
    }
    if (isset($content_arr['title']))
        $content = str_replace('{title}', $content_arr['title'], $content);
    if (isset($content_arr['code']))
        $content = str_replace('{code}', $content_arr['code'], $content);
    if (isset($content_arr['time']))
        $content = str_replace('{time}', $content_arr['time'], $content);
    if (isset($content_arr['volume']))
        $content = str_replace('{volume}', $content_arr['volume'], $content);
    if (isset($content_arr['store']))
        $content = str_replace('{store}', $content_arr['store'], $content);
    if (isset($content_arr['reward']))
        $content = str_replace('{reward}', $content_arr['reward'], $content);
    $api_url = "http://api.smsbao.com/sms?u=chezone&p=PASSWORD&m=".$mobile."&c=".$content;
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL,$api_url);
    /*curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS,
        "postvar1=value1&postvar2=value2&postvar3=value3");*/

    // in real life you should use something like:
    // curl_setopt($ch, CURLOPT_POSTFIELDS,
    //          http_build_query(array('postvar1' => 'value1')));

    // receive server response ...
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $server_output = curl_exec ($ch);

    curl_close ($ch);

// further processing ....
    if ($server_output == '0') {
        return true;
    } else {
        return $server_output;
    }
}

function sms_quick_send($template = 1, $mobile, $content_arr)
{
    switch(intval($template))
    {
        case 1:
            $content = "【{title}】您的验证码为{code}，在{time}分钟内有效。";
            break;
        case 2:
            $content = "【{title}】尊敬的会员，感谢您在{store}进行消费，您的本次消费合计使用{volume}，您的账户当前积分为{total}。";
            break;
        case 3:
            $content = "【{title}】尊敬的会员，感谢您在{store}进行消费，您的本次消费合计{volume}，获得积分{reward}。您的账户当前积分为{total}。";
            break;
        default:
            $content = "【{title}】您的验证码为{code}，在{time}分钟内有效。";
            break;
    }
    if (isset($content_arr['title']))
        $content = str_replace('{title}', $content_arr['title'], $content);
    if (isset($content_arr['code']))
        $content = str_replace('{code}', $content_arr['code'], $content);
    if (isset($content_arr['time']))
        $content = str_replace('{time}', $content_arr['time'], $content);
    if (isset($content_arr['volume']))
        $content = str_replace('{volume}', $content_arr['volume'], $content);
    if (isset($content_arr['store']))
        $content = str_replace('{store}', $content_arr['store'], $content);
    if (isset($content_arr['reward']))
        $content = str_replace('{reward}', $content_arr['reward'], $content);
    $api_url = "http://api.smsbao.com/sms?u=chezone&p=PASSWORD&m=".$mobile."&c=".$content;
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL,$api_url);
    curl_setopt($ch, CURLOPT_NOSIGNAL, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT_MS, 1);
    /*curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS,
        "postvar1=value1&postvar2=value2&postvar3=value3");*/

    // in real life you should use something like:
    // curl_setopt($ch, CURLOPT_POSTFIELDS,
    //          http_build_query(array('postvar1' => 'value1')));

    // receive server response ...
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $server_output = curl_exec ($ch);

    curl_close ($ch);

// further processing ....
    /*if ($server_output == '0') {
        return true;
    } else {<commit_msg>sms timeout 100ms<commit_after><?php
/**
 * Created by PhpStorm.
 * User: Princelo
 * Date: 8/17/15
 * Time: 17:12
 */
function sms_send($template = 1, $mobile, $content_arr)
{
    switch(intval($template))
    {
        case 1:
            $content = "【{title}】您的验证码为{code}，在{time}分钟内有效。";
            break;
        case 2:
            $content = "【{title}】尊敬的会员，感谢您在{store}进行消费，您的本次消费合计使用{volume}，您的账户当前积分为{total}。";
            break;
        case 3:
            $content = "【{title}】尊敬的会员，感谢您在{store}进行消费，您的本次消费合计{volume}，获得积分{reward}。您的账户当前积分为{total}。";
            break;
        default:
            $content = "【{title}】您的验证码为{code}，在{time}分钟内有效。";
            break;
    }
    if (isset($content_arr['title']))
        $content = str_replace('{title}', $content_arr['title'], $content);
    if (isset($content_arr['code']))
        $content = str_replace('{code}', $content_arr['code'], $content);
    if (isset($content_arr['time']))
        $content = str_replace('{time}', $content_arr['time'], $content);
    if (isset($content_arr['volume']))
        $content = str_replace('{volume}', $content_arr['volume'], $content);
    if (isset($content_arr['store']))
        $content = str_replace('{store}', $content_arr['store'], $content);
    if (isset($content_arr['reward']))
        $content = str_replace('{reward}', $content_arr['reward'], $content);
    if (isset($content_arr['total']))
        $content = str_replace('{total}', $content_arr['total'], $content);
    $api_url = "http://api.smsbao.com/sms?u=chezone&p=PASSWORD&m=".$mobile."&c=".$content;
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL,$api_url);
    /*curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS,
        "postvar1=value1&postvar2=value2&postvar3=value3");*/

    // in real life you should use something like:
    // curl_setopt($ch, CURLOPT_POSTFIELDS,
    //          http_build_query(array('postvar1' => 'value1')));

    // receive server response ...
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $server_output = curl_exec ($ch);

    curl_close ($ch);

// further processing ....
    if ($server_output == '0') {
        return true;
    } else {
        return $server_output;
    }
}

function sms_quick_send($template = 1, $mobile, $content_arr)
{
    switch(intval($template))
    {
        case 1:
            $content = "【{title}】您的验证码为{code}，在{time}分钟内有效。";
            break;
        case 2:
            $content = "【{title}】尊敬的会员，感谢您在{store}进行消费，您的本次消费合计使用{volume}，您的账户当前积分为{total}。";
            break;
        case 3:
            $content = "【{title}】尊敬的会员，感谢您在{store}进行消费，您的本次消费合计{volume}，获得积分{reward}。您的账户当前积分为{total}。";
            break;
        default:
            $content = "【{title}】您的验证码为{code}，在{time}分钟内有效。";
            break;
    }
    if (isset($content_arr['title']))
        $content = str_replace('{title}', $content_arr['title'], $content);
    if (isset($content_arr['code']))
        $content = str_replace('{code}', $content_arr['code'], $content);
    if (isset($content_arr['time']))
        $content = str_replace('{time}', $content_arr['time'], $content);
    if (isset($content_arr['volume']))
        $content = str_replace('{volume}', $content_arr['volume'], $content);
    if (isset($content_arr['store']))
        $content = str_replace('{store}', $content_arr['store'], $content);
    if (isset($content_arr['reward']))
        $content = str_replace('{reward}', $content_arr['reward'], $content);
    if (isset($content_arr['total']))
        $content = str_replace('{total}', $content_arr['total'], $content);
    $api_url = "http://api.smsbao.com/sms?u=chezone&p=PASSWORD&m=".$mobile."&c=".$content;
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL,$api_url);
    curl_setopt($ch, CURLOPT_NOSIGNAL, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT_MS, 100);
    /*curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS,
        "postvar1=value1&postvar2=value2&postvar3=value3");*/

    // in real life you should use something like:
    // curl_setopt($ch, CURLOPT_POSTFIELDS,
    //          http_build_query(array('postvar1' => 'value1')));

    // receive server response ...
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $server_output = curl_exec ($ch);

    curl_close ($ch);

// further processing ....
    /*if ($server_output == '0') {
        return true;
    } else {
{'fraction_non_alphanumeric': 0.18935325706280645, 'fraction_numerical': 0.009689469997665187, 'mean_word_length': 3.3028628829733804, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '3378487', 'n_tokens_mistral': 3276, 'n_tokens_neox': 3368, 'n_words': 466}