| 1 |
<?php |
| 2 |
|
| 3 |
namespace UltimateStoreKit\Base; |
| 4 |
|
| 5 |
if (!defined('ABSPATH')) { |
| 6 |
exit; // Exit if accessed directly. |
| 7 |
} |
| 8 |
|
| 9 |
|
| 10 |
trait Singleton { |
| 11 |
|
| 12 |
private static $instance; |
| 13 |
|
| 14 |
public static function instance() { |
| 15 |
if (!self::$instance) { |
| 16 |
self::$instance = new self(); |
| 17 |
} |
| 18 |
|
| 19 |
return self::$instance; |
| 20 |
} |
| 21 |
|
| 22 |
public static function get_instance() { |
| 23 |
return self::instance(); |
| 24 |
} |
| 25 |
|
| 26 |
public function __clone() { |
| 27 |
_doing_it_wrong(__FUNCTION__, esc_html__('Cheatin’ huh?', 'ultimate-store-kit'), '1.0.0'); |
| 28 |
} |
| 29 |
|
| 30 |
public function __wakeup() { |
| 31 |
_doing_it_wrong(__FUNCTION__, esc_html__('Cheatin’ huh?', 'ultimate-store-kit'), '1.0.0'); |
| 32 |
} |
| 33 |
} |
| 34 |
|