<commit_before><?php

// web/index.php
require_once __DIR__ . '/vendor/autoload.php';

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

$app = new Silex\Application();
$app['debug'] = true;  // set to 'false' in production

$app->register(new Silex\Provider\DoctrineServiceProvider(), array(
    'db.options' => array(
        'dbname' => 'DB_NAME',
        'user' => 'DB_USER',
        'password' => '<PASSWORD>',
        'host' => 'DB_HOST',
        'driver' => 'pdo_mysql',
        'charset' => 'utf8',
    ),
));

$app->get('/marker', function (Request $request) use ($app) {
    $searchterm = $request->get('search');
    if ($searchterm == null || $searchterm === '') {
        $markers = $app['db']->fetchAll('SELECT * FROM marker');
        return $app->json($markers);
    } else {
        $markers = $app['db']->fetchAll('SELECT * FROM marker WHERE tags LIKE ?', array('%' . $searchterm . '%'));<commit_msg>search provider, too<commit_after><?php

// web/index.php
require_once __DIR__ . '/vendor/autoload.php';

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

$app = new Silex\Application();
$app['debug'] = true;  // set to 'false' in production

$app->register(new Silex\Provider\DoctrineServiceProvider(), array(
    'db.options' => array(
        'dbname' => 'DB_NAME',
        'user' => 'DB_USER',
        'password' => '<PASSWORD>',
        'host' => 'DB_HOST',
        'driver' => 'pdo_mysql',
        'charset' => 'utf8',
    ),
));

$app->get('/marker', function (Request $request) use ($app) {
    $searchterm = $request->get('search');
    if ($searchterm == null || $searchterm === '') {
        $markers = $app['db']->fetchAll('SELECT * FROM marker');
        return $app->json($markers);
    } else {
        $markers = $app['db']->fetchAll('SELECT * FROM marker WHERE tags LIKE ? OR provider LIKE ?', array('%'.$searchterm.'%', '%'.$searchterm.'%'));
{'fraction_non_alphanumeric': 0.20640569395017794, 'fraction_numerical': 0.0010167768174885613, 'mean_word_length': 3.392857142857143, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 31, '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': '7186140', 'n_tokens_mistral': 638, 'n_tokens_neox': 638, 'n_words': 133}