From 0398196913b7c9920e6163ef8bdef53e5bf92fce Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 16 Mar 2006 03:06:29 +0000 Subject: Changed THttpSession.Storage to UseCustomStorage. Fixed some doc errors. --- HISTORY | 41 ++++++++++++------- UPGRADE | 16 ++++++-- framework/Security/TAuthManager.php | 4 +- framework/Security/TUserManager.php | 2 +- framework/Web/THttpSession.php | 79 ++++++++++++++++--------------------- framework/Web/UI/TThemeManager.php | 2 +- 6 files changed, 78 insertions(+), 66 deletions(-) diff --git a/HISTORY b/HISTORY index 3bbd6e5a..0018572e 100644 --- a/HISTORY +++ b/HISTORY @@ -1,18 +1,31 @@ +Version 3.0RC1 April 1, 2006 +============================ +BUG: Ticket#88 - Unclosed HTML tag rendered in TDatePicker + and TColorPicker (Qiang) +BUG: Ticket#85 - Undefined TDataGrid::setSelectedIndex (Qiang) +BUG: Ticket#87 - Typo in IDbConnection (Qiang) +BUG: SF#1446846 - Typo in THead (Qiang) +BUG: SF#1432624 - Incorrect documentation about caching expiry (Qiang) +BUG: THttpSession fails when user storage module is used (Qiang) +ENH: TDataFieldAccessor can access public class variables (Qiang) +NEW: TSQLMap module (Wei) +NEW: TStack class (Qiang) + Version 3.0b March 6, 2006 -============================= -- BUG: fixed many -- CHG: event names must be prefixed with 'On' (Qiang) -- CHG: values of properties whose name ends with 'Template' are - parsed directly by template parser (Qiang) -- ENH: template parser reports exact error location (Qiang) -- ENH: cookie HMAC check (Qiang) -- NEW: TInlineFrame (Jason) -- NEW: TAPCCache (Alban) -- NEW: TColorPicker, TDatePicker, TRatingList, TAdodbProvider, - TCreoleProvider (Wei) -- NEW: TMultiView, TView, TControlAdapter, TWebControlAdapter, - TPagedList, TAttributeCollection (Qiang) +========================== +BUG: fixed many +CHG: event names must be prefixed with 'On' (Qiang) +CHG: values of properties whose name ends with 'Template' are + parsed directly by template parser (Qiang) +ENH: template parser reports exact error location (Qiang) +ENH: cookie HMAC check (Qiang) +NEW: TInlineFrame (Jason) +NEW: TAPCCache (Alban) +NEW: TColorPicker, TDatePicker, TRatingList, TAdodbProvider, + TCreoleProvider (Wei) +NEW: TMultiView, TView, TControlAdapter, TWebControlAdapter, + TPagedList, TAttributeCollection (Qiang) Version 3.0a January 18, 2006 ============================= -Starting, main feaures are ready (Qiang) +Starting, main feaures ready (Qiang) diff --git a/UPGRADE b/UPGRADE index 4b6688a7..ada6bb77 100644 --- a/UPGRADE +++ b/UPGRADE @@ -1,10 +1,20 @@ - PRADO v3.0b March 6, 2006 - ========================= + Upgrading Instructions for PRADO Framework v3.0RC1 + ================================================== + +The following upgrading instructions are cumulative. That is, +if you want to upgrade from version A to version C and there is +version B between A and C, then you need to following instructions +for both A and B. + + +Upgrading from v3.0b +-------------------- +THttpSession.Storage is changed to UseCustomStorage Upgrading from v3.0a -------------------- -A major change is the event names, which must be prefixed with 'On'. +All event names must start with 'On'. Upgrading from v2.x and v1.x ---------------------------- diff --git a/framework/Security/TAuthManager.php b/framework/Security/TAuthManager.php index 819b7b36..b4856ee5 100644 --- a/framework/Security/TAuthManager.php +++ b/framework/Security/TAuthManager.php @@ -26,8 +26,8 @@ Prado::using('System.Security.TUserManager'); * To login or logout a user, call {@link login} or {@link logout}, respectively. * * To load TAuthManager, configure it in application configuration as follows, - * - * + * + * * * @author Qiang Xue * @version $Revision: $ $Date: $ diff --git a/framework/Security/TUserManager.php b/framework/Security/TUserManager.php index c799c446..5ad582e1 100644 --- a/framework/Security/TUserManager.php +++ b/framework/Security/TUserManager.php @@ -168,7 +168,7 @@ class TUser extends TComponent implements IUser * * TUserManager manages a static list of users {@link TUser}. * The user information is specified via module configuration using the following XML syntax, - * + * * * * diff --git a/framework/Web/THttpSession.php b/framework/Web/THttpSession.php index 97ab6b08..fa53022d 100644 --- a/framework/Web/THttpSession.php +++ b/framework/Web/THttpSession.php @@ -29,23 +29,27 @@ * * * The following configurations are available for session: - * AutoStart, Cookie, CacheLimiter, SavePath, Storage, GCProbability, CookieUsage, Timeout. + * {@link setAutoStart AutoStart}, {@link setCookie Cookie}, + * {@link setCacheLimiter, {@link setSavePath SavePath}, + * {@link setUseCustomStorage UseCustomStorage}, {@link setGCProbability GCProbability}, + * {@link setCookieUsage CookieUsage}, {@link setTimeout Timeout}. * See the corresponding setter and getter documentation for more information. * Note, these properties must be set before the session is started. * * THttpSession can be inherited with customized session storage method. * Override {@link _open}, {@link _close}, {@link _read}, {@link _write}, {@link _destroy} and {@link _gc} - * and set Storage as 'Custom' to store session using methods other than files and shared memory. + * and set {@link setUseCustomStorage UseCustomStorage} to true. + * Then, the session data will be stored using the above methods. * * By default, THttpSession is registered with {@link TApplication} as the * request module. It can be accessed via {@link TApplication::getSession()}. * * THttpSession may be configured in application configuration file as follows, - * * where {@link getSessionName SessionName}, {@link getSavePath SavePath}, - * {@link getCookieMode CookieMode}, {@link getStorage Storage}, + * {@link getCookieMode CookieMode}, {@link getUseCustomStorage UseCustomStorage}, * {@link getAutoStart AutoStart}, {@link getGCProbability GCProbability}, * {@link getUseTransparentSessionID UseTransparentSessionID} and * {@link getTimeOut TimeOut} are configurable properties of THttpSession. @@ -77,6 +81,20 @@ class THttpSession extends TApplicationComponent implements IteratorAggregate,Ar * @var string module id */ private $_id; + /** + * @var boolean + */ + private $_customStorage=false; + + /** + * Destructor. + * Closes session. + */ + public function __destruct() + { + if($this->_started) + $this->close(); + } /** * @return string id of this module @@ -115,6 +133,8 @@ class THttpSession extends TApplicationComponent implements IteratorAggregate,Ar { if(!$this->_started) { + if($this->_customStorage) + session_set_save_handler(array($this,'_open'),array($this,'_close'),array($this,'_read'),array($this,'_write'),array($this,'_destroy'),array($this,'_gc')); if($this->_cookie!==null) session_set_cookie_params($this->_cookie->getExpire(),$this->_cookie->getPath(),$this->_cookie->getDomain(),$this->_cookie->getSecure()); session_start(); @@ -219,53 +239,22 @@ class THttpSession extends TApplicationComponent implements IteratorAggregate,Ar } /** - * @return string (File|SharedMemory|Custom) storage medium of session, defaults to 'File'. - * @see setStorage + * @return boolean whether to use user-specified handlers to store session data. Defaults to false. */ - public function getStorage() + public function getUseCustomStorage() { - switch(session_module_name()) - { - case 'files': return 'File'; - case 'mm': return 'SharedMemory'; - case 'user': return 'Custom'; - default: return 'Unknown'; - } + return $this->_customStorage; } /** - * Sets the storage medium of session data. - * By default, the session data is stored in files (File). - * You may change to use shared memory (SharedMemory) for better performance - * if shared memory is available on the server. - * Or you may choose to use your own storage (Custom). If you do so, - * make sure you override {@link _open}, {@link _close}, {@link _read}, - * {@link _write}, {@link _destroy}, and {@link _gc}. - * @param string (File|SharedMemory|Custom) storage medium of session. - * @throws TInvalidOperationException if session is started already + * @param boolean whether to use user-specified handlers to store session data. + * If true, make sure the methods {@link _open}, {@link _close}, {@link _read}, + * {@link _write}, {@link _destroy}, and {@link _gc} are overridden in child + * class, because they will be used as the callback handlers. */ - public function setStorage($value) + public function setUseCustomStorage($value) { - if($this->_started) - throw new TInvalidOperationException('httpsession_storage_unchangeable'); - else - { - $value=TPropertyValue::ensureEnum($value,array('File','SharedMemory','Custom')); - if($value==='Custom') - session_set_save_handler(array($this,'_open'),array($this,'_close'),array($this,'_read'),array($this,'_write'),array($this,'_destroy'),array($this,'_gc')); - switch($value) - { - case 'Custom': - session_module_name('user'); - break; - case 'SharedMemory': - session_module_name('mm'); - break; - default: - session_module_name('files'); - break; - } - } + $this->_customStorage=TPropertyValue::ensureBoolean($value); } /** diff --git a/framework/Web/UI/TThemeManager.php b/framework/Web/UI/TThemeManager.php index 00b3f60f..29b48d90 100644 --- a/framework/Web/UI/TThemeManager.php +++ b/framework/Web/UI/TThemeManager.php @@ -26,7 +26,7 @@ * * TThemeManager may be configured within page service tag in application * configuration file as follows, - * * where {@link getCacheExpire CacheExpire}, {@link getCacheControl CacheControl} * and {@link getBufferOutput BufferOutput} are configurable properties of THttpResponse. -- cgit v1.2.3