<commit_before><?php

namespace DCMS;

// to consider:
//  - lazy loading?

class Session {
	
	function __construct(array $parameters = null){
		
		if(isset($parameters['name'])){
			session_name($parameters['name']);
		}
		
		if(isset($parameters['lifetime']) || isset($parameters['path']) || isset($parameters['domain'])){
			$lifetime  = isset($parameters['lifetime'])  ? $parameters['lifetime']  : 0;
			$path      = isset($parameters['path'])      ? $parameters['path']      : '/';
			$domain    = isset($parameters['domain'])    ? $parameters['domain']    : '';
			
			session_set_cookie_params($lifetime, $path, $domain);
		}
		
		session_start();
	}
	
	/*
	function started(){
		if(session_status() === PHP_SESSION_ACTIVE){
			return true;
		}
		
		return false;
	}
	*/
	
	function has($key){<commit_msg>if formatting<commit_after><?php

namespace DCMS;

// to consider:
//  - lazy loading?

class Session {
	
	function __construct(array $parameters = null){
		
		if(isset($parameters['name'])){
			session_name($parameters['name']);
		}
		
		if(isset($parameters['lifetime'])
			|| isset($parameters['path'])
			|| isset($parameters['domain'])
		){
			$lifetime  = isset($parameters['lifetime'])  ? $parameters['lifetime']  : 0;
			$path      = isset($parameters['path'])      ? $parameters['path']      : '/';
			$domain    = isset($parameters['domain'])    ? $parameters['domain']    : '';
			
			session_set_cookie_params($lifetime, $path, $domain);
		}
		
		session_start();
	}
	
	/*
	function started(){
		if(session_status() === PHP_SESSION_ACTIVE){
			return true;
		}
		
		return false;
	}
	*/
	
	function has($key){
{'fraction_non_alphanumeric': 0.19350887936313532, 'fraction_numerical': 0.001224739742804654, 'mean_word_length': 3.681948424068768, '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': '6675729', 'n_tokens_mistral': 592, 'n_tokens_neox': 515, 'n_words': 84}