<commit_before><?php
define("BASE_PATH", dirname(__FILE__));

require_once BASE_PATH.'/ConfigProvider.interface.php';
require_once BASE_PATH.'/PHPFileConfig.class.php';
ConfigProvider::create("PHPFileConfig");

require_once BASE_PATH.'/DataProvider.class.php';
require_once BASE_PATH.'/StorageProvider.class.php';

include(BASE_PATH.'/provider/foursquare.php');
include(BASE_PATH.'/provider/trakt.php');
include(BASE_PATH.'/provider/putio.php');
include(BASE_PATH.'/provider/withings.php');
include(BASE_PATH.'/provider/appnet.php');
include(BASE_PATH.'/provider/mail.php');
include(BASE_PATH.'/provider/github.php');

include(BASE_PATH.'/storage/CosmStorage.class.php');


$datastore_classes = array_filter(get_declared_classes(), function($className) {
	return in_array('StorageProvider', class_parents($className));
});

$datastores = array();
foreach ($datastore_classes as $datastore_class) {
	$datastores[] = new $datastore_class();
}

$providers = array_filter(get_declared_classes(), function($className) {
	return in_array('DataProvider', class_parents($className));
});

foreach ($providers as $provider_class) {
	$provider = new $provider_class();
	if ($provider->isActive()) {
		foreach ($datastores as $datastore) {
			$datastore->putData($provider->getData(), $provider);
		}
	}<commit_msg>More comments<commit_after><?php
define("BASE_PATH", dirname(__FILE__));

// Configuration storage
require_once BASE_PATH.'/ConfigProvider.interface.php';
require_once BASE_PATH.'/PHPFileConfig.class.php';
ConfigProvider::create("PHPFileConfig");

// Base Plugin classes
require_once BASE_PATH.'/DataProvider.class.php';
require_once BASE_PATH.'/StorageProvider.class.php';

// Data Providers
include(BASE_PATH.'/provider/foursquare.php');
include(BASE_PATH.'/provider/trakt.php');
include(BASE_PATH.'/provider/putio.php');
include(BASE_PATH.'/provider/withings.php');
include(BASE_PATH.'/provider/appnet.php');
include(BASE_PATH.'/provider/mail.php');
include(BASE_PATH.'/provider/github.php');

// Storage Providers
include(BASE_PATH.'/storage/CosmStorage.class.php');

// Find all storage providers
$datastore_classes = array_filter(get_declared_classes(), function($className) {
	return in_array('StorageProvider', class_parents($className));
});

// Instanciate all storage providers
$datastores = array();
foreach ($datastore_classes as $datastore_class) {
	$datastores[] = new $datastore_class();
}

// find all data providers
$providers = array_filter(get_declared_classes(), function($className) {
	return in_array('DataProvider', class_parents($className));
});

// get data from each data provider, and push it to the storage providers
foreach ($providers as $provider_class) {
	$provider = new $provider_class();
	if ($provider->isActive()) {
		foreach ($datastores as $datastore) {
			$datastore->putData($provider->getData(), $provider);
		}
	}
{'fraction_non_alphanumeric': 0.16177498252969952, 'fraction_numerical': 0.0, 'mean_word_length': 7.203438395415473, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1802260', 'n_tokens_mistral': 919, 'n_tokens_neox': 909, 'n_words': 147}