WC_Integration_MaxMind_Database_Service::get_database_path()

Fetches the path that the database should be stored.


Description Description


Return Return

(string) The local database path.


Top ↑

Source Source

File: includes/integrations/maxmind-geolocation/class-wc-integration-maxmind-database-service.php

	public function get_database_path() {
		$uploads_dir = wp_upload_dir();

		$database_path = trailingslashit( $uploads_dir['basedir'] ) . 'woocommerce_uploads/';
		if ( ! empty( $this->database_prefix ) ) {
			$database_path .= $this->database_prefix . '-';
		}
		$database_path .= self::DATABASE . self::DATABASE_EXTENSION;

		/**
		 * Filter the geolocation database storage path.
		 *
		 * @param string $database_path The path to the database.
		 * @param int $version Deprecated since 3.4.0.
		 * @deprecated 3.9.0
		 */
		$database_path = apply_filters_deprecated(
			'woocommerce_geolocation_local_database_path',
			array( $database_path, 2 ),
			'3.9.0',
			'woocommerce_maxmind_geolocation_database_path'
		);

		/**
		 * Filter the geolocation database storage path.
		 *
		 * @since 3.9.0
		 * @param string $database_path The path to the database.
		 */
		return apply_filters( 'woocommerce_maxmind_geolocation_database_path', $database_path );
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.