<commit_before><?php

/*
 * This file is part of the symfony package.
 * (c) 2004-2006 <NAME> <<EMAIL>>
 * 
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 * sfProcessCache stores content in memory if you run a PHP accelerator.
 *
 * Current PHP accelerator supported: APC, XCache and Eaccelerator.
 *
 * @package    symfony
 * @subpackage cache
 * @author     <NAME> <<EMAIL>>
 * @version    SVN: $Id$
 */
class sfProcessCache
{
  /**
   * Gets the cache engine name or false if no PHP accelerator is enabled.
   *
   * @return string The cache engine name
   */
  public static function cacher()
  {
    static $cacher = null;

    if (null === $cacher)
    {
      if (!sfConfig::get('sf_use_process_cache'))
      {
        $cacher = false;
      }
      elseif (function_exists('apc_store'))
      {
        $cacher = 'apc';
      }
      elseif (function_exists('xcache_set'))
      {
        $cacher = 'xcache';
      }
      elseif (function_exists('ecacher_put'))
      {
        $cacher = 'eaccelerator';
      }
      else
      {
        $cacher = false;
      }
    }

    return $cacher;
  }

  /**
   * Gets the prefix to use for all key name.
   *
   * @return string The prefix string
   */
  public static function getPrefix()
  {
    static $prefix = null;

    if (!$prefix)
    {
      $prefix = md5(sfConfig::get('sf_app_dir')).'_';
    }

    return $prefix;
  }

  /**
   * Sets a value in the cache for the specified key.
   *
   * @param string The key name
   * @param string The content to put in cache
   * @param int The life time to keep the content in the cache
   *
   * @return boolean true if ok
   */<commit_msg>1.1: tweaked phpdoc for sfProcessCache timeout<commit_after><?php

/*
 * This file is part of the symfony package.
 * (c) 2004-2006 <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 * sfProcessCache stores content in memory if you run a PHP accelerator.
 *
 * Current PHP accelerator supported: APC, XCache and Eaccelerator.
 *
 * @package    symfony
 * @subpackage cache
 * @author     <NAME> <<EMAIL>>
 * @version    SVN: $Id$
 */
class sfProcessCache
{
  /**
   * Gets the cache engine name or false if no PHP accelerator is enabled.
   *
   * @return string The cache engine name
   */
  public static function cacher()
  {
    static $cacher = null;

    if (null === $cacher)
    {
      if (!sfConfig::get('sf_use_process_cache'))
      {
        $cacher = false;
      }
      elseif (function_exists('apc_store'))
      {
        $cacher = 'apc';
      }
      elseif (function_exists('xcache_set'))
      {
        $cacher = 'xcache';
      }
      elseif (function_exists('ecacher_put'))
      {
        $cacher = 'eaccelerator';
      }
      else
      {
        $cacher = false;
      }
    }

    return $cacher;
  }

  /**
   * Gets the prefix to use for all key name.
   *
   * @return string The prefix string
   */
  public static function getPrefix()
  {
    static $prefix = null;

    if (!$prefix)
    {
      $prefix = md5(sfConfig::get('sf_app_dir')).'_';
    }

    return $prefix;
  }

  /**
   * Sets a value in the cache for the specified key.
   *
   * @param string The key name
   * @param string The content to put in cache
   * @param int The life time to keep the content in the cache in seconds
   *
   * @return boolean true if ok
   */
{'fraction_non_alphanumeric': 0.11316462894512369, 'fraction_numerical': 0.005686664771111743, 'mean_word_length': 2.245387453874539, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, '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': '3314752', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1098, 'n_words': 367}