Uname: Linux premium294.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
Software: LiteSpeed
PHP version: 8.1.32 [ PHP INFO ] PHP os: Linux
Server Ip: 104.21.112.1
Your Ip: 216.73.216.223
User: mjbynoyq (1574) | Group: mjbynoyq (1570)
Safe Mode: OFF
Disable Function:
NONE

name : extension.php
<?php

final class Brizy_Editor_ThirdParty_Extension implements Brizy_Editor_ThirdParty_ExtensionInterface {


	private $publicPath;
	private $name;
	private $title;
	private $category;
	/**
	 * @var void[]
	 */
	private $editorScripts;
	/**
	 * @var void[]
	 */
	private $viewScripts;
	/**
	 * @var void[]
	 */
	private $editorStyles;
	/**
	 * @var void[]
	 */
	private $viewStyles;
	private $version;


	public function __construct( $publicUrl, $file ) {

		$this->publicPath = $publicUrl;
		if ( ! file_exists( $file ) ) {
			throw new \Exception( "File $file does not exist" );
		}
		$config = json_decode( file_get_contents( $file ) );
		if ( is_null( $config ) ) {
			throw new \Exception( "Invalid config object provided" );
		}
		$this->name     = $config->name;
		$this->title    = $config->title;
		$this->version  = $config->version;
		$this->category = $config->category;
		$closure = function ( $file ) {
			if ( strpos( $file, "http" ) !== 0 ) {
				return $this->publicPath . $file;
			}

			return $file;
		};
		$this->editorScripts = \array_map( $closure, $config->editorScripts ?: [] );
		$this->viewScripts   = \array_map( $closure, $config->viewScripts ?: [] );
		$this->editorStyles  = \array_map( $closure, $config->editorStyles ?: [] );
		$this->viewStyles    = \array_map( $closure, $config->viewStyles ?: [] );

	}

	/**
	 * @return mixed
	 */
	public function getPublicPath() {
		return $this->publicPath;
	}

	/**
	 * @return mixed
	 */
	public function getName() {
		return $this->name;
	}

	/**
	 * @return mixed
	 */
	public function getTitle() {
		return $this->title;
	}

	/**
	 * @return mixed
	 */
	public function getCategory() {
		return $this->category;
	}

	/**
	 * @return void[]
	 */
	public function getEditorScripts() {
		return $this->editorScripts;
	}

	/**
	 * @return void[]
	 */
	public function getViewScripts() {
		return $this->viewScripts;
	}

	/**
	 * @return void[]
	 */
	public function getEditorStyles() {
		return $this->editorStyles;
	}

	/**
	 * @return void[]
	 */
	public function getViewStyles() {
		return $this->viewStyles;
	}

	/**
	 * @return mixed
	 */
	public function getVersion() {
		return $this->version;
	}
}
© 2025 XylotrechusZ