- Added PPH-DI definition file
This commit is contained in:
		
							parent
							
								
									3e684fbd81
								
							
						
					
					
						commit
						25a8a9e472
					
				| @ -1,7 +1,12 @@ | |||||||
| { | { | ||||||
|   "name": "mcnd/taxus", |   "name": "mcnd/taxus", | ||||||
|   "description": "A simple privilege library to handle an application's permissions.", |   "description": "A simple privilege library to handle an application's permissions.", | ||||||
|   "keywords": ["mcnd","privilege","permission","taxus"], |   "keywords": [ | ||||||
|  |     "mcnd", | ||||||
|  |     "privilege", | ||||||
|  |     "permission", | ||||||
|  |     "taxus" | ||||||
|  |   ], | ||||||
|   "license": "MIT", |   "license": "MIT", | ||||||
|   "authors": [ |   "authors": [ | ||||||
|     { |     { | ||||||
| @ -13,5 +18,14 @@ | |||||||
|     "psr-4": { |     "psr-4": { | ||||||
|       "Taxus\\": "src/" |       "Taxus\\": "src/" | ||||||
|     } |     } | ||||||
|  |   }, | ||||||
|  |   "extra": { | ||||||
|  |     "lean": { | ||||||
|  |       "autoload": { | ||||||
|  |         "definitions": [ | ||||||
|  |           "meta/definitions.php" | ||||||
|  |         ] | ||||||
|  |       } | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
							
								
								
									
										22
									
								
								meta/definitions.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								meta/definitions.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,22 @@ | |||||||
|  | <?php | ||||||
|  | 
 | ||||||
|  | use function DI\autowire, DI\create, DI\get; | ||||||
|  | 
 | ||||||
|  | use Storage\Session; | ||||||
|  | 
 | ||||||
|  | use Taxus\{ Privilege, Taxus, PermissionGrantInterface, DefaultPermissionGrant }; | ||||||
|  | 
 | ||||||
|  | use Psr\Http\Message\ServerRequestInterface; | ||||||
|  | 
 | ||||||
|  | return [ | ||||||
|  | 
 | ||||||
|  |     Taxus::class => function ($c) { | ||||||
|  |         $taxus = new Taxus( $c->get(PermissionGrantInterface::class) ); | ||||||
|  | 
 | ||||||
|  |         $taxus->add(... $c->get(Lean\Lean::class)->getTaxusPrivileges()); | ||||||
|  | 
 | ||||||
|  |         return $taxus; | ||||||
|  |     }, | ||||||
|  | 
 | ||||||
|  |     PermissionGrantInterface::class => create(PermissionGrantInterface::class)->constructor(get(ServerRequestInterface::class), get(Session::class)), | ||||||
|  | ]; | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user