0xsec Shell
0xSec


Server : LiteSpeed
System : Linux webbox1.ncrdns.net 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
User : rahcos ( 1533)
PHP Version : 8.4.24
Disable Function : NONE
Directory :  /home4/rahcos/.trash/wp-content/plugins/imunify-security/inc/App/Model/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home4/rahcos/.trash/wp-content/plugins/imunify-security/inc/App/Model/Feature.php
<?php
/**
 * Copyright (с) Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2025 All Rights Reserved
 *
 * Licensed under CLOUD LINUX LICENSE AGREEMENT
 * https://www.cloudlinux.com/legal/
 */

namespace CloudLinux\Imunify\App\Model;

/**
 * Feature model class.
 */
class Feature {
	/**
	 * Feature name.
	 *
	 * @var string
	 */
	private $name;

	/**
	 * Feature URL.
	 *
	 * @var string
	 */
	private $url;

	/**
	 * Feature status.
	 *
	 * @var string
	 */
	private $status;

	/**
	 * Feature type.
	 *
	 * @var string
	 */
	private $type;

	/**
	 * Create a feature from an array.
	 *
	 * @param array $data Feature data.
	 *
	 * @return \CloudLinux\Imunify\App\Model\Feature
	 */
	public static function fromArray( $data ) {
		$feature         = new self();
		$feature->name   = $data['name'];
		$feature->url    = $data['url'];
		$feature->status = $data['status'];
		$feature->type   = $data['type'];

		return $feature;
	}

	/**
	 * Create a feature from a type.
	 *
	 * @param string $type   Feature type.
	 *
	 * @param array  $config Configuration data.
	 *
	 * @return \CloudLinux\Imunify\App\Model\Feature
	 */
	public static function fromType( $type, array $config = array() ) {
		$feature         = new self();
		$feature->name   = FeatureType::getDisplayName( $type );
		$feature->url    = FeatureType::getUrl( $type );
		$feature->status = FeatureType::getStatus( $type, $config );
		$feature->type   = $type;

		return $feature;
	}

	/**
	 * Convert feature to array.
	 *
	 * @return array
	 */
	public function toArray() {
		return array(
			'name'   => $this->name,
			'url'    => $this->url,
			'status' => $this->status,
			'type'   => $this->type,
		);
	}

	/**
	 * Get feature name.
	 *
	 * @return string
	 */
	public function getName() {
		return $this->name;
	}

	/**
	 * Get feature URL.
	 *
	 * @return string
	 */
	public function getUrl() {
		return $this->url;
	}

	/**
	 * Get feature status.
	 *
	 * @return string
	 */
	public function getStatus() {
		return $this->status;
	}

	/**
	 * Get feature status label (translated for UI).
	 *
	 * @return string
	 */
	public function getStatusLabel() {
		return FeatureStatus::getLabel( $this->status );
	}

	/**
	 * Get feature type.
	 *
	 * @return string
	 */
	public function getType() {
		return $this->type;
	}
}

c0oded By c0rpz