PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
| Dir : /home/oligap/public_html/wp-content/themes/woodmart/inc/classes/ |
| Server: Linux cloud.virginhosting.lk 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64 IP: 128.140.68.198 |
| Dir : /home/oligap/public_html/wp-content/themes/woodmart/inc/classes/Singleton.php |
<?php
/**
* Singleton pattern class.
*
* @package xts
*/
namespace XTS;
/**
* Singleton pattern class.
*
* @since 1.0.0
*/
class Singleton {
/**
* Instance of this static object.
*
* @var array
*/
private static $instances = [];
/**
* Get singleton instance.
*
* @since 1.0.0
*
* @return object Current object instance.
*/
public static function get_instance() {
$subclass = static::class;
if ( ! isset( self::$instances[ $subclass ] ) ) {
self::$instances[ $subclass ] = new static();
self::$instances[ $subclass ]->init();
}
return self::$instances[ $subclass ];
}
/**
* Prevent singleton class clone.
*
* @since 1.0.0
*/
private function __clone() {}
/**
* Prevent singleton class initialization.
*
* @since 1.0.0
*/
private function __construct() {}
}