<commit_before><?php
/**
 * Created by PhpStorm.
 * User: Diego
 * Date: 27-01-15
 * Time: 02:50 PM
 */

namespace helpers;


class GCMSender {
    /**
     * @param $deviceGCMTokens
     * @param $data
     * @return string
     */
    public static function sendDataToDevices($deviceGCMTokens, $data)
    {
        $fields = array
        (
            'registration_ids'  => $deviceGCMTokens,
            'data'              => $data
        );

        $headers = array
        (
            'Authorization: key=' . API_ACCESS_KEY,
            'Content-Type: application/json'
        );

        $ch = curl_init();
        curl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' );
        if(defined (PROXY_SERVER))
            curl_setopt($ch, CURLOPT_PROXY, PROXY_SERVER);<commit_msg>Se hizo condición por si acaso se defina un servidor proxy<commit_after><?php
/**
 * Created by PhpStorm.
 * User: Diego
 * Date: 27-01-15
 * Time: 02:50 PM
 */

namespace helpers;


class GCMSender {
    /**
     * @param $deviceGCMTokens
     * @param $data
     * @return string
     */
    public static function sendDataToDevices($deviceGCMTokens, $data)
    {
        $fields = array
        (
            'registration_ids'  => $deviceGCMTokens,
            'data'              => $data
        );

        $headers = array
        (
            'Authorization: key=' . API_ACCESS_KEY,
            'Content-Type: application/json'
        );

        $ch = curl_init();
        curl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' );
        if(defined ('PROXY_SERVER'))
            curl_setopt($ch, CURLOPT_PROXY, PROXY_SERVER);
{'fraction_non_alphanumeric': 0.12627781118460613, 'fraction_numerical': 0.012026458208057728, 'mean_word_length': 1.955595026642984, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '4407295', 'n_tokens_mistral': 556, 'n_tokens_neox': 538, 'n_words': 107}