<commit_before><?php

date_default_timezone_set('Australia/Sydney');

require 'vendor/autoload.php';

use Aws\S3\S3Client;

// download Firebase export and store it locally
$firebaseExport = 'https://c3jud0.firebaseio.com/.json?format=export';
$localBackup = __DIR__ . '/../data/min/c3jud0-export.json';
$result = file_put_contents($localBackup, file_get_contents($firebaseExport));

// if the local file is not created, something went wrong and we can stop
if (false === $result) {
    exit();
}

$s3Client = S3Client::factory(array(
    'key'    => getenv('S3_KEY'),
    'secret' => getenv('S3_SECRET')
));

// upload export to S3
// (the file size, file type, and MD5 hash are automatically calculated by the SDK)
try {
    $s3Client->putObject(array(
        'Bucket' => 'jc-firebase',
        'Key'    => date('c', time()) . '.json',<commit_msg>Output message on error saving local backup<commit_after><?php

date_default_timezone_set('Australia/Sydney');

require 'vendor/autoload.php';

use Aws\S3\S3Client;

// download Firebase export and store it locally
$firebaseExport = 'https://c3jud0.firebaseio.com/.json?format=export';
$localBackup = __DIR__ . '/../data/min/c3jud0-export.json';
$result = file_put_contents($localBackup, file_get_contents($firebaseExport));

// if the local file is not created, something went wrong and we can stop
if (false === $result) {
    exit("There was an error saving the local copy.");
}

$s3Client = S3Client::factory(array(
    'key'    => getenv('S3_KEY'),
    'secret' => getenv('S3_SECRET')
));

// upload export to S3
// (the file size, file type, and MD5 hash are automatically calculated by the SDK)
try {
    $s3Client->putObject(array(
        'Bucket' => 'jc-firebase',
        'Key'    => date('c', time()) . '.json',
{'fraction_non_alphanumeric': 0.1562323745064862, 'fraction_numerical': 0.014664410603496898, 'mean_word_length': 4.112391930835735, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1434185', 'n_tokens_mistral': 600, 'n_tokens_neox': 601, 'n_words': 154}