<commit_before><?php

class ApplicationDatabase {

  const SEEDSFILE  = "db/seeds.php";

  private static $_connection = NULL;

  public static function connect() {

    // load database.ini with check ApplicationConfig
    extract(ApplicationConfig::database());

    try {
      if (!isset(self::$_connection)) {
        self::$_connection = new PDO("mysql:host={$host};dbname={$name}", $user, $pass);

        // configuration database
        self::$_connection->query('set names "utf8"');
        self::$_connection->query('set character set "utf8"');
        self::$_connection->query('set collation_connection = "utf8_general_ci"');
        self::$_connection->query('set collation-server = "utf8_general_ci"');
        self::$_connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      }
    } catch (PDOException $e) {
      throw new Exception("Veritabanı bağlantısı başarılı değil! → " . $e->getMessage());
    }
    return self::$_connection;
  }

  public static function close() {
    if (isset(self::$_connection))
      self::$_connection = null;
  }

  public static function seed() {
    if (file_exists(self::SEEDSFILE))
      include self::SEEDSFILE;
  }
}
?><commit_msg>adapter for Databaser driver<commit_after><?php

class ApplicationDatabase {

  const SEEDSFILE  = "db/seeds.php";

  private static $_connection = NULL;

  public static function connect() {

    // load database.ini with check ApplicationConfig
    extract(ApplicationConfig::database());

    try {
      if (!isset(self::$_connection)) {
        self::$_connection = new PDO("{$adapter}:host={$hostname};dbname={$database}", $username, $password);

        // configuration database
        self::$_connection->query("set names 'utf8'");
        self::$_connection->query("set character set 'utf8'");
        self::$_connection->query("set collation_connection = 'utf8_general_ci'");
        self::$_connection->query("set collation-server = 'utf8_general_ci'");
        self::$_connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      }
    } catch (PDOException $e) {
      throw new Exception("Veritabanı bağlantısı başarılı değil! → " . $e->getMessage());
    }
    return self::$_connection;
  }

  public static function close() {
    if (isset(self::$_connection))
      self::$_connection = null;
  }

  public static function seed() {
    if (file_exists(self::SEEDSFILE))
      include self::SEEDSFILE;
  }
}
?>
{'fraction_non_alphanumeric': 0.15142857142857144, 'fraction_numerical': 0.0032653061224489797, 'mean_word_length': 3.7316602316602316, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '6510445', 'n_tokens_mistral': 749, 'n_tokens_neox': 735, 'n_words': 151}