<commit_before><?php 

function saveToCache($cacheFileName, $buffer)
{
	$cacheFileDir = pathinfo($cacheFileName, PATHINFO_DIRNAME);
	if (!file_exists($cacheFileDir) || !is_dir($cacheFileDir))
		mkdir($cacheFileDir, 0755, true);
	
	file_put_contents($cacheFileName, $buffer);
}

require_once("../../bootstrap.php"); 
require_once("helpers.php");

// get inputs
$inputPage = @$_GET["page"];
$inputService = @$_GET["service"];
$inputAction = @$_GET["action"];
$inputObject = @$_GET["object"];

// get cache file name
$cachePath = kConf::get("general_cache_dir").'/testmeDoc';

if ($inputPage)
{
	$cacheKey = $inputPage;
}
else if ($inputService && $inputAction)
{
	$cacheKey = "$inputService/$inputAction";
}
else if ($inputService)
{
	$cacheKey = $inputService;
}
else if ($inputObject)
{
	$cacheKey = $inputObject;
}<commit_msg>testmeDoc: arrange the cache folder structure (objects/services/actions)<commit_after><?php 

function saveToCache($cacheFileName, $buffer)
{
	$cacheFileDir = pathinfo($cacheFileName, PATHINFO_DIRNAME);
	if (!file_exists($cacheFileDir) || !is_dir($cacheFileDir))
		mkdir($cacheFileDir, 0755, true);
	
	file_put_contents($cacheFileName, $buffer);
}

require_once("../../bootstrap.php"); 
require_once("helpers.php");

// get inputs
$inputPage = @$_GET["page"];
$inputService = @$_GET["service"];
$inputAction = @$_GET["action"];
$inputObject = @$_GET["object"];

// get cache file name
$cachePath = kConf::get("general_cache_dir").'/testmeDoc';

if ($inputPage)
{
	$cacheKey = $inputPage;
}
else if ($inputService && $inputAction)
{
	$cacheKey = "actions/$inputService/$inputAction";
}
else if ($inputService)
{
	$cacheKey = "services/$inputService";
}
else if ($inputObject)
{
	$cacheKey = "objects/$inputObject";
}
{'fraction_non_alphanumeric': 0.18714121699196326, 'fraction_numerical': 0.004592422502870264, 'mean_word_length': 6.578260869565217, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '1981502', 'n_tokens_mistral': 608, 'n_tokens_neox': 589, 'n_words': 112}