<commit_before>#!/bin/bash

chmod -R a+rw data

# Add hostname of docker host for XDebug to connect to. This can be removed once host.docker.internal is also supported in Docker for Linux (currently is only Win and Mac)
if ! grep "host.docker.internal" /etc/hosts > /dev/null ; then
    DOCKER_INTERNAL_IP=`/sbin/ip -4 route list match 0/0 | awk '{ print $3 }' | head -n 1`
    echo -e "$DOCKER_INTERNAL_IP\thost.docker.internal" >> /etc/hosts
    echo "Added host.docker.internal to /etc/hosts"
fi

DB_CONFIG_FILE="config/autoload/doctrine.local.dev.php"
if [ ! -f "$DB_CONFIG_FILE" ]; then
    sed 's/127.0.0.1/db/g' config/autoload/doctrine.local.dev.dist > "$DB_CONFIG_FILE"
fi

php bin/wait-for-composer-install.php
php bin/wait-for-db.php
vendor/bin/doctrine orm:schema-tool:update --force --complete

apache2-foreground<commit_msg>Allow container to write to xdebug log file<commit_after>#!/bin/bash

chmod -R a+rw data

# Add hostname of docker host for XDebug to connect to. This can be removed once host.docker.internal is also supported in Docker for Linux (currently is only Win and Mac)
if ! grep "host.docker.internal" /etc/hosts > /dev/null ; then
    DOCKER_INTERNAL_IP=`/sbin/ip -4 route list match 0/0 | awk '{ print $3 }' | head -n 1`
    echo -e "$DOCKER_INTERNAL_IP\thost.docker.internal" >> /etc/hosts
    echo "Added host.docker.internal to /etc/hosts"
fi
touch /var/log/xdebug.log && chmod a+rw /tmp/xdebug.log

DB_CONFIG_FILE="config/autoload/doctrine.local.dev.php"
if [ ! -f "$DB_CONFIG_FILE" ]; then
    sed 's/127.0.0.1/db/g' config/autoload/doctrine.local.dev.dist > "$DB_CONFIG_FILE"
fi

php bin/wait-for-composer-install.php
php bin/wait-for-db.php
vendor/bin/doctrine orm:schema-tool:update --force --complete

apache2-foreground
{'fraction_non_alphanumeric': 0.13053348467650397, 'fraction_numerical': 0.01362088535754824, 'mean_word_length': 3.752021563342318, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7529639', 'n_tokens_mistral': 671, 'n_tokens_neox': 634, 'n_words': 173}