<commit_before><?php
class SimpleCache{
    static protected $_engine = null;

    static protected $_config = array(
        'engine' => 'FileCache',
        'servers' => array('localhost'),
    );

    /**
     * The following keys are used in core cache engines:
     * - `engine`
     * - `prefix` Prefix appended to all entries. Good for when you need to share a keyspace
     *    with either another cache config or annother application.     
     * - `servers' Used by memcache. Give the address of the memcached servers to use.
     * - `path` Used by FileCache.  Path to where cachefiles should be saved.
     */
    static public function config($settings = array()) {
        self::$_config = array_merge(self::$_config, $settings);
        self::$_engine = null;
    }

    static protected function init(){
        if (!is_object(self::$_engine)){
            $class_name = self::$_config['engine'] . 'Engine';
            if (!class_exists($class_name))
                throw new Exception ($message= "Cache Class '$class_name' not found");
            self::$_engine = new $class_name(self::$_config);
        }
    }

    static public function fetch($key){
        self::init();
        return self::$_engine->fetch($key);
    }
    static public function store($key,$data,$ttl){
        self::init();
        return self::$_engine->store($key,$data,$ttl);
    }
    static public function delete($key){
        self::init();
        return self::$_engine->delete($key);
    }


}<commit_msg>some inline docs<commit_after><?php
/**
 * SimpleCache is a class that wraps up different PHP cache engines though one simple class 
 * that allows you to encapsulate the caching layer of your application.
 */
class SimpleCache{
    static protected $_engine = null;

    // default configuration of the cache class
    static protected $_config = array(
        'engine' => 'FileCache',
        'servers' => array('localhost'),
        'prefix' => '',
    );

    /**
     * The following keys are used in core cache engines:
     * - `engine`
     * - `prefix` Prefix appended to all entries. Good for when you need to share a keyspace
     *    with either another cache config or annother application.     
     * - `servers' Used by memcache. Give the address of the memcached servers to use.
     * - `path` Used by FileCache.  Path to where cachefiles should be saved.
     */
    static public function config($settings = array()) {
        self::$_config = array_merge(self::$_config, $settings);
        self::$_engine = null;
    }

    /**
     * internal setup function
     */
    static protected function init(){
        if (!is_object(self::$_engine)){
            $class_name = self::$_config['engine'] . 'Engine';
            if (!class_exists($class_name))
                throw new Exception ($message= "Cache Class '$class_name' not found");
            self::$_engine = new $class_name(self::$_config);
        }
    }

    /**
     * retrieves the value stored under the key name
     * or false if the cache doesn't exists or if it's expired
     */
    static public function fetch($key){
        self::init();
        return self::$_engine->fetch($key);
    }

    
    static public function store($key,$data,$ttl){
        self::init();
        return self::$_engine->store($key,$data,$ttl);
    }
    static public function delete($key){
        self::init();
        return self::$_engine->delete($key);
    }


}
{'fraction_non_alphanumeric': 0.12796757382744645, 'fraction_numerical': 0.0, 'mean_word_length': 2.4969635627530367, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '640511', 'n_tokens_mistral': 935, 'n_tokens_neox': 916, 'n_words': 309}