public function __construct() { if (isset(self::$singleton) && !IS_CLI) { throw new NotSingletonException(get_called_class()); } self::$singleton = TRUE; }