<commit_before><?php

// Includes the Composer Autoloader
require realpath('vendor') . '/autoload.php';

if ( ! defined('BLUEPRINT_FILENAME')) {
    define('BLUEPRINT_FILENAME', 'weasley.yml');
}

// Creates a new instance of Blueprint class
$injector = new Auryn\Injector;
$console = new Symfony\Component\Console\Application;
$app = new Rougin\Blueprint\Blueprint($console, $injector);

// Information of the application
$app->console->setName('Weasley');
$app->console->setVersion('0.2.0');

// Adds a "init" command if the file does not exists
if ( ! file_exists(BLUEPRINT_FILENAME)) {
    $command = new Rougin\Weasley\Commands\InitializationCommand;

    $app->console->add($command);

    return $app->run();
}

// Parses the data from a YAML format
$config = Rougin\Weasley\Common\Configuration::get();

// Instantiate League\Filesystem
$adapter = new League\Flysystem\Adapter\Local($config->output);
$filesystem = new League\Flysystem\Filesystem($adapter);

$app->injector->share($filesystem);

$app->setTemplatePath(str_replace('bin', 'src', __DIR__ . '/Templates'))
    ->setCommandPath(str_replace('bin', 'src', __DIR__ . '/Commands'))
    ->setCommandNamespace('Rougin\Weasley\Commands');

$app->injector->delegate('Rougin\Describe\Describe', function () use ($config)
{
    $configuration = $config->database;
    $name = $config->database->driver;

    $driver = new Rougin\Describe\Drivers\DatabaseDriver($name, $configuration);

    return new Rougin\Describe\Describe($driver);
});

// Run the application
$app->run();
<commit_msg>Revert rougin/describe update<commit_after><?php

// Includes the Composer Autoloader
require realpath('vendor') . '/autoload.php';

if ( ! defined('BLUEPRINT_FILENAME')) {
    define('BLUEPRINT_FILENAME', 'weasley.yml');
}

// Creates a new instance of Blueprint class
$injector = new Auryn\Injector;
$console = new Symfony\Component\Console\Application;
$app = new Rougin\Blueprint\Blueprint($console, $injector);

// Information of the application
$app->console->setName('Weasley');
$app->console->setVersion('0.2.0');

// Adds a "init" command if the file does not exists
if ( ! file_exists(BLUEPRINT_FILENAME)) {
    $command = new Rougin\Weasley\Commands\InitializationCommand;

    $app->console->add($command);

    return $app->run();
}

// Parses the data from a YAML format
$config = Rougin\Weasley\Common\Configuration::get();

// Instantiate League\Filesystem
$adapter = new League\Flysystem\Adapter\Local($config->output);
$filesystem = new League\Flysystem\Filesystem($adapter);

$app->injector->share($filesystem);

$app->setTemplatePath(str_replace('bin', 'src', __DIR__ . '/Templates'))
    ->setCommandPath(str_replace('bin', 'src', __DIR__ . '/Commands'))
    ->setCommandNamespace('Rougin\Weasley\Commands');

$app->injector->delegate('Rougin\Describe\Describe', function () use ($config)
{
    switch ($config->database->driver) {
        case 'mysql':
        case 'mysqli':
            $pdo = new PDO(
                'mysql:host=' . $config->database->hostname .
                ';dbname=' . $config->database->name,
                $config->database->username,
                $config->database->password
            );

            $driver = new Rougin\Describe\Driver\MySQLDriver($pdo, $config->database->name);

            break;
        case 'pdo':
        case 'sqlite':
        case 'sqlite3':
            $pdo = new PDO($config->database->hostname);
            $driver = new Rougin\Describe\Driver\SQLiteDriver($pdo);

            break;
    }

    return new Rougin\Describe\Describe($driver);
});

// Run the application
$app->run();

{'fraction_non_alphanumeric': 0.16243093922651933, 'fraction_numerical': 0.0019337016574585636, 'mean_word_length': 3.8344459279038716, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 52, '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': '4843650', 'n_tokens_mistral': 1145, 'n_tokens_neox': 1147, 'n_words': 225}