| Server IP : 170.10.161.225 / Your IP : 216.73.216.78 Web Server : Apache System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : calvet ( 273824) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : ON Directory : /home/www/calvetrealty.com/wp-content/plugins/imagify/classes/Traits/ |
Upload File : |
<?php
namespace Imagify\Traits;
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
/**
* Trait that simulates a singleton pattern.
* The idea is more to ease the instance retrieval than to prevent multiple instances.
* This is temporary, until we get a DI container.
*
* @since 1.9
* @since 1.9.4 Renamed into InstanceGetterTrait.
* @author Grégory Viguier
*/
trait InstanceGetterTrait {
/**
* The "not-so-single" instance of the class.
*
* @var object
* @since 1.9
* @access protected
* @author Grégory Viguier
*/
protected static $instance;
/**
* Get the main Instance.
*
* @since 1.9
* @access protected
* @author Grégory Viguier
*
* @return object Main instance.
*/
public static function get_instance() {
if ( ! isset( static::$instance ) ) {
static::$instance = new static();
}
return static::$instance;
}
}