<commit_before><?php

use Silex\Provider\DoctrineServiceProvider;
use Silex\Provider\FormServiceProvider;
use Silex\Provider\MonologServiceProvider;
use Silex\Provider\TwigServiceProvider;
use Knp\Provider\ConsoleServiceProvider;
use SilexGuzzle\GuzzleServiceProvider;

$app = new  GraphNews\GraphNewsApplication();

define("PROJECT_DIR", realpath(__DIR__ . "/../../"));
define("SRC_DIR", PROJECT_DIR . "/src/GraphNews");
!Defined("ENV") ? define("ENV", "prod") : "";

$app->register(new MonologServiceProvider, array(
        'monolog.logfile' => PROJECT_DIR . '/var/log/app' . date("Y-m-d") . '.log')
);

$app->register(new GuzzleServiceProvider(), array(
        'guzzle.timeout' => 2)
);


$app->register(new ConsoleServiceProvider, array(
        'console.name' => 'graphNews Console',
        'console.version' => '1.0.0',
        'console.project_directory' => PROJECT_DIR )
);

$app->register(new TwigServiceProvider, array(
        'twig.path' => array(SRC_DIR . '/View'),
        'twig.options' => array(
            'debug' => true,
            'cache' => PROJECT_DIR . '/var/cache/twig',
        ))
);
$app['twig'] = $app->extend('twig', function ($twig, $app) {
    // add custom globals, filters, tags, ...
    $twig->addFunction(new \Twig_SimpleFunction('asset', function ($asset) use ($app) {
        return $app['request_stack']->getMasterRequest()->getBasepath() . '/' . ltrim($asset, '/');
    }));
    return $twig;
});

$app->register(new Silex\Provider\UrlGeneratorServiceProvider());

$app->register(new DoctrineServiceProvider, array(
    "db.options" => array(
        "dbname" => "graphnews",
        "host" => "localhost",
        "user" => "graphnews",
        "password" => "<PASSWORD>",
        "driver" => "pdo_mysql",
    )
));

$app->register(new ORM\Provider\DoctrineORMServiceProvider(), array(
    'db.orm.class_path'            => PROJECT_DIR.'/vendor/doctrine/orm/lib',
    'db.orm.proxies_dir'           => PROJECT_DIR.'/var/cache/doctrine/Proxy',
    'db.orm.proxies_namespace'     => 'DoctrineProxy',
    'db.orm.auto_generate_proxies' => true,
    'db.orm.entities'              => array(array(
        'type'      => 'annotation',
        'path'      => SRC_DIR.'/Entity',
        'namespace' => 'GraphNews\Entity',
    )),
));

$app->register(new FormServiceProvider);

$app->register(new Silex\Provider\SessionServiceProvider());

//$app->register(new HttpCacheServiceProvider,array('http_cache.cache_dir'=>ROOT.'/../temp/'));

$app->register(new Silex\Provider\SecurityServiceProvider(), array(
    'security.firewalls' => array(
        'login' => array(
            'pattern' => '^/manager/login$',
            'anonymous' => true,
        ),
        'secured_area' => array(
            'pattern' => '^/manager',
            'form' => array('login_path' => '/manager/login', 'check_path' => '/manager/login_check'),
            'logout' => array('logout_path' => '/manager/logout', 'invalidate_session' => true),
            'users' =>
                // raw password is foo
                array(
                    'admin' => array('ROLE_ADMIN', '5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='),
                    'jpdepigny' => array('ROLE_ADMIN', 'XXjpr8P3AHhsSv3pEFkysFe1hS8MVa9QwZLns5+4IiKPlfVDBDCYmmKQkVdv+F9RKywZ+MOIKl2Xp8ibuuKGyw=='),

            ),
        ),
    )
));





require_once SRC_DIR . "/Config/" . ENV . ".php";


return $app;
<commit_msg>change jpdepigny password<commit_after><?php

use Silex\Provider\DoctrineServiceProvider;
use Silex\Provider\FormServiceProvider;
use Silex\Provider\MonologServiceProvider;
use Silex\Provider\TwigServiceProvider;
use Knp\Provider\ConsoleServiceProvider;
use SilexGuzzle\GuzzleServiceProvider;

$app = new  GraphNews\GraphNewsApplication();

define("PROJECT_DIR", realpath(__DIR__ . "/../../"));
define("SRC_DIR", PROJECT_DIR . "/src/GraphNews");
!Defined("ENV") ? define("ENV", "prod") : "";

$app->register(new MonologServiceProvider, array(
        'monolog.logfile' => PROJECT_DIR . '/var/log/app' . date("Y-m-d") . '.log')
);

$app->register(new GuzzleServiceProvider(), array(
        'guzzle.timeout' => 2)
);


$app->register(new ConsoleServiceProvider, array(
        'console.name' => 'graphNews Console',
        'console.version' => '1.0.0',
        'console.project_directory' => PROJECT_DIR )
);

$app->register(new TwigServiceProvider, array(
        'twig.path' => array(SRC_DIR . '/View'),
        'twig.options' => array(
            'debug' => true,
            'cache' => PROJECT_DIR . '/var/cache/twig',
        ))
);
$app['twig'] = $app->extend('twig', function ($twig, $app) {
    // add custom globals, filters, tags, ...
    $twig->addFunction(new \Twig_SimpleFunction('asset', function ($asset) use ($app) {
        return $app['request_stack']->getMasterRequest()->getBasepath() . '/' . ltrim($asset, '/');
    }));
    return $twig;
});

$app->register(new Silex\Provider\UrlGeneratorServiceProvider());

$app->register(new DoctrineServiceProvider, array(
    "db.options" => array(
        "dbname" => "graphnews",
        "host" => "localhost",
        "user" => "graphnews",
        "password" => "graphnews",
        "driver" => "pdo_mysql",
    )
));

$app->register(new ORM\Provider\DoctrineORMServiceProvider(), array(
    'db.orm.class_path'            => PROJECT_DIR.'/vendor/doctrine/orm/lib',
    'db.orm.proxies_dir'           => PROJECT_DIR.'/var/cache/doctrine/Proxy',
    'db.orm.proxies_namespace'     => 'DoctrineProxy',
    'db.orm.auto_generate_proxies' => true,
    'db.orm.entities'              => array(array(
        'type'      => 'annotation',
        'path'      => SRC_DIR.'/Entity',
        'namespace' => 'GraphNews\Entity',
    )),
));

$app->register(new FormServiceProvider);

$app->register(new Silex\Provider\SessionServiceProvider());

//$app->register(new HttpCacheServiceProvider,array('http_cache.cache_dir'=>ROOT.'/../temp/'));

$app->register(new Silex\Provider\SecurityServiceProvider(), array(
    'security.firewalls' => array(
        'login' => array(
            'pattern' => '^/manager/login$',
            'anonymous' => true,
        ),
        'secured_area' => array(
            'pattern' => '^/manager',
            'form' => array('login_path' => '/manager/login', 'check_path' => '/manager/login_check'),
            'logout' => array('logout_path' => '/manager/logout', 'invalidate_session' => true),
            'users' =>
                // raw password is foo
                array(
                    'admin' => array('ROLE_ADMIN', '5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='),
                    'jpdepigny' => array('ROLE_ADMIN', 'MBQ7fmCJGGWGzH/Tq+YgRsJ2mHd8lx6vN8ohAWcQ2JXaYmWLg+4feDWeXk0iN6jcDRsEFsAFaip6xZk7+s9jkQ=='),

            ),
        ),
    )
));





require_once SRC_DIR . "/Config/" . ENV . ".php";


return $app;

{'fraction_non_alphanumeric': 0.18117511188104518, 'fraction_numerical': 0.00822867042009528, 'mean_word_length': 3.046728971962617, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 112, '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': '7281592', 'n_tokens_mistral': 2427, 'n_tokens_neox': 2375, 'n_words': 336}