diff options
author | xue <> | 2006-09-03 21:33:04 +0000 |
---|---|---|
committer | xue <> | 2006-09-03 21:33:04 +0000 |
commit | a90da4361d02a53204f198f19072e2d420b394f0 (patch) | |
tree | ecf9a1990fe1ffb9c9df405123c0e68504ecf8bb /framework/TApplication.php | |
parent | a55994488789e9c481aab5e3e49b15bd9718afc1 (diff) |
Added TEnumerable and updated places where enumerable type should be used.
Diffstat (limited to 'framework/TApplication.php')
-rw-r--r-- | framework/TApplication.php | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/framework/TApplication.php b/framework/TApplication.php index 375df885..0cce1a1a 100644 --- a/framework/TApplication.php +++ b/framework/TApplication.php @@ -112,7 +112,8 @@ require_once(PRADO_DIR.'/I18N/TGlobalization.php'); class TApplication extends TComponent { /** - * application state + * possible application mode. + * @deprecated deprecated since version 3.0.4 (use TApplicationMode constants instead) */ const STATE_OFF='Off'; const STATE_DEBUG='Debug'; @@ -260,9 +261,9 @@ class TApplication extends TComponent */ private $_authRules=null; /** - * @var string application mode + * @var TApplicationMode application mode */ - private $_mode='Debug'; + private $_mode=TApplicationMode::Debug; /** * Constructor. @@ -465,7 +466,7 @@ class TApplication extends TComponent } /** - * @return string application mode (Off|Debug|Normal|Peformance), defaults to Debug. + * @return TApplicationMode application mode. Defaults to TApplicationMode::Debug. */ public function getMode() { @@ -473,11 +474,11 @@ class TApplication extends TComponent } /** - * @param string application mode. Valid values include Off, Debug, Normal, or Peformance + * @param TApplicationMode application mode */ public function setMode($value) { - $this->_mode=TPropertyValue::ensureEnum($value,array(self::STATE_OFF,self::STATE_DEBUG,self::STATE_NORMAL,self::STATE_PERFORMANCE)); + $this->_mode=TPropertyValue::ensureEnumerable($value,'TApplicationMode'); } /** @@ -1037,6 +1038,28 @@ class TApplication extends TComponent } } +/** + * TApplicationMode class. + * TApplicationMode defines the possible mode that an application can be set at by + * setting {@link TApplication::setMode Mode}. + * In particular, the following modes are defined + * - Off: the application is not running. Any request to the application will obtain an error. + * - Debug: the application is running in debug mode. + * - Debug: the application is running in normal production mode. + * - Performance: the application is running in performance mode. + * @author Qiang Xue <qiang.xue@gmail.com> + * @version $Revision: $ $Date: $ + * @package System + * @since 3.0.4 + */ +class TApplicationMode extends TEnumerable +{ + const Off='Off'; + const Debug='Debug'; + const Normal='Normal'; + const Performance='Performance'; +} + /** * TApplicationConfiguration class. |