<commit_before><?php

/**
 * Zend Library Extension
 *
 * PHP version 5
 *
 * @category Zle
 * @package  Zle_Application
 * @author   <NAME> <<EMAIL>>
 * @license  http://framework.zend.com/license/new-bsd New BSD License
 * @link     http://framework.zend.com/
 */

require_once 'Zend/Application.php';
/**
 * Application
 *
 * @category Zle
 * @package  Zle_Application
 * @author   <NAME> <<EMAIL>>
 * @license  http://framework.zend.com/license/new-bsd New BSD License
 * @link     http://framework.zend.com/
 */
class Zle_Application extends Zend_Application
{
    const TIMESTAMP_KEY = 'timestamp_of_config';
    const CONFIG_ARRAY_KEY = 'config_array';

    /**
     * @var Zend_Cache_Core
     */
    private $_configCache;

    /**
     * Load configuration file of options
     *
     * @param string $file configuration file
     *
     * @throws Zend_Application_Exception When invalid configuration file is provided
     *
     * @return array
     */
    protected function _loadConfig($file)
    {
        if ($this->isFileUpToDate($file) && $config = $this->getConfigFromCache()) {
            return $config;
        }
        return $this->storeConfigInCache(parent::_loadConfig($file));
    }

    /**
     * Check if the file is changed on the disk
     *
     * @param string $file file to check
     *
     * @return bool
     */
    protected function isFileUpToDate($file)
    {
        if (!file_exists($file)) {
            return false;
        }
        $lastUpdate = filemtime($file);
        $cache = $this->getConfigCache();
        // data not in cache
        if (!($lastVersionTime = $cache->load(self::TIMESTAMP_KEY))) {
            $cache->save($lastUpdate, self::TIMESTAMP_KEY);
            return false;
        }
        if ($lastUpdate > $lastVersionTime) {
            $cache->save($lastVersionTime, self::TIMESTAMP_KEY);
            // reload config
            return false;<commit_msg>Changed cached timestamp, fixes #2<commit_after><?php

/**
 * Zend Library Extension
 *
 * PHP version 5
 *
 * @category Zle
 * @package  Zle_Application
 * @author   <NAME> <<EMAIL>>
 * @license  http://framework.zend.com/license/new-bsd New BSD License
 * @link     http://framework.zend.com/
 */

require_once 'Zend/Application.php';
/**
 * Application
 *
 * @category Zle
 * @package  Zle_Application
 * @author   <NAME> <<EMAIL>>
 * @license  http://framework.zend.com/license/new-bsd New BSD License
 * @link     http://framework.zend.com/
 */
class Zle_Application extends Zend_Application
{
    const TIMESTAMP_KEY = 'timestamp_of_config';
    const CONFIG_ARRAY_KEY = 'config_array';

    /**
     * @var Zend_Cache_Core
     */
    private $_configCache;

    /**
     * Load configuration file of options
     *
     * @param string $file configuration file
     *
     * @throws Zend_Application_Exception When invalid configuration file is provided
     *
     * @return array
     */
    protected function _loadConfig($file)
    {
        if ($this->isFileUpToDate($file) && $config = $this->getConfigFromCache()) {
            return $config;
        }
        return $this->storeConfigInCache(parent::_loadConfig($file));
    }

    /**
     * Check if the file is changed on the disk
     *
     * @param string $file file to check
     *
     * @return bool
     */
    protected function isFileUpToDate($file)
    {
        if (!file_exists($file)) {
            return false;
        }
        $lastUpdate = filemtime($file);
        $cache = $this->getConfigCache();
        // data not in cache
        if (!($lastVersionTime = $cache->load(self::TIMESTAMP_KEY))) {
            $cache->save($lastUpdate, self::TIMESTAMP_KEY);
            return false;
        }
        if ($lastUpdate > $lastVersionTime) {
            $cache->save($lastUpdate, self::TIMESTAMP_KEY);
            // reload config
            return false;
{'fraction_non_alphanumeric': 0.12700051626226122, 'fraction_numerical': 0.0007743933918430562, 'mean_word_length': 2.372497824194952, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 31, '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': '7191804', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1134, 'n_words': 265}