/**
	 * Initializes missed tables grouped by their related sets
	 */
	private static function initializeTables() {
		$db = & wfGetDB( DB_MASTER );
		/* check whether the tables were initialized */
		$result = true;
		foreach ( self::$sql_tables as $sourceFile => &$tableset ) {
			$tablesNotFound = self::tablesExists( $tableset );
			if ( count( $tablesNotFound ) === count( $tableset ) ) {
				# all of the tables in set are missing
				self::$tablesInit = array_merge( self::$tablesInit, $tableset );
				# no tables were found, initialize the DB completely with minimal version
				if ( ( $r = $db->sourceFile( qp_Setup::$ExtDir . "/tables/{$sourceFile}" ) ) !== true ) {
					throw new Exception( $r );
				}
			} elseif ( count( $tablesNotFound ) > 0 ) {
				# some tables are missing, serious DB error
				throw new Exception( "The following extension's database tables are missing: " . implode( ', ', $tablesNotFound ) . "<br />Please restore from backup or drop the remaining extension tables, then reload this page." );
			}
		}
	}