<commit_before><?php

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

// infomaniak subdomain
// $galsDir = '/picteria/web/galleries/';
// $galsDir = '/web/galleries/';

/**
 * -- galleries index ---------------------------------------------------------
 */
$app->get('/', function () use ($app, $galsDir) {

    // get root dir and remove ending slash
    $rootDir = preg_replace("/\/$/", '', $_SERVER['DOCUMENT_ROOT']);

    $galleriesBasePath = $_SERVER['DOCUMENT_ROOT'].$galsDir;

    if (!is_dir($galleriesBasePath)) {
        return $app['twig']->render('errors/config.twig');
    }

    // get galleries list
    $galleries = glob($galleriesBasePath.'*', GLOB_ONLYDIR);

    // galleriesData
    $galleriesData = array();<commit_msg>removed unused use statements<commit_after><?php

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

// infomaniak subdomain
// $galsDir = '/picteria/web/galleries/';
// $galsDir = '/web/galleries/';

/**
 * -- galleries index ---------------------------------------------------------
 */
$app->get('/', function () use ($app, $galsDir) {

    // get root dir and remove ending slash
    $rootDir = preg_replace("/\/$/", '', $_SERVER['DOCUMENT_ROOT']);

    $galleriesBasePath = $_SERVER['DOCUMENT_ROOT'].$galsDir;

    if (!is_dir($galleriesBasePath)) {
        return $app['twig']->render('errors/config.twig');
    }

    // get galleries list
    $galleries = glob($galleriesBasePath.'*', GLOB_ONLYDIR);

    // galleriesData
    $galleriesData = array();
{'fraction_non_alphanumeric': 0.2255681818181818, 'fraction_numerical': 0.0, 'mean_word_length': 2.9133333333333336, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7107746', 'n_tokens_mistral': 560, 'n_tokens_neox': 522, 'n_words': 94}