<commit_before>#!/bin/bash

DOCROOT="$1"
[[ -z "$DOCROOT" ]] && exit 1
[[ ! -f /usr/bin/php ]] && echo "No php binary found" && exit 0

[[ -z "$LANG" ]] && export LANG=en_US.UTF-8
[[ -z "$HOME" ]] && export HOME=/var/www

ISRESET="$3"
[[ -z "$ISRESET" ]] && ISRESET="false"

pushd $DOCROOT >/dev/null
(( $? != 0 )) && exit 1
find . -maxdepth 6 -name composer.json | grep -v "vendor" | while read GFILE; do
  pushd "${GFILE%/*}" >/dev/null
  if [[ -f composer.lock ]] || [[ "$PWD" =~ ^.*/html.*$ ]]; then
    [[ "$ISRESET" = "true" ]] && rm -rf vendor
    [[ -f composer.phar ]] && rm -f composer.phar
    curl -sS https://getcomposer.org/installer | php
    /usr/bin/php composer.phar install -n --prefer-dist --no-dev
    # if composer fails, sometimes is caused by github rates, sleep and try again
    (( $? != 0 )) && sleep 20 && /usr/bin/php composer.phar install -n --prefer-dist --no-dev
    rm -f composer.phar
  fi
  popd >/dev/null
done
popd > /dev/null
<commit_msg>Change php path into composer bash script<commit_after>#!/bin/bash

DOCROOT="$1"
[[ -z "$DOCROOT" ]] && exit 1
[[ ! -f /usr/bin/php ]] && echo "No php binary found" && exit 0

[[ -z "$LANG" ]] && export LANG=en_US.UTF-8
[[ -z "$HOME" ]] && export HOME=/var/www

ISRESET="$3"
[[ -z "$ISRESET" ]] && ISRESET="false"

pushd $DOCROOT >/dev/null
(( $? != 0 )) && exit 1
find . -maxdepth 6 -name composer.json | grep -v "vendor" | while read GFILE; do
  pushd "${GFILE%/*}" >/dev/null
  if [[ -f composer.lock ]] || [[ "$PWD" =~ ^.*/html.*$ ]]; then
    [[ "$ISRESET" = "true" ]] && rm -rf vendor
    [[ -f composer.phar ]] && rm -f composer.phar
    curl -sS https://getcomposer.org/installer | php
    php composer.phar install -n --prefer-dist --no-dev
    # if composer fails, sometimes is caused by github rates, sleep and try again
    (( $? != 0 )) && sleep 20 && /usr/bin/php composer.phar install -n --prefer-dist --no-dev
    rm -f composer.phar
  fi
  popd >/dev/null
done
popd > /dev/null

{'fraction_non_alphanumeric': 0.21562658548959918, 'fraction_numerical': 0.011161846778285134, 'mean_word_length': 2.7777777777777777, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1034483', 'n_tokens_mistral': 787, 'n_tokens_neox': 751, 'n_words': 216}