HEX
Server: LiteSpeed
System: Linux srv158.niagahoster.com 4.18.0-553.30.1.lve.el8.x86_64 #1 SMP Tue Dec 3 01:21:19 UTC 2024 x86_64
User: u1694298 (3732)
PHP: 7.4.33
Disabled: symlink,shell_exec,exec,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,show_source,pcntl_exec
Upload Files
File: /home/u1694298/public_html/becreativedigital.web.id/wp-content/plugins/unyson/framework/core/Fw.php
<?php if (!defined('FW')) die('Forbidden');

/**
 * Main framework class that contains everything
 *
 * Convention: All public properties should be only instances of the components (except special property: manifest)
 */
final class _Fw
{
	/** @var bool If already loaded */
	private static $loaded = false;

	/** @var FW_Framework_Manifest */
	public $manifest;

	/** @var _FW_Component_Extensions */
	public $extensions;

	/** @var _FW_Component_Backend */
	public $backend;

	/** @var _FW_Component_Theme */
	public $theme;

	public function __construct()
	{
		if (self::$loaded) {
			trigger_error('Framework already loaded', E_USER_ERROR);
		} else {
			self::$loaded = true;
		}

		$fw_dir = fw_get_framework_directory();

		// manifest
		{
			require $fw_dir .'/manifest.php';
			/** @var array $manifest */

			$this->manifest = new FW_Framework_Manifest($manifest);

			add_action('fw_init', array($this, '_check_requirements'), 1);
		}

		// components
		{
			$this->extensions = new _FW_Component_Extensions();
			$this->backend = new _FW_Component_Backend();
			$this->theme = new _FW_Component_Theme();
		}
	}

	/**
	 * @internal
	 */
	public function _check_requirements()
	{
		if (is_admin() && !$this->manifest->check_requirements()) {
			FW_Flash_Messages::add(
				'fw_requirements',
				__('Framework requirements not met:', 'fw') .' '. $this->manifest->get_not_met_requirement_text(),
				'warning'
			);
		}
	}
}

/**
 * @return _FW Framework instance
 */
function fw() {
	static $FW = null; // cache

	if ($FW === null) {
		$FW = new _Fw();
	}

	return $FW;
}