[ Index ] |
|
Code source de PRADO 3.0.6 |
[Code source] [Imprimer] [Statistiques]
TApplication class file
Author: | Qiang Xue <qiang.xue@gmail.com> |
Copyright: | Copyright © 2005 PradoSoft |
License: | http://www.pradosoft.com/license/ |
Version: | $Id: TApplication.php 1559 2006-12-04 03:03:21Z xue $ |
Poids: | 1332 lignes (36 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 0 fois |
Nécessite: | 20 fichiers framework/Web/THttpResponse.php framework/interfaces.php framework/Web/THttpUtility.php framework/Exceptions/TErrorHandler.php framework/Collections/TMap.php framework/Web/THttpSession.php framework/IO/TTextWriter.php framework/Web/THttpRequest.php framework/Web/Javascripts/TJavaScript.php framework/Xml/TXmlDocument.php framework/TApplicationComponent.php framework/TModule.php framework/Security/TSecurityManager.php framework/I18N/TGlobalization.php framework/Web/TAssetManager.php framework/Security/TAuthorizationRule.php framework/Collections/TList.php framework/Web/Services/TPageService.php framework/Caching/TCache.php framework/TService.php |
TApplication:: (61 méthodes):
__construct()
run()
completeRequest()
getRequestCompleted()
getGlobalState()
setGlobalState()
clearGlobalState()
loadGlobals()
saveGlobals()
getID()
setID()
getUniqueID()
getMode()
setMode()
getBasePath()
getConfigurationFile()
getRuntimePath()
getService()
setModule()
getModule()
getModules()
getParameters()
getPageService()
setPageService()
getRequest()
setRequest()
getResponse()
setResponse()
getSession()
setSession()
getErrorHandler()
setErrorHandler()
getSecurityManager()
setSecurityManager()
getAssetManager()
setAssetManager()
getApplicationStatePersister()
setApplicationStatePersister()
getCache()
setCache()
getUser()
setUser()
getGlobalization()
setGlobalization()
getAuthorizationRules()
initApplication()
onError()
onBeginRequest()
onAuthentication()
onAuthenticationComplete()
onAuthorization()
onAuthorizationComplete()
onLoadState()
onLoadStateComplete()
onPreRunService()
runService()
onSaveState()
onSaveStateComplete()
onPreFlushOutput()
flushOutput()
onEndRequest()
TApplicationMode:: (0 méthodes):
TApplicationConfiguration:: (7 méthodes):
loadFromFile()
getProperties()
getAliases()
getUsings()
getModules()
getServices()
getParameters()
TApplicationStatePersister:: (4 méthodes):
init()
getStateFilePath()
load()
save()
Classe: TApplication - X-Ref
TApplication class.__construct($basePath='protected',$cacheConfig=true) X-Ref |
Constructor. Sets application base path and initializes the application singleton. Application base path refers to the root directory storing application data and code not directly accessible by Web users. By default, the base path is assumed to be the <b>protected</b> directory under the directory containing the current running script. param: string application base path or configuration file path. param: boolean whether to cache application configuration. Defaults to true. |
run() X-Ref |
Executes the lifecycles of the application. This is the main entry function that leads to the running of the whole Prado application. |
completeRequest() X-Ref |
Completes current request processing. This method can be used to exit the application lifecycles after finishing the current cycle. |
getRequestCompleted() X-Ref |
return: boolean whether the current request is processed. |
getGlobalState($key,$defaultValue=null) X-Ref |
Returns a global value. A global value is one that is persistent across users sessions and requests. param: string the name of the value to be returned param: mixed the default value. If $key is not found, $defaultValue will be returned return: mixed the global value corresponding to $key |
setGlobalState($key,$value,$defaultValue=null) X-Ref |
Sets a global value. A global value is one that is persistent across users sessions and requests. Make sure that the value is serializable and unserializable. param: string the name of the value to be set param: mixed the global value to be set param: mixed the default value. If $key is not found, $defaultValue will be returned |
clearGlobalState($key) X-Ref |
Clears a global value. The value cleared will no longer be available in this request and the following requests. param: string the name of the value to be cleared |
loadGlobals() X-Ref |
Loads global values from persistent storage. This method is invoked when {@link onLoadState OnLoadState} event is raised. After this method, values that are stored in previous requests become available to the current request via {@link getGlobalState}. |
saveGlobals() X-Ref |
Saves global values into persistent storage. This method is invoked when {@link onSaveState OnSaveState} event is raised. |
getID() X-Ref |
return: string application ID |
setID($value) X-Ref |
param: string application ID |
getUniqueID() X-Ref |
return: string an ID that uniquely identifies this Prado application from the others |
getMode() X-Ref |
return: TApplicationMode application mode. Defaults to TApplicationMode::Debug. |
setMode($value) X-Ref |
param: TApplicationMode application mode |
getBasePath() X-Ref |
return: string configuration path |
getConfigurationFile() X-Ref |
return: string configuration file path |
getRuntimePath() X-Ref |
Gets the directory storing application-level persistent data. return: string application state path |
getService() X-Ref |
return: IService the currently requested service |
setModule($id,IModule $module) X-Ref |
Adds a module to application. Note, this method does not do module initialization. param: string ID of the module param: IModule module object |
getModule($id) X-Ref |
return: IModule the module with the specified ID, null if not found |
getModules() X-Ref |
return: array list of loaded application modules, indexed by module IDs |
getParameters() X-Ref |
Returns the list of application parameters. Since the parameters are returned as a {@link TMap} object, you may use the returned result to access, add or remove individual parameters. return: TMap the list of application parameters |
getPageService() X-Ref |
return: TPageService page service |
setPageService(TPageService $service) X-Ref |
Registers the page service instance. This method should only be used by framework developers. param: TPageService page service |
getRequest() X-Ref |
return: THttpRequest the request module |
setRequest(THttpRequest $request) X-Ref |
param: THttpRequest the request module |
getResponse() X-Ref |
return: THttpResponse the response module |
setResponse(THttpResponse $response) X-Ref |
param: THttpRequest the request module |
getSession() X-Ref |
return: THttpSession the session module, null if session module is not installed |
setSession(THttpSession $session) X-Ref |
param: THttpSession the session module |
getErrorHandler() X-Ref |
return: TErrorHandler the error hanlder module |
setErrorHandler(TErrorHandler $handler) X-Ref |
param: TErrorHandler the error hanlder module |
getSecurityManager() X-Ref |
return: TSecurityManager the security manager module |
setSecurityManager(TSecurityManager $sm) X-Ref |
param: TSecurityManager the security manager module |
getAssetManager() X-Ref |
return: TAssetManager asset manager |
setAssetManager(TAssetManager $value) X-Ref |
param: TAssetManager asset manager |
getApplicationStatePersister() X-Ref |
return: IStatePersister application state persister |
setApplicationStatePersister(IStatePersister $persister) X-Ref |
param: IStatePersister application state persister |
getCache() X-Ref |
return: ICache the cache module, null if cache module is not installed |
setCache(ICache $cache) X-Ref |
param: ICache the cache module |
getUser() X-Ref |
return: IUser the application user |
setUser(IUser $user) X-Ref |
param: IUser the application user |
getGlobalization($createIfNotExists=true) X-Ref |
param: boolean whether to create globalization if it does not exist return: TGlobalization globalization module |
setGlobalization(TGlobalization $glob) X-Ref |
param: TGlobalization globalization module |
getAuthorizationRules() X-Ref |
return: TAuthorizationRuleCollection list of authorization rules for the current request |
initApplication() X-Ref |
Loads configuration and initializes application. Configuration file will be read and parsed (if a valid cached version exists, it will be used instead). Then, modules are created and initialized; Afterwards, the requested service is created and initialized. param: string configuration file path (absolute or relative to current executing script) param: string cache file path, empty if no present or needed |
onError($param) X-Ref |
Raises OnError event. This method is invoked when an exception is raised during the lifecycles of the application. param: mixed event parameter |
onBeginRequest() X-Ref |
Raises OnBeginRequest event. At the time when this method is invoked, application modules are loaded and initialized, user request is resolved and the corresponding service is loaded and initialized. The application is about to start processing the user request. |
onAuthentication() X-Ref |
Raises OnAuthentication event. This method is invoked when the user request needs to be authenticated. |
onAuthenticationComplete() X-Ref |
Raises OnAuthenticationComplete event. This method is invoked right after the user request is authenticated. |
onAuthorization() X-Ref |
Raises OnAuthorization event. This method is invoked when the user request needs to be authorized. |
onAuthorizationComplete() X-Ref |
Raises OnAuthorizationComplete event. This method is invoked right after the user request is authorized. |
onLoadState() X-Ref |
Raises OnLoadState event. This method is invoked when the application needs to load state (probably stored in session). |
onLoadStateComplete() X-Ref |
Raises OnLoadStateComplete event. This method is invoked right after the application state has been loaded. |
onPreRunService() X-Ref |
Raises OnPreRunService event. This method is invoked right before the service is to be run. |
runService() X-Ref |
Runs the requested service. |
onSaveState() X-Ref |
Raises OnSaveState event. This method is invoked when the application needs to save state (probably stored in session). |
onSaveStateComplete() X-Ref |
Raises OnSaveStateComplete event. This method is invoked right after the application state has been saved. |
onPreFlushOutput() X-Ref |
Raises OnPreFlushOutput event. This method is invoked right before the application flushes output to client. |
flushOutput() X-Ref |
Flushes output to client side. |
onEndRequest() X-Ref |
Raises OnEndRequest event. This method is invoked when the application completes the processing of the request. |
Classe: TApplicationMode - X-Ref
TApplicationMode class.Classe: TApplicationConfiguration - X-Ref
TApplicationConfiguration class.loadFromFile($fname) X-Ref |
Parses the application configuration file. param: string configuration file name |
getProperties() X-Ref |
return: array list of application initial property values, indexed by property names |
getAliases() X-Ref |
return: array list of path aliases, indexed by alias names |
getUsings() X-Ref |
return: array list of namespaces to be used |
getModules() X-Ref |
return: array list of module configurations |
getServices() X-Ref |
return: array list of service configurations |
getParameters() X-Ref |
return: array list of parameters |
Classe: TApplicationStatePersister - X-Ref
TApplicationStatePersister class.init($config) X-Ref |
Initializes module. param: TXmlElement module configuration (may be null) |
getStateFilePath() X-Ref |
return: string the file path storing the application state |
load() X-Ref |
Loads application state from persistent storage. return: mixed application state |
save($state) X-Ref |
Saves application state in persistent storage. param: mixed application state |
Généré le : Sun Feb 25 21:07:04 2007 | par Balluche grâce à PHPXref 0.7 |