From 47e6ce79dfaa25397c8d1bfec2134f17c894ed87 Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 18 Nov 2005 01:26:39 +0000 Subject: --- framework/Exceptions/TErrorHandler.php | 3 ++ framework/Exceptions/messages.en | 40 ++++++++++++---------- framework/Web/TAssetManager.php | 36 +++++-------------- .../Web/UI/THiddenFieldPageStatePersister.php | 2 +- 4 files changed, 34 insertions(+), 47 deletions(-) diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php index af41e056..9af83d5e 100644 --- a/framework/Exceptions/TErrorHandler.php +++ b/framework/Exceptions/TErrorHandler.php @@ -6,6 +6,9 @@ class TErrorHandler extends TComponent implements IModule * @var string module ID */ private $_id; + /** + * @var TApplication application instance + */ private $_application; /** diff --git a/framework/Exceptions/messages.en b/framework/Exceptions/messages.en index ef3d38a0..9c5dae1c 100644 --- a/framework/Exceptions/messages.en +++ b/framework/Exceptions/messages.en @@ -7,12 +7,10 @@ component_statements_invalid = Component '%s' is evaluating invalid PHP statem propertyvalue_enumvalue_invalid = Value '%s' is a not valid enumeration value (%s). -uri_format_invalid = '%s' is not a valid URI. - -application_configfile_inexistent = Application configuration file "%s" does not exist. -application_module_existing = Application module "%s" cannot be registered twice. -application_service_invalid = Service "%s" must implement IService interface. -application_service_unknown = Requested service "%s" is not defined. +application_configfile_inexistent = Application configuration file '%s' does not exist. +application_module_existing = Application module '%s' cannot be registered twice. +application_service_invalid = Service '%s' must implement IService interface. +application_service_unknown = Requested service '%s' is not defined. appconfig_aliaspath_invalid = Application configuration uses an invalid file path "%s". appconfig_aliasid_required = Application configuration element must have an "id" attribute. @@ -23,23 +21,27 @@ appconfig_serviceid_required = Application configuration element mus appconfig_servicetype_required = Application configuration must have a "type" attribute. appconfig_parameterid_required = Application configuration element must have an "id" attribute. -httpresponse_bufferoutput_unchangeable = Property THttpResponse.BufferOutput cannot be modified after THttpResponse is initialized. +uri_format_invalid = '%s' is not a valid URI. + +httpresponse_bufferoutput_unchangeable = THttpResponse.BufferOutput cannot be modified after THttpResponse is initialized. httpresponse_file_inexistent = THttpResponse cannot send file '%s'. The file does not exist. -httpsession_sessionid_unchangeable = Session ID cannot be modified after the session is started. -httpsession_sessionname_unchangeable = Session name cannot be modified after the session is started. -httpsession_sessionname_invalid = Session name must contain alphanumeric characters only. -httpsession_savepath_unchangeable = Session SavePath cannot be modified after the session is started. -httpsession_savepath_invalid = Session SavePath '%s' is invalid. -httpsession_storage_unchangeable = Session storage cannot be modified after the session is started. -httpsession_cookiemode_unchangeable = Session CookieMode cannot be modified after the session is started. -httpsession_autostart_unchangeable = Session AutoStart cannot be modified after the session module is initialized. -httpsession_gcprobability_unchangeable = Session GCProbability cannot be modified after the session is started. -httpsession_gcprobability_invalid = Session GCProbability must be an integer between 0 and 100. -httpsession_transid_unchangeable = Session UseTransparentSessionID cannot be modified after the session is started. -httpsession_maxlifetime_unchangeable = Session Timeout cannot be modified after the session is started. +httpsession_sessionid_unchangeable = THttpSession.SessionID cannot be modified after the session is started. +httpsession_sessionname_unchangeable = THttpSession.SessionName cannot be modified after the session is started. +httpsession_sessionname_invalid = THttpSession.SessionName must contain alphanumeric characters only. +httpsession_savepath_unchangeable = THttpSession.SavePath cannot be modified after the session is started. +httpsession_savepath_invalid = THttpSession.SavePath '%s' is invalid. +httpsession_storage_unchangeable = THttpSession.Storage cannot be modified after the session is started. +httpsession_cookiemode_unchangeable = THttpSession.CookieMode cannot be modified after the session is started. +httpsession_autostart_unchangeable = THttpSession.AutoStart cannot be modified after the session module is initialized. +httpsession_gcprobability_unchangeable = THttpSession.GCProbability cannot be modified after the session is started. +httpsession_gcprobability_invalid = THttpSession.GCProbability must be an integer between 0 and 100. +httpsession_transid_unchangeable = THttpSession.UseTransparentSessionID cannot be modified after the session is started. +httpsession_maxlifetime_unchangeable = THttpSession.Timeout cannot be modified after the session is started. assetmanager_basepath_invalid = TAssetManager.BasePath '%s' is invalid. Make sure the directory exists and is writable by the Web server process. +assetmanager_basepath_unchangeable = TAssetManager.BasePath cannot be modified after the module is initialized. +assetmanager_baseurl_unchangeable = TAssetManager.BaseUrl cannot be modified after the module is initialized. body_contents_not_allowed = %s: body contents are not allowed. control_id_not_unique = Control ID '%s' is not unique for control type '%s'. diff --git a/framework/Web/TAssetManager.php b/framework/Web/TAssetManager.php index 3b2131a5..b48fed79 100644 --- a/framework/Web/TAssetManager.php +++ b/framework/Web/TAssetManager.php @@ -23,11 +23,11 @@ * the URL for accessing the base path. * * By default, TAssetManager will not publish a file or directory if it already - * exists in the publishing directory. You may require a timestamp checking by - * setting CheckTimestamp to true (which is false by default). You may also require - * so when calling {@link publishFilePath}. This is usually - * very useful during development. In production sites, the timestamp checking - * should be turned off to improve performance. + * exists in the publishing directory and has an older modification time. + * If the application mode is set as 'Performance', the modification time check + * will be skipped. You can explicitly require a modification time check + * with the function {@link publishFilePath}. This is usually + * very useful during development. * * @author Qiang Xue * @version $Revision: $ $Date: $ @@ -56,6 +56,9 @@ class TAssetManager extends TComponent implements IModule * @var boolean whether to use timestamp checking to ensure files are published with up-to-date versions. */ private $_checkTimestamp=false; + /** + * @var TApplication application instance + */ private $_application; /** @@ -108,9 +111,7 @@ class TAssetManager extends TComponent implements IModule { if($this->_initialized) throw new TInvalidOperationException('assetmanager_basepath_unchangeable'); - else if(is_dir($value)) - $this->_basePath=realpath($value); - else + else if(($this->_basePath=realpath($value))===false) throw new TInvalidDataValueException('assetmanage_basepath_invalid',$value); } @@ -134,25 +135,6 @@ class TAssetManager extends TComponent implements IModule $this->_baseUrl=$value; } - /** - * @return boolean whether file modify time should be used to ensure a published file is latest. Defaults to false. - */ - public function getCheckTimestamp() - { - return $this->_checkTimestamp; - } - - /** - * @param boolean whether file modify time should be used to ensure a published file is latest. Defaults to false. - */ - public function setCheckTimestamp($value) - { - if($this->_initialized) - throw new TInvalidOperationException('pageservice_checktimestamp_unchangeable'); - else - $this->_checkTimestamp=TPropertyValue::ensureBoolean($value); - } - /** * Publishes a file or a directory (recursively). * This method will copy the content in a directory (recursively) to diff --git a/framework/Web/UI/THiddenFieldPageStatePersister.php b/framework/Web/UI/THiddenFieldPageStatePersister.php index d2cb5226..24ef5491 100644 --- a/framework/Web/UI/THiddenFieldPageStatePersister.php +++ b/framework/Web/UI/THiddenFieldPageStatePersister.php @@ -50,7 +50,7 @@ class THiddenFieldPageStatePersister extends TPageStatePersister { if (strlen($key) > 64) $key = pack('H32', md5($key)); - elseif (strlen($key) < 64) + else if (strlen($key) < 64) $key = str_pad($key, 64, "\0"); return md5((str_repeat("\x5c", 64) ^ substr($key, 0, 64)) . pack('H32', md5((str_repeat("\x36", 64) ^ substr($key, 0, 64)) . $data))); } -- cgit v1.2.3