<commit_before>#!/bin/bash

# List of files to be included in the project
FILES="lib/main.php lib/InteractiveSqlTerminal.class.php lib/SimpleReadline.class.php lib/ArrayToTextTable.class.php lib/HistoryStorage.class.php lib/DbBackend.class.php lib/DbBackend.MatrixDAL.class.php"

# Make temp file
TMPFILE="$(mktemp)"

REV=$(git rev-list --all |wc -l |tr -d ' ')
DATE=$(date +%Y-%m-%d)

# Write header
cat <<EOF >>$TMPFILE
<?php
/**
 * matrixsqlclient.php - Interactive database terminal in PHP.
 *
 * <EMAIL>
 * $DATE (rev $REV)
 *
 */
\$rev = $REV;

EOF

# Write constants to the top of the file
for f in $FILES; do
	cat $f |egrep '^define' >> $TMPFILE
done

echo "" >> $TMPFILE

# Write each project file to single compiled version
for f in $FILES; do

	cat $f |egrep -v '<\?php|\?>|^require|^define' >> $TMPFILE
	echo "" >> $TMPFILE

done

# Write footer
cat <<EOF >>$TMPFILE
?>
EOF

# Copy file to build dir
cp $TMPFILE matrixsqlclient.php
<commit_msg>Fix compile script to be compatible with BSD mktemp.<commit_after>#!/bin/bash

# List of files to be included in the project
FILES="lib/main.php lib/InteractiveSqlTerminal.class.php lib/SimpleReadline.class.php lib/ArrayToTextTable.class.php lib/HistoryStorage.class.php lib/DbBackend.class.php lib/DbBackend.MatrixDAL.class.php"

# Make temp file
TMPFILE="$(mktemp -t $(basename $0))" || exit 1

REV=$(git rev-list --all |wc -l |tr -d ' ')
DATE=$(date +%Y-%m-%d)

# Write header
cat <<EOF >>$TMPFILE
<?php
/**
 * matrixsqlclient.php - Interactive database terminal in PHP.
 *
 * <EMAIL>
 * $DATE (rev $REV)
 *
 */
\$rev = $REV;

EOF

# Write constants to the top of the file
for f in $FILES; do
	cat $f |egrep '^define' >> $TMPFILE
done

echo "" >> $TMPFILE

# Write each project file to single compiled version
for f in $FILES; do

	cat $f |egrep -v '<\?php|\?>|^require|^define' >> $TMPFILE
	echo "" >> $TMPFILE

done

# Write footer
cat <<EOF >>$TMPFILE
?>
EOF

# Copy file to build dir
cp $TMPFILE matrixsqlclient.php

{'fraction_non_alphanumeric': 0.15361293582617483, 'fraction_numerical': 0.001010611419909045, 'mean_word_length': 3.9376558603491274, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 33, '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': '2591048', 'n_tokens_mistral': 723, 'n_tokens_neox': 718, 'n_words': 225}