<commit_before><?php

error_reporting(E_ALL);
ini_set('display_errors', 1);

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

$memcached = new Memcached();
$memcached->setOption(Memcached::OPT_COMPRESSION, false);
$memcached->addServer('127.0.0.1', 11211);

$cacheDriver = new \Doctrine\Common\Cache\MemcachedCache();
$cacheDriver->setMemcached($memcached);

$db = \ParagonIE\EasyDB\Factory::create(
    'mysql:host=localhost;dbname=dev_memcached',
    'root',
    ''
);

$session = new php_session\session($db, $cacheDriver, 'test', 0, false);

session_set_save_handler($session, true);

$session->start();

switch ($_GET['tests']) {
    case 0:
        $session->set('tests', $_GET['random']);
        break;
    case 1:
        $session->regenerate_id();
        break;
    case 2:
        echo $session->get('tests');
        break;
    case 3:
        $session->logout();
        break;
    case 4:
        //force gc, should delete all sessions in db, who don't have remember_me === 1
        ini_set('session.gc_maxlifetime', '0')
        session_gc();
        break;
    case 5:<commit_msg>use our function directly<commit_after><?php

error_reporting(E_ALL);
ini_set('display_errors', 1);

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

$memcached = new Memcached();
$memcached->setOption(Memcached::OPT_COMPRESSION, false);
$memcached->addServer('127.0.0.1', 11211);

$cacheDriver = new \Doctrine\Common\Cache\MemcachedCache();
$cacheDriver->setMemcached($memcached);

$db = \ParagonIE\EasyDB\Factory::create(
    'mysql:host=localhost;dbname=dev_memcached',
    'root',
    ''
);

$session = new php_session\session($db, $cacheDriver, 'test', 0, false);

session_set_save_handler($session, true);

$session->start();

switch ($_GET['tests']) {
    case 0:
        $session->set('tests', $_GET['random']);
        break;
    case 1:
        $session->regenerate_id();
        break;
    case 2:
        echo $session->get('tests');
        break;
    case 3:
        $session->logout();
        break;
    case 4:
        //force gc, should delete all sessions in db, who don't have remember_me === 1
        $session->gc(0);
        break;
    case 5:
{'fraction_non_alphanumeric': 0.16900749063670412, 'fraction_numerical': 0.019662921348314606, 'mean_word_length': 3.3790983606557377, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5694255', 'n_tokens_mistral': 749, 'n_tokens_neox': 711, 'n_words': 144}