<?php
/**
 * BlogAura Constants Class.
 *
 * @package BlogAura
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! class_exists( 'BlogAura_Constants' ) ) {

	/**
	 * BlogAura_Constants class.
	 */
	class BlogAura_Constants {

		/**
		 * The single instance of the class.
		 *
		 * @var BlogAura_Constants
		 */
		private static $instance = null;

		/**
		 * Constants array.
		 *
		 * @var array
		 */
		private $constants = array();

		/**
		 * Constructor.
		 */
		private function __construct() {

			// Define constants here.
			$this->constants = array(
				/**
				 * Define URL Location Constants
				 */
				'BLOGAURA_PARENT_URL' => get_template_directory_uri(),
			);

			foreach ( $this->constants as $name => $value ) {
				$this->define_constant( $name, $value );
			}
		}

		/**
		 * Gets the single instance of the class.
		 *
		 * @return BlogAura_Constants
		 */
		public static function get_instance() {
			if ( null === self::$instance ) {
				self::$instance = new self();
			}
			return self::$instance;
		}

		/**
		 * Define constant safely.
		 *
		 * @param string $name Constant name.
		 * @param mixed $value Constant value.
		 *
		 * @return void
		 */
		private function define_constant( $name, $value ) {
			if ( ! defined( $name ) ) {
				define( $name, $value );
			}
		}
	}
}

// Initialize the class instance.
BlogAura_Constants::get_instance();
