Uname: Linux p3plzcpnl499967.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
Software: Apache
PHP version: 8.2.30 [ PHP INFO ] PHP os: Linux
Server Ip: 208.109.40.231
Your Ip: 216.73.216.26
User: nayff91c5tsx (10005085) | Group: nayff91c5tsx (10005085)
Safe Mode: OFF
Disable Function:
NONE

name : class-vars.php
<?php
/**
 * Setter & getter utility
 *
 * @package Page Builder Framework
 */

namespace Wpbf;

defined( 'ABSPATH' ) || die( "Can't access directly" );

/**
 * Global setter & getter utility
 *
 * Vars::set($key, $value);
 *
 * @param   string/array  $key
 * @param   mix           $value
 *
 * Vars::get($key);
 * @param   string  $key
 * @return  mix     $value
 */
class Vars {

	/**
	 * Item's container
	 *
	 * @var array
	 */
	private static $vars = [];

	/**
	 * Get value from a given key
	 *
	 * @param string $name The key name.
	 * @return mixed
	 */
	public static function get( $name ) {
		$value = isset( self::$vars[ $name ] ) ? self::$vars[ $name ] : '';
		return $value;
	}

	/**
	 * Set key-value pair
	 * - single mode: set the $key as key name, $value as the data
	 * - multiple mode: set the $key as array of key-value pairs, and leave the $value empty
	 *
	 * @param string $name Can be either key name or array of key-value pairs.
	 * @param string $value The data.
	 * @return void
	 */
	public static function set( $name, $value = '' ) {
		if ( is_array( $name ) ) {
			foreach ( $name as $key => $value ) {
				self::$vars[ $key ] = $value;
			}
		} else {
			self::$vars[ $name ] = $value;
		}
	}
}
© 2026 GrazzMean