<commit_before><?php

use Cake\Datasource\ConnectionManager;
use Cake\Network\Exception\InternalErrorException;

$hasDatabaseLogConfig = ConnectionManager::config('database_log');
if (!$hasDatabaseLogConfig && !in_array('sqlite', PDO::getAvailableDrivers())) {
	throw new InternalErrorException('You need to either install pdo_sqlite, ' .
		'or define the "database_log" connection name.');
}
if (!$hasDatabaseLogConfig) {
	ConnectionManager::config('database_log', [
		'className' => 'Cake\Database\Connection',
		'driver' => 'Cake\Database\Driver\Sqlite',
		'database' => LOGS . 'database_log.sqlite',
		'encoding' => 'utf8',
		'cacheMetadata' => true,
		'quoteIdentifiers' => false,
	]);
}<commit_msg>Auto create logs folder in debug mode.<commit_after><?php

use Cake\Core\Configure;
use Cake\Datasource\ConnectionManager;
use Cake\Network\Exception\InternalErrorException;

$hasDatabaseLogConfig = ConnectionManager::config('database_log');
if (!$hasDatabaseLogConfig && !in_array('sqlite', PDO::getAvailableDrivers())) {
	throw new InternalErrorException('You need to either install pdo_sqlite, ' .
		'or define the "database_log" connection name.');
}
if (!$hasDatabaseLogConfig) {
	ConnectionManager::config('database_log', [
		'className' => 'Cake\Database\Connection',
		'driver' => 'Cake\Database\Driver\Sqlite',
		'database' => LOGS . 'database_log.sqlite',
		'encoding' => 'utf8',
		'cacheMetadata' => true,
		'quoteIdentifiers' => false,
	]);
}

if (Configure::read('debug') && !is_dir(LOGS)) {
	mkdir(LOGS, 0770, true);
}
{'fraction_non_alphanumeric': 0.16145833333333334, 'fraction_numerical': 0.00390625, 'mean_word_length': 6.571428571428571, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '5731660', 'n_tokens_mistral': 506, 'n_tokens_neox': 489, 'n_words': 96}