| Server IP : / Your IP : 216.73.216.44 Web Server : nginx/1.31.3 System : Linux dcde39c899c5 6.12.95+deb13-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.95-1 (2026-07-04) x86_64 User : www-data ( 1000) PHP Version : 8.4.15 Disable Function : phpinfo MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/html/wp-content/themes/yuki/lotta-framework/src/ |
Upload File : |
<?php
namespace LottaFramework;
use Illuminate\Container\Container;
class Application extends Container {
const VERSION = '2.0.7';
/**
* Application id
*
* @var mixed|string
*/
protected $_id;
/**
* @var string
*/
protected $_uri = '';
/**
* @param string $id
* @param string $uri
*/
public function __construct( string $id, string $uri ) {
$this->_id = $id;
$this->_uri = $uri;
static::setInstance( $this );
}
/**
* @return mixed|string
*/
public function id() {
return $this->_id;
}
/**
* @return mixed|string
*/
public function uri() {
return $this->_uri;
}
/**
* 'do_action' wrapper that prefixes the hook name with id
*
* @param $hook_name
* @param ...$args
*/
public function do_action( $hook_name, ...$args ) {
do_action( $this->uniqid( $hook_name ), ...$args );
}
/**
* 'add_action' wrapper that prefixes the hook name with id
*
* @param $hook_name
* @param $callback
* @param int $priority
* @param int $accepted_args
*/
public function add_action( $hook_name, $callback, $priority = 10, $accepted_args = 1 ) {
add_action( $this->uniqid( $hook_name ), $callback, $priority, $accepted_args );
}
/**
* 'apply_filters' wrapper that prefixes the hook name with id
*
* @param $hook_name
* @param $value
*/
public function apply_filters( $hook_name, $value ) {
apply_filters( $this->uniqid( $hook_name ), $value );
}
/**
* 'add_filter' wrapper that prefixes the hook name with id
*
* @param $hook_name
* @param $callback
* @param mixed ...$args
*/
public function add_filter( $hook_name, $callback, ...$args ) {
add_filter( $this->uniqid( $hook_name ), $callback, ...$args );
}
/**
* Get prefixed id
*
* @param string $id
* @param string $sep
*
* @return string
*/
public function uniqid( string $id, string $sep = '_' ) {
if ( empty( $this->_id ) ) {
return $id;
}
return $this->_id . $sep . $id;
}
/**
* Add supported features
*
* @param $feature
*
* @return mixed
*/
public function support( $feature ) {
return $this->instance( "features.{$feature}", true );
}
/**
* Check if a featured enabled or not
*
* @param $feature
*
* @return bool
*/
public function isSupport( $feature ) {
return $this->has( "features.{$feature}" );
}
}