first commit

This commit is contained in:
2026-03-05 13:07:40 +01:00
commit 64ba0721ee
25709 changed files with 4691006 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
<?php namespace BEAPI\Maintenance_Mode;
trait Singleton {
/**
* @var self
*/
protected static $instance;
/**
* @return self
*/
final public static function get_instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new static;
}
return self::$instance;
}
/**
* Constructor protected from the outside
*/
final private function __construct() {
$this->init();
}
/**
* Add init function by default
* Implement this method in your child class
* If you want to have actions send at construct
*/
protected function init() {}
/**
* prevent the instance from being cloned
*
* @return void
*/
final private function __clone() {
}
/**
* prevent from being unserialized
*
* @return void
*/
final private function __wakeup() {}
}