|
Server IP : 10.131.40.8 / Your IP : 216.73.216.37 Web Server : Apache System : Linux webd008.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : ludmqhh ( 137773) PHP Version : 8.4.10 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/ludmqhh/www/hotel-forum/wp-content/_plugins/wps-cleaner/classes/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
namespace WPS\WPS_Cleaner;
/**
* Singleton base class for having singleton implementation
* This allows you to have only one instance of the needed object
* You can get the instance with
* $class = My_Class::get_instance();
*
* /!\ The get_instance method have to be implemented !
*
* Class Singleton
* @package WPS\WPS_Cleaner
*/
trait Singleton {
/**
* @var self
*/
protected static $instance;
/**
* @return self
*/
final public static function get_instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new static;
}
return self::$instance;
}
/**
* Constructor protected from the outside
*/
final private function __construct() {
$this->init();
}
/**
* Add init function by default
* Implement this method in your child class
* If you want to have actions send at construct
*/
protected function init() {}
/**
* prevent the instance from being cloned
*
* @return void
*/
final public function __clone() {
}
/**
* prevent from being unserialized
*
* @return void
*/
final public function __wakeup() {
}
}