Done !
| Server IP : 46.105.57.169 / Your IP : 216.73.216.67 Web Server : Apache System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : verseaumee ( 152031) PHP Version : 8.5.7 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaumee/blueversion/wp-content/plugins/unyson/framework/helpers/ |
Upload File : |
<?php if (!defined('FW')) die('Forbidden');
/**
* Used in public callbacks to allow call only from known caller
*
* For e.g. Inside some class is created an instance of FW_Access_Key with unique key 'whatever',
* so nobody else can create another instance with same key, only that class owns that unique key.
* Some public callback (function or method) that wants to allow to be called only by that class,
* sets an requirement that some parameter should be an instance on FW_Access_Key and its key should be 'whatever'
*
* function my_function(FW_Access_Key $key, $another_parameter) {
* if ($key->get_key() !== 'whatever') {
* trigger_error('Call denied', E_USER_ERROR);
* }
*
* //...
* }
*/
final class FW_Access_Key
{
private static $created_keys = array();
private $key;
final public function get_key()
{
return $this->key;
}
/**
* @param string $unique_key unique
*/
final public function __construct($unique_key)
{
if (isset(self::$created_keys[$unique_key])) {
trigger_error('Key "'. $unique_key .'" already defined', E_USER_ERROR);
}
self::$created_keys[$unique_key] = true;
$this->key = $unique_key;
}
}