<commit_before>#!/bin/bash

set -e

cd /tmp \
    && mkdir librdkafka \
    && cd librdkafka \
    && git clone https://github.com/edenhill/librdkafka.git . \
    && ./configure \
    && make \
    && sudo make install

if [[ "$TRAVIS_PHP_VERSION" =~ ^7.* ]]
then
    pecl install channel://pecl.php.net/rdkafka-beta
else
    pecl install channel://pecl.php.net/rdkafka-1.0.0
fi

echo "extension = rdkafka.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini<commit_msg>try get build working in php 7.1 and nightly<commit_after>#!/bin/bash

set -e

PHP_VERSION=$(phpenv global)

cd /tmp \
    && mkdir librdkafka \
    && cd librdkafka \
    && git clone https://github.com/edenhill/librdkafka.git . \
    && ./configure \
    && make \
    && sudo make install

if [[ "$PHP_VERSION" == "7.1" ]] || [[ "$PHP_VERSION" == "nightly" ]]
then
    cd /tmp \
        && mkdir php-rdkafka \
        && cd php-rdkafka \
        && git clone https://github.com/arnaud-lb/php-rdkafka.git \
        && phpize \
        && ./configure \
        && make \
        && sudo make install
elif [[ "$PHP_VERSION" == "7.0" ]]
then
    pecl install channel://pecl.php.net/rdkafka-beta
else
    pecl install channel://pecl.php.net/rdkafka-1.0.0
fi

echo "extension = rdkafka.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
{'fraction_non_alphanumeric': 0.17486752460257382, 'fraction_numerical': 0.00984102952308857, 'mean_word_length': 2.3383838383838382, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 3, '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': '7416002', 'n_tokens_mistral': 506, 'n_tokens_neox': 491, 'n_words': 98}