<commit_before><?php
/**
 * Cloudlib :: Minor PHP (M)VC Framework
 *
 * @author      <NAME> <<EMAIL>>
 * @copyright   Copyright (c) 2011 <NAME> <<EMAIL>>
 * @license     MIT License (http://www.opensource.org/licenses/mit-license.php)
 * @package     cloudlib
 */

/**
 * The core class.
 *
 * <short description>
 *
 * @package     cloudlib
 * @subpackage  cloudlib.lib.classes
 * @copyright   Copyright (c) 2011 <NAME> <<EMAIL>>
 * @license     MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
final class core
{
    /**
     * Current version of cloudlib
     *
     * @access  public
     */
    const VERSION = '0.3.8';

    /**
     * Array of current activated modules
     *
     * @access  private
     * @var     array
     */
    private static $modules = array();

    /**
     * Constructor
     *
     * @access  public
     * @return  void
     */
    public function __construct() {}

    /**
     * Initialize
     *
     * @access  public
     * @return  void
     */
    public static function initialize()
    {
        $config = config::general();

        // set the default timezone
        date_default_timezone_set($config['timezone']);

        // set the locale
        setlocale(LC_ALL, $config['locale']);

        // set the encoding for mb_string functions
        mb_internal_encoding($config['mbstring']);

        dispatcher::dispatch(router::uri());
    }

    /**
     * Autoloader
     *
     * @access  public
     * @param   string  $class
     * @return  string
     */
    public static function autoload($class)
    {
        if(preg_match('/Controller/', $class))
        {
            $file = CTRLS . $class . CLASS_EXT;
        }
        elseif(preg_match('/Model/', $class))
        {
            $file = MODELS . $class . CLASS_EXT;
        }
        else
        {
            $file = CLASSES . $class . CLASS_EXT;
        }

        if(!file_exists($file))
        {
            throw new cloudException('Unable to autoload: ' . $class);<commit_msg>improved preg match for autoloading<commit_after><?php
/**
 * Cloudlib :: Minor PHP (M)VC Framework
 *
 * @author      <NAME> <<EMAIL>>
 * @copyright   Copyright (c) 2011 <NAME> <<EMAIL>>
 * @license     MIT License (http://www.opensource.org/licenses/mit-license.php)
 * @package     cloudlib
 */

/**
 * The core class.
 *
 * <short description>
 *
 * @package     cloudlib
 * @subpackage  cloudlib.lib.classes
 * @copyright   Copyright (c) 2011 <NAME> <<EMAIL>>
 * @license     MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
final class core
{
    /**
     * Current version of cloudlib
     *
     * @access  public
     */
    const VERSION = '0.3.8';

    /**
     * Array of current activated modules
     *
     * @access  private
     * @var     array
     */
    private static $modules = array();

    /**
     * Constructor
     *
     * @access  public
     * @return  void
     */
    public function __construct() {}

    /**
     * Initialize
     *
     * @access  public
     * @return  void
     */
    public static function initialize()
    {
        $config = config::general();

        // set the default timezone
        date_default_timezone_set($config['timezone']);

        // set the locale
        setlocale(LC_ALL, $config['locale']);

        // set the encoding for mb_string functions
        mb_internal_encoding($config['mbstring']);

        dispatcher::dispatch(router::uri());
    }

    /**
     * Autoloader
     *
     * @access  public
     * @param   string  $class
     * @return  string
     */
    public static function autoload($class)
    {
        if(preg_match('/Controller$/', $class))
        {
            $file = CTRLS . $class . CLASS_EXT;
        }
        elseif(preg_match('/Model$/', $class))
        {
            $file = MODELS . $class . CLASS_EXT;
        }
        else
        {
            $file = CLASSES . $class . CLASS_EXT;
        }

        if(!file_exists($file))
        {
            throw new cloudException('Unable to autoload: ' . $class);
{'fraction_non_alphanumeric': 0.13645320197044336, 'fraction_numerical': 0.00541871921182266, 'mean_word_length': 1.8458304134548003, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '5869846', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1212, 'n_words': 279}