25 lines
		
	
	
		
			441 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			441 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Core;
 | |
| 
 | |
| use \Exception;
 | |
| 
 | |
| /**
 | |
|  * TODO: ... this should validate the config and stuffs
 | |
|  */
 | |
| class Config
 | |
| {
 | |
|     /**
 | |
|      * Should hold the validated config array
 | |
|      */
 | |
|     public array $config;
 | |
| 
 | |
|     public function __construct(string $path)
 | |
|     {
 | |
|         if (!file_exists($path))
 | |
|         {
 | |
|             throw new Exception("Could not find configuration file: $path");
 | |
|         }
 | |
|         $this->config = require $path;
 | |
|     }
 | |
| } |