<commit_before><?php
/**
  * App configuration
  *
  * @author <NAME> <<EMAIL>>
  * @version 2016-10-19
  * @since 2016-09-28
  *
  */

namespace contacts;

class config {
  private static $config;

  /**
   * Get config setting from `.ini` file
   *
   * @param string $setting Setting name
   * @return string Return setting value from `.ini` file
   */
  public static function get($setting) {
    if(self::$config === null) {
      self::$config = parse_ini_file('config.ini');
    }
    return self::setting_exists($setting);
  }

  /**
   * Check if setting in `.ini` file exists
   *
   * @param string $setting Setting name to check for
   * @return string Setting value from `.ini` file
   */
  private static function setting_exists($setting) {
    if(isset(self::$config[$setting])) {
      return self::$config[$setting];
    } else {
      throw new UnexpectedValueException("'$setting' is not a valid config setting. Please check your 'config.ini' file for valid config options.");
    }
  }

  /**
   * Set error reporting based on if app is in development or production
   *
   * @param null
   * @return null
   */
  public static function set_error_reporting() {
    if(self::get('development')) {
      ini_set('display_errors', '1');
      ini_set('error_reporting', E_ALL^E_NOTICE);
    } else {
      ini_set('display_errors', '0');
    }
  }

}

config::set_error_reporting();
date_default_timezone_set(\contacts\config::get('time_zone'));

?><commit_msg>[FIX] config.php problem<commit_after><?php
/**
  * App configuration
  *
  * @author <NAME> <<EMAIL>>
  * @version 2016-10-19
  * @since 2016-09-28
  *
  */

namespace contacts;

class config {
  private static $config;

  /**
   * Get config setting from `.ini` file
   *
   * @param string $setting Setting name
   * @return string Return setting value from `.ini` file
   */
  public static function get($setting) {
    if(self::$config === null) {
      self::$config = parse_ini_file('config.ini');
    }
    return self::setting_exists($setting);
  }

  /**
   * Check if setting in `.ini` file exists
   *
   * @param string $setting Setting name to check for
   * @return string Setting value from `.ini` file
   */
  private static function setting_exists($setting) {
    if(isset(self::$config[$setting])) {
      return self::$config[$setting];
    } else {
      throw new \UnexpectedValueException("'$setting' is not a valid config setting. Please check your 'config.ini' file for valid config options.");
    }
  }

  /**
   * Set error reporting based on if app is in development or production
   *
   * @param null
   * @return null
   */
  public static function set_error_reporting() {
    if(self::get('development')) {
      ini_set('display_errors', '1');
      ini_set('error_reporting', E_ALL^E_NOTICE);
    } else {
      ini_set('display_errors', '0');
    }
  }

}

config::set_error_reporting();
date_default_timezone_set(\contacts\config::get('time_zone'));

?>
{'fraction_non_alphanumeric': 0.14150943396226415, 'fraction_numerical': 0.012129380053908356, 'mean_word_length': 3.1994342291371995, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5413734', 'n_tokens_mistral': 957, 'n_tokens_neox': 921, 'n_words': 250}