Jelajahi Sumber

Fallback config pour 0.7-beta

Marien Fressinaud 12 tahun lalu
induk
melakukan
a46ee26e35
1 mengubah file dengan 10 tambahan dan 4 penghapusan
  1. 10 4
      lib/Minz/Configuration.php

+ 10 - 4
lib/Minz/Configuration.php

@@ -231,10 +231,16 @@ class Minz_Configuration {
 				self::$environment = Minz_Configuration::PRODUCTION;
 				break;
 			default:
-				throw new Minz_BadConfigurationException (
-					'environment',
-					Minz_Exception::ERROR
-				);
+				if ($general['environment'] >= 0 &&
+					$general['environment'] <= 2) {
+					// fallback 0.7-beta
+					self::$environment = $general['environment'];
+				} else {
+					throw new Minz_BadConfigurationException (
+						'environment',
+						Minz_Exception::ERROR
+					);
+				}
 			}
 
 		}