Uname:Linux developmentwebsite.ca 4.18.0-553.168.1.el8_10.x86_64 #1 SMP Thu Sep 24 18:05:46 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 173.249.148.11  /  Your IP : 216.73.216.6
Web Server : Apache/2.4.68 (AlmaLinux)
System : Linux developmentwebsite.ca 4.18.0-553.168.1.el8_10.x86_64 #1 SMP Thu Sep 24 18:05:46 UTC 2026 x86_64
User : devinter ( 1006)
PHP Version : 8.3.35
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /chroot/home/devinter/public_html/wp-content/plugins/content-control/classes/Services/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /chroot/home/devinter/public_html/wp-content/plugins/content-control/classes/Services/Globals.php
<?php
/**
 * Globals service.
 *
 * @copyright (c) 2021, Code Atlantic LLC.
 * @package ContentControl
 */

namespace ContentControl\Services;

defined( 'ABSPATH' ) || exit;

/**
 * Globals service.
 */
class Globals {

	/**
	 * Context.
	 *
	 * @var string|null
	 */
	public $current_query_context = null;

	/**
	 * Current query.
	 *
	 * @var \WP_Query|\WP_Term_Query|null
	 */
	public $current_query = null;

	/**
	 * Current post query.
	 *
	 * @var \WP_Query|null
	 */
	public $current_post_query = null;

	/**
	 * Current term query.
	 *
	 * @var \WP_Term_Query|null
	 */
	public $current_term_query = null;

	/**
	 * Current term.
	 *
	 * @var \WP_Term|null
	 */
	public $term = null;

	/**
	 * Overloaded posts stack.
	 *
	 * @var \WP_Post[]|null $overloaded_posts
	 */
	public $overloaded_posts = null;

	/**
	 * Overloaded terms stack.
	 *
	 * @var \WP_Term[]|null $overloaded_terms
	 */
	public $overloaded_terms = null;

	/**
	 * Last term.
	 *
	 * @var \WP_Term[]|null
	 */
	public $last_term = null;

	/**
	 * Current rule.
	 *
	 * @var \ContentControl\Models\RuleEngine\Rule|null
	 */
	public $current_rule = null;

	/**
	 * Current intent.
	 *
	 * @var null|array{
	 *      type: string,
	 *      name: string,
	 *      id: int,
	 *      index: bool,
	 *      search: string|false,
	 * }
	 */
	public $rest_intent = null;

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

	/**
	 * Get context items by key.
	 *
	 * @param string $key Context key.
	 * @param mixed  $default_value Default value.
	 *
	 * @return mixed
	 */
	public function get( $key, $default_value = null ) {
		return property_exists( $this, $key ) ? $this->$key : $default_value;
	}

	/**
	 * Set context items by key.
	 *
	 * @param string $key Context key.
	 * @param mixed  $value Context value.
	 *
	 * @return void
	 */
	public function set( $key, $value ) {
		if ( property_exists( $this, $key ) ) {
			$this->$key = $value;
		}
	}

	/**
	 * Reset context items by key.
	 *
	 * @param string $key Context key.
	 *
	 * @return void
	 */
	public function reset( $key ) {
		if ( property_exists( $this, $key ) ) {
			$this->$key = null;
		}
	}

	/**
	 * Reset all context items.
	 *
	 * @return void
	 */
	public function reset_all() {
		$this->reset( 'current_query_context' );
		$this->reset( 'current_query' );
		$this->reset( 'current_post_query' );
		$this->reset( 'current_term_query' );
		$this->reset( 'current_rule' );
		$this->reset( 'term' );
		$this->reset( 'overloaded_posts' );
		$this->reset( 'overloaded_terms' );
		$this->reset( 'last_term' );
		$this->reset( 'rest_intent' );
	}

	/**
	 * Push to stack.
	 *
	 * @param string $key Context key.
	 * @param mixed  $value Context value.
	 *
	 * @return void
	 */
	public function push_to_stack( $key, $value ) {
		if ( property_exists( $this, $key ) ) {
			$values = $this->get( $key, [] );

			$values[] = $value;

			$this->set( $key, $values );
		}
	}

	/**
	 * Pop from stack.
	 *
	 * @param string $key Context key.
	 *
	 * @return mixed
	 */
	public function pop_from_stack( $key ) {
		if ( property_exists( $this, $key ) ) {
			$values = $this->get( $key, [] );

			if ( empty( $values ) ) {
				return null;
			}

			$value = array_pop( $values );

			$this->set( $key, $values );

			return $value;
		}

		return null;
	}

	/**
	 * Check if stack is empty.
	 *
	 * @param string $key Context key.
	 *
	 * @return bool
	 */
	public function is_empty( $key ) {
		$value = $this->get( $key );

		return ! isset( $value ) || empty( $value );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit