<commit_before><?php
    
    /**
     * Manage request cookies.
     * Can also crypt and uncrypt them (security feature)
     *
     * Reserved sessions' names : language, uniqid
     *
     * @require Core/Cookie
     * @package Core
    **/
    class Session {
        
        /**
         * Check if session has parameter
         *
         * @param string    $parameter
         * @param boolean   $strict
        **/
        public static function has($parameter, $strict = false) {
            $path = &$_SESSION;
            $nodes = explode('.', $parameter);
            foreach($nodes as $i => $node) {
                if(isset($path[$node]))
                    $path = &$path[$node]; 
                else
                    return false;
            }
            return $strict ? !empty($path) : true;
        }
        
        
        /**
         * Get session informations
         *
         * @param string    $parameter
         * @param mixed     $default
         * @return mixed
        **/
        public static function get($parameter, $default = false) {
            return array_value($parameter, $_SESSION, $default);
        }
        
        
        /**
         * Set session information.
         * Informations can be stored persistently thank's to cookies
         *
         * @param string    $parameter
         * @param mixed     $value
        **/<commit_msg>Session::has is now deprecated<commit_after><?php
    
    /**
     * Manage request cookies.
     * Can also crypt and uncrypt them (security feature)
     *
     * Reserved sessions' names : language, uniqid
     *
     * @require Core/Cookie
     * @package Core
    **/
    class Session {
        
        /**
         * Check if session has parameter
         *
         * @param string    $parameter
         * @param boolean   $strict
        **/
        public static function exists($parameter, $strict = false) {
            $path = &$_SESSION;
            $nodes = explode('.', $parameter);
            foreach($nodes as $i => $node) {
                if(isset($path[$node]))
                    $path = &$path[$node]; 
                else
                    return false;
            }
            return $strict ? !empty($path) : true;
        }
        
        /**
         * Alias of Session::exists()
         * Session::has deprecated as of v1.2.7
        **/
        public static function has($parameter, $strict = false) {
            return self::exists($parameter, $strict);            
        }
        
        
        /**
         * Get session informations
         *
         * @param string    $parameter
         * @param mixed     $default
         * @return mixed
        **/
        public static function get($parameter, $default = false) {
            return array_value($parameter, $_SESSION, $default);
        }
        
        
        /**
         * Set session information.
         * Informations can be stored persistently thank's to cookies
         *
         * @param string    $parameter
         * @param mixed     $value
        **/
{'fraction_non_alphanumeric': 0.1066925315227934, 'fraction_numerical': 0.0009699321047526673, 'mean_word_length': 1.2833948339483394, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1151148', 'n_tokens_mistral': 777, 'n_tokens_neox': 758, 'n_words': 214}