modifs.mineures sans commentaires
This commit is contained in:
		
							parent
							
								
									c76dc98c31
								
							
						
					
					
						commit
						014825f09d
					
				| @ -9,6 +9,7 @@ use nulib\ExitError; | ||||
| use nulib\os\path; | ||||
| use nulib\os\sh; | ||||
| use nulib\php\func; | ||||
| use nulib\ref\ref_profiles; | ||||
| use nulib\str; | ||||
| use nulib\ValueException; | ||||
| 
 | ||||
| @ -114,13 +115,21 @@ class app { | ||||
|   static function get_profile(?bool &$productionMode=null): string { | ||||
|     return self::get()->getProfile($productionMode); | ||||
|   } | ||||
| 
 | ||||
|   static function is_production_mode(): bool { | ||||
|     return self::get()->isProductionMode(); | ||||
|   } | ||||
|    | ||||
|   static function is_prod(): bool { | ||||
|     return self::get_profile() === "prod"; | ||||
|     return self::get_profile() === ref_profiles::PROD; | ||||
|   } | ||||
| 
 | ||||
|   static function is_test(): bool { | ||||
|     return self::get_profile() === ref_profiles::TEST; | ||||
|   } | ||||
| 
 | ||||
|   static function is_devel(): bool { | ||||
|     return self::get_profile() === "devel"; | ||||
|     return self::get_profile() === ref_profiles::DEVEL; | ||||
|   } | ||||
| 
 | ||||
|   static function set_profile(?string $profile=null, ?bool $productionMode=null): void { | ||||
|  | ||||
| @ -14,6 +14,7 @@ use nulib\output\console; | ||||
| use nulib\output\log; | ||||
| use nulib\output\msg; | ||||
| use nulib\output\std\StdMessenger; | ||||
| use nulib\ref\ref_profiles; | ||||
| 
 | ||||
| /** | ||||
|  * Class Application: application de base | ||||
| @ -257,9 +258,9 @@ EOT); | ||||
|         "action" => [app::class, "set_profile"], | ||||
|         "help" => "spécifier le profil d'exécution", | ||||
|       ], | ||||
|       ["-P", "--prod", "action" => [app::class, "set_profile", "prod"]], | ||||
|       ["-T", "--test", "action" => [app::class, "set_profile", "test"]], | ||||
|       ["--devel", "action" => [app::class, "set_profile", "devel"]], | ||||
|       ["-P", "--prod", "action" => [app::class, "set_profile", ref_profiles::PROD]], | ||||
|       ["-T", "--test", "action" => [app::class, "set_profile", ref_profiles::TEST]], | ||||
|       ["--devel", "action" => [app::class, "set_profile", ref_profiles::DEVEL]], | ||||
|     ], | ||||
|   ]; | ||||
| 
 | ||||
| @ -307,9 +308,9 @@ EOT); | ||||
|   } | ||||
| 
 | ||||
|   const PROFILE_COLORS = [ | ||||
|     "prod" => "@r", | ||||
|     "test" => "@g", | ||||
|     "devel" => "@w", | ||||
|     ref_profiles::PROD => "@r", | ||||
|     ref_profiles::TEST => "@g", | ||||
|     ref_profiles::DEVEL => "@w", | ||||
|   ]; | ||||
|   const DEFAULT_PROFILE_COLOR = "y"; | ||||
| 
 | ||||
|  | ||||
| @ -3,6 +3,7 @@ namespace nulib\app\config; | ||||
| 
 | ||||
| use nulib\app\app; | ||||
| use nulib\app\config; | ||||
| use nulib\ref\ref_profiles; | ||||
| 
 | ||||
| /** | ||||
|  * Class ProfileManager: gestionnaire de profils | ||||
| @ -21,10 +22,7 @@ class ProfileManager { | ||||
|   const PROFILES = null; | ||||
| 
 | ||||
|   /** @var array profils dont le mode production doit être actif */ | ||||
|   const PRODUCTION_MODES = [ | ||||
|     "prod" => true, | ||||
|     "test" => true, | ||||
|   ]; | ||||
|   const PRODUCTION_MODES = ref_profiles::PRODUCTION_MODES; | ||||
| 
 | ||||
|   /** | ||||
|    * @var array mapping profil d'application --> profil effectif | ||||
| @ -114,7 +112,7 @@ class ProfileManager { | ||||
|     $profile ??= $this->getConfigProfile(); | ||||
|     $profile ??= $this->getDefaultProfile(); | ||||
|     if ($this->isAppProfile) { | ||||
|       $profile ??= $this->profiles[0] ?? "prod"; | ||||
|       $profile ??= $this->profiles[0] ?? ref_profiles::PROD; | ||||
|     } else { | ||||
|       $profile ??= $this->mapProfile(app::get_profile()); | ||||
|     } | ||||
|  | ||||
| @ -6,7 +6,7 @@ use nulib\NoMoreDataException; | ||||
| use nulib\os\EOFException; | ||||
| use nulib\os\IOException; | ||||
| use nulib\php\iter\AbstractIterator; | ||||
| use nulib\ref\file\csv\ref_csv; | ||||
| use nulib\ref\ref_csv; | ||||
| use nulib\str; | ||||
| use nulib\ValueException; | ||||
| 
 | ||||
|  | ||||
| @ -2,7 +2,7 @@ | ||||
| namespace nulib\file\csv; | ||||
| 
 | ||||
| use nulib\cl; | ||||
| use nulib\ref\file\csv\ref_csv; | ||||
| use nulib\ref\ref_csv; | ||||
| use nulib\str; | ||||
| 
 | ||||
| class csv_flavours { | ||||
|  | ||||
							
								
								
									
										11
									
								
								php/src/ref/ref_cache.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								php/src/ref/ref_cache.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,11 @@ | ||||
| <?php | ||||
| namespace nulib\ref; | ||||
| 
 | ||||
| /** | ||||
|  * Class ref_cache: référence des durées de mise en cache | ||||
|  */ | ||||
| class ref_cache { | ||||
|   const MINUTE = 60; | ||||
|   const HOUR = 60 * self::MINUTE; | ||||
|   const DAY = 24 * self::HOUR; | ||||
| } | ||||
| @ -1,5 +1,5 @@ | ||||
| <?php | ||||
| namespace nulib\ref\file\csv; | ||||
| namespace nulib\ref; | ||||
| 
 | ||||
| /** | ||||
|  * Class ref_csv: références des valeurs normalisées pour les fichiers CSV à | ||||
| @ -1,5 +1,5 @@ | ||||
| <?php | ||||
| namespace nulib\ref\php; | ||||
| namespace nulib\ref; | ||||
| 
 | ||||
| class ref_func { | ||||
|   const CALL_ALL_PARAMS_SCHEMA = [ | ||||
							
								
								
									
										15
									
								
								php/src/ref/ref_jquery.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								php/src/ref/ref_jquery.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,15 @@ | ||||
| <?php | ||||
| namespace nulib\ref; | ||||
| 
 | ||||
| class ref_jquery { | ||||
|   const HAVE_JQUERY = true; | ||||
| 
 | ||||
|   function printJquery(): void { | ||||
|     ?>
 | ||||
| <script type="text/javascript"> | ||||
| jQuery.noConflict()(function($) { | ||||
| }); | ||||
| </script> | ||||
| <?php | ||||
|   } | ||||
| } | ||||
| @ -1,5 +1,5 @@ | ||||
| <?php | ||||
| namespace nulib\ref\web; | ||||
| namespace nulib\ref; | ||||
| 
 | ||||
| class ref_mimetypes { | ||||
|   const TXT = "text/plain"; | ||||
							
								
								
									
										22
									
								
								php/src/ref/ref_profiles.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								php/src/ref/ref_profiles.php
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,22 @@ | ||||
| <?php | ||||
| namespace nulib\ref; | ||||
| 
 | ||||
| /** | ||||
|  * Class ref_profiles: noms de profils normalisés | ||||
|  */ | ||||
| class ref_profiles { | ||||
|   const PROD = "prod"; | ||||
|   const TEST = "test"; | ||||
|   const DEVEL = "devel"; | ||||
| 
 | ||||
|   const PROFILES = [ | ||||
|     self::PROD, | ||||
|     self::TEST, | ||||
|     self::DEVEL, | ||||
|   ]; | ||||
| 
 | ||||
|   const PRODUCTION_MODES = [ | ||||
|     self::PROD => true, | ||||
|     self::TEST => true, | ||||
|   ]; | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user