You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							25 lines
						
					
					
						
							478 B
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							25 lines
						
					
					
						
							478 B
						
					
					
				
								<?php
							 | 
						|
								
							 | 
						|
								namespace App\Wrappers;
							 | 
						|
								
							 | 
						|
								use App\Enumerators\SessionElement;
							 | 
						|
								
							 | 
						|
								class SessionWrapper
							 | 
						|
								{
							 | 
						|
								    public static function Start(): void
							 | 
						|
								    {
							 | 
						|
								        if (session_status() == PHP_SESSION_NONE) {
							 | 
						|
								            session_start();
							 | 
						|
								        }
							 | 
						|
								    }
							 | 
						|
								
							 | 
						|
								    public static function Get(SessionElement $target)
							 | 
						|
								    {
							 | 
						|
								        self::Start();
							 | 
						|
								        if(array_key_exists(key: $target->value, array: $_SESSION))
							 | 
						|
								        {
							 | 
						|
								            return $_SESSION[$target->value];
							 | 
						|
								        }
							 | 
						|
								        die();
							 | 
						|
								    }
							 | 
						|
								}
							 | 
						|
								
							 |