mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
Commit iniziale (r1662)
Migrazione da SourceForge, partendo dal commit 1662 della carrtella trunk/openstamanager.
This commit is contained in:
38
lib/classes/Util/Singleton.php
Normal file
38
lib/classes/Util/Singleton.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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()
|
||||
{
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user