<commit_before><?php


require_once "bootstrap.php";


\Example\ClosureFactory::load();





$provider = createProvider();

$provider->delegate('\Example\TestClassFactory', 'createCacheProxyXTimerProxyXTestClassFactory');

$testClassFactory = $provider->make('\Example\TestClassFactory');

$query = $testClassFactory->create("select * from foo;");

//First call is obviously not in cache
$query->executeQuery(array());

//Second call should hit cache
$query->executeQuery(array());


//This function was not proxied, so is not affected.
$query->anotherFunction("apples");

$timer = $provider->make('Intahwebz\Timer');

$timer->dumpTime();<commit_msg>Added comment for program output.<commit_after><?php


require_once "bootstrap.php";


\Example\ClosureFactory::load();





$provider = createProvider();

$provider->delegate('\Example\TestClassFactory', 'createCacheProxyXTimerProxyXTestClassFactory');

$testClassFactory = $provider->make('\Example\TestClassFactory');

$query = $testClassFactory->create("select * from foo;");

//First call is obviously not in cache
$query->executeQuery(array());

//Second call should hit cache
$query->executeQuery(array());


//This function was not proxied, so is not affected.
$query->anotherFunction("apples");

$timer = $provider->make('Intahwebz\Timer');

$timer->dumpTime();


//Output will look something like:
//
//executing query: select * from foo;
//Result was not in cache
//Result is in cache.
//Executing anotherFunction
//Timer results
//"select * from foo;", called 1 time, total time:0.000449
{'fraction_non_alphanumeric': 0.15752098127824402, 'fraction_numerical': 0.005164622336991607, 'mean_word_length': 5.681034482758621, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '6840029', 'n_tokens_mistral': 467, 'n_tokens_neox': 446, 'n_words': 116}