mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-03-02 18:27:56 +01:00
39 lines
578 B
PHP
39 lines
578 B
PHP
|
<?php
|
||
|
|
||
|
namespace Util;
|
||
|
|
||
|
/**
|
||
|
* @since 2.3
|
||
|
*/
|
||
|
class Singleton
|
||
|
{
|
||
|
/** @var \Util\Singleton Oggetto istanziato */
|
||
|
protected static $instance = null;
|
||
|
|
||
|
protected function __construct()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Restituisce l'istanza della classe in oggetto.
|
||
|
*
|
||
|
* @return Singleton
|
||
|
*/
|
||
|
public static function getInstance()
|
||
|
{
|
||
|
if (self::$instance === null) {
|
||
|
self::$instance = new static();
|
||
|
}
|
||
|
|
||
|
return self::$instance;
|
||
|
}
|
||
|
|
||
|
private function __clone()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
private function __wakeup()
|
||
|
{
|
||
|
}
|
||
|
}
|