<commit_before><?php
// Copyright 2016 <NAME>. All rights reserved.
// Use of this source code is governed by the MIT license, a copy of which can
// be found in the LICENSE file.

namespace Anime\Services;

use Anime\Configuration;

require '../../vendor/autoload.php';

// This file is the entry-point for executing the periodic services. It is adviced to create a cron
// job that runs every minute (for best frequency accuracy) executing this file.

$serviceLog = new ServiceLogImpl();
$serviceManager = new ServiceManager($serviceLog);
$serviceManager->loadState();

// Register all the services known to the configuration file with the |$serviceManager|.
foreach (Configuration::getInstance()->get('services') as $service)
    $serviceManager->registerService(new $service['class']($service['options']));

$serviceManager->execute();
$serviceManager->saveState();
<commit_msg>Don't rely on the chdir for the services stuff<commit_after><?php
// Copyright 2016 <NAME>. All rights reserved.
// Use of this source code is governed by the MIT license, a copy of which can
// be found in the LICENSE file.

namespace Anime\Services;

use Anime\Configuration;

require __DIR__ . '/../../vendor/autoload.php';

// This file is the entry-point for executing the periodic services. It is adviced to create a cron
// job that runs every minute (for best frequency accuracy) executing this file.

$serviceLog = new ServiceLogImpl();
$serviceManager = new ServiceManager($serviceLog);
$serviceManager->loadState();

// Register all the services known to the configuration file with the |$serviceManager|.
foreach (Configuration::getInstance()->get('services') as $service)
    $serviceManager->registerService(new $service['class']($service['options']));

$serviceManager->execute();
$serviceManager->saveState();

{'fraction_non_alphanumeric': 0.12002212389380532, 'fraction_numerical': 0.004424778761061947, 'mean_word_length': 5.009966777408638, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1973324', 'n_tokens_mistral': 473, 'n_tokens_neox': 462, 'n_words': 191}