Initial commit

This commit is contained in:
2026-01-15 12:23:11 +01:00
commit 92fc092460
52 changed files with 2283 additions and 0 deletions

27
inc/traits/Singleton.php Normal file
View File

@@ -0,0 +1,27 @@
<?php
/**
* Cecha singleton
*
* @link https://krzysztof-turek.com
*
* @package tylkofotografia.pl
* @version 0.2
*/
trait Singleton {
private static $instances = [];
protected function __construct() { }
final protected function __clone() { }
public static function getInstance() {
$class = get_called_class();
if ( !isset( $instances[$class])) {
$instances[$class] = new $class;
}
return $instances[$class];
}
}