<commit_before><?php

	class PostgresDbWrapper extends PostgresDb {
		/**
		 * Execute where method with the specified episode and season numbers
		 *
		 * @param string|int|\DB\Episode $s Season, or array with keys season & episode
		 * @param string|int|null        $e Episode, optional if $s is an array
		 *
		 * @return self
		 */
		public function whereEp($s, $e = null){
			if (!isset($e)){
				parent::where('season', $s->season);
				parent::where('episode', $s->episode);
			}
			else {
				parent::where('season', $s);
				parent::where('episode', $e);
			}
			return $this;
		}

		public $query_count = 0;

		private $_nonexistantClassCache = array();

		/**
		 * @param PDOStatement $stmt Statement to execute
		 *
		 * @return bool|array|object[]
		 */
		protected function _execStatement($stmt){
			$className = $this->tableNameToClassName();
			if (isset($className) && empty($this->_nonexistantClassCache[$className])){
				if (!class_exists("\\DB\\$className"))
					$this->_nonexistantClassCache[$className] = true;
				else $this->setClass("\\DB\\$className");
			}

			$this->query_count++;
			return parent::_execStatement($stmt);
		}
	}<commit_msg>Revert "Speed up non-existent class detection by not using exceptions"<commit_after><?php

	class PostgresDbWrapper extends PostgresDb {
		/**
		 * Execute where method with the specified episode and season numbers
		 *
		 * @param string|int|\DB\Episode $s Season, or array with keys season & episode
		 * @param string|int|null        $e Episode, optional if $s is an array
		 *
		 * @return self
		 */
		public function whereEp($s, $e = null){
			if (!isset($e)){
				parent::where('season', $s->season);
				parent::where('episode', $s->episode);
			}
			else {
				parent::where('season', $s);
				parent::where('episode', $e);
			}
			return $this;
		}

		public $query_count = 0;

		private $_nonexistantClassCache = array();

		/**
		 * @param PDOStatement $stmt Statement to execute
		 *
		 * @return bool|array|object[]
		 */
		protected function _execStatement($stmt){
			$className = $this->tableNameToClassName();
			if (isset($className) && empty($this->_nonexistantClassCache[$className])){
				try {
					if (!class_exists("\\DB\\$className"))
						throw new Exception();

					$this->setClass("\\DB\\$className");
				}
				catch (Exception $e){ $this->_nonexistantClassCache[$className] = true; }
			}

			$this->query_count++;
			return parent::_execStatement($stmt);
		}
	}
{'fraction_non_alphanumeric': 0.16024340770791076, 'fraction_numerical': 0.0008113590263691683, 'mean_word_length': 3.5, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1067420', 'n_tokens_mistral': 919, 'n_tokens_neox': 743, 'n_words': 187}