403Webshell
Server IP : 198.54.126.135  /  Your IP : 216.73.216.217
Web Server : Apache
System : Linux host11.registrar-servers.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : linearpo ( 12988)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : OFF |  Pkexec : OFF
Directory :  /home/linearpo/public_html/wp-content/themes/zakra/inc/base/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/linearpo/public_html/wp-content/themes/zakra/inc/base/class-zakra-constants.php
<?php
/**
 * Define constants.
 *
 * @package zakra
 *
 * TODO: @since.
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;

if ( ! class_exists( 'Zakra_Constants' ) ) {

	/**
	 * Zakra_Constants class.
	 */
	class Zakra_Constants {

		/**
		 * Instance.
		 *
		 * @access private
		 * @var object Singleton instance of Zakra_Constants class
		 */
		private static $instance;

		/**
		 * Array of constants and their values.
		 *
		 * @access private
		 * @var array
		 */
		private $constants;

		/**
		 * Singleton instance.
		 *
		 * @return Zakra_Constants
		 *
		 */
		public static function get_instance() {

			if ( ! isset( self::$instance ) ) {

				self::$instance = new self();
			}

			return self::$instance;
		}

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

			// TODO: reuse constant instead of calling function for each constant.
			// TODO: sending constant data as constructor argument.
			$this->constants = array(
				'ZAKRA_THEME_VERSION'         => wp_get_theme( get_template() )->get( 'Version' ),
				'ZAKRA_PARENT_DIR'            => get_template_directory(),
				'ZAKRA_PARENT_INC_DIR'        => get_template_directory() . '/inc',
				'ZAKRA_PARENT_CUSTOMIZER_DIR' => get_template_directory() . '/inc/customizer',
				'ZAKRA_PARENT_CUSTOMIZER_URI' => get_template_directory_uri() . '/inc/customizer',
				'ZAKRA_PARENT_URI'            => get_template_directory_uri(),
				'ZAKRA_PARENT_ASSETS_URI'     => get_template_directory_uri() . '/assets',
				'ZAKRA_PARENT_INC_URI'        => get_template_directory_uri() . '/inc',
				'ZAKRA_PARENT_INC_ICON_URI'   => get_template_directory_uri() . '/assets/img/icons',

			);

			foreach ( $this->constants as $name => $value ) {

				$this->define_constant( $name, $value );
			}

		}


		/**
		 * Define constant safely.
		 *
		 * TODO: @since.
		 *
		 * @param string $name  Constant name.
		 * @param mixed  $value Constant value.
		 *
		 * @return void
		 */
		public function define_constant( $name, $value ) {


			if ( ! defined( $name ) ) {

				define( $name, $value );
			}
		}

	}

}

Zakra_Constants::get_instance();

Youez - 2016 - github.com/yon3zu
LinuXploit