[ Index ] |
|
Code source de PRADO 3.0.6 |
[Code source] [Imprimer] [Statistiques]
PradoBase class file. This is the file that establishes the PRADO component model and error handling mechanism.
Author: | Qiang Xue <qiang.xue@gmail.com> |
Copyright: | Copyright © 2005 PradoSoft |
License: | http://www.pradosoft.com/license/ |
Version: | $Id: PradoBase.php 1481 2006-10-29 12:29:16Z xue $ |
Poids: | 609 lignes (19 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 0 fois |
Nécessite: | 3 fichiers framework/Exceptions/TException.php framework/TComponent.php framework/Util/TLogger.php |
PradoBase:: (25 méthodes):
getVersion()
initErrorHandlers()
autoload()
poweredByPrado()
phpErrorHandler()
exceptionHandler()
setApplication()
getApplication()
getFrameworkPath()
serialize()
unserialize()
createComponent()
using()
getPathOfNamespace()
getPathOfAlias()
getPathAliases()
setPathOfAlias()
fatalError()
getUserLanguages()
getPreferredLanguage()
trace()
log()
getLogger()
varDump()
localize()
TReflectionClass:: (0 méthodes):
getVersion() X-Ref |
return: string the version of Prado framework |
initErrorHandlers() X-Ref |
Initializes error handlers. This method set error and exception handlers to be functions defined in this class. |
autoload($className) X-Ref |
Class autoload loader. This method is provided to be invoked within an __autoload() magic method. param: string class name |
poweredByPrado() X-Ref |
return: string a string that can be displayed on your Web page showing powered-by-PRADO information |
phpErrorHandler($errno,$errstr,$errfile,$errline) X-Ref |
PHP error handler. This method should be registered as PHP error handler using {@link set_error_handler}. The method throws an exception that contains the error information. param: integer the level of the error raised param: string the error message param: string the filename that the error was raised in param: integer the line number the error was raised at |
exceptionHandler($exception) X-Ref |
Default exception handler. This method should be registered as default exception handler using {@link set_exception_handler}. The method tries to use the errorhandler module of the Prado application to handle the exception. If the application or the module does not exist, it simply echoes the exception. param: Exception exception that is not caught |
setApplication($application) X-Ref |
Stores the application instance in the class static member. This method helps implement a singleton pattern for TApplication. Repeated invocation of this method or the application constructor will cause the throw of an exception. This method should only be used by framework developers. param: TApplication the application instance |
getApplication() X-Ref |
return: TApplication the application singleton, null if the singleton has not be created yet. |
getFrameworkPath() X-Ref |
return: string the path of the framework |
serialize($data) X-Ref |
Serializes a data. The original PHP serialize function has a bug that may not serialize properly an object. param: mixed data to be serialized return: string the serialized data |
unserialize($str) X-Ref |
Unserializes a data. The original PHP unserialize function has a bug that may not unserialize properly an object. param: string data to be unserialized return: mixed unserialized data, null if unserialize failed |
createComponent($type) X-Ref |
Creates a component with the specified type. A component type can be either the component class name or a namespace referring to the path of the component class file. For example, 'TButton', 'System.Web.UI.WebControls.TButton' are both valid component type. This method can also pass parameters to component constructors. All paramters passed to this method except the first one (the component type) will be supplied as component constructor paramters. param: string component type return: TComponent component instance of the specified type |
using($namespace) X-Ref |
Uses a namespace. A namespace ending with an asterisk '*' refers to a directory, otherwise it represents a PHP file. If the namespace corresponds to a directory, the directory will be appended to the include path. If the namespace corresponds to a file, it will be included (include_once). param: string namespace to be used |
getPathOfNamespace($namespace,$ext='') X-Ref |
Translates a namespace into a file path. The first segment of the namespace is considered as a path alias which is replaced with the actual path. The rest segments are subdirectory names appended to the aliased path. If the namespace ends with an asterisk '*', it represents a directory; Otherwise it represents a file whose extension name is specified by the second parameter (defaults to empty). Note, this method does not ensure the existence of the resulting file path. param: string namespace param: string extension to be appended if the namespace refers to a file return: string file path corresponding to the namespace, null if namespace is invalid |
getPathOfAlias($alias) X-Ref |
param: string alias to the path return: string the path corresponding to the alias, null if alias not defined. |
getPathAliases() X-Ref |
Pas de description |
setPathOfAlias($alias,$path) X-Ref |
param: string alias to the path param: string the path corresponding to the alias |
fatalError($msg) X-Ref |
Fatal error handler. This method displays an error message together with the current call stack. The application will exit after calling this method. param: string error message |
getUserLanguages() X-Ref |
Returns a list of user preferred languages. The languages are returned as an array. Each array element represents a single language preference. The languages are ordered according to user preferences. The first language is the most preferred. return: array list of user preferred languages. |
getPreferredLanguage() X-Ref |
Returns the most preferred language by the client user. return: string the most preferred language by the client user, defaults to English. |
trace($msg,$category='Uncategorized') X-Ref |
Writes a log message. This method wraps {@link log()} by checking the application mode. When the application is in Debug mode, debug backtrace information is appended to the message and the message is logged at DEBUG level. When the application is in Performance mode, this method does nothing. Otherwise, the message is logged at INFO level. param: string message to be logged param: string category of the message |
log($msg,$level=TLogger::INFO,$category='Uncategorized') X-Ref |
Logs a message. Messages logged by this method may be retrieved via {@link TLogger::getLogs} and may be recorded in different media, such as file, email, database, using {@link TLogRouter}. param: string message to be logged param: integer level of the message. Valid values include param: string category of the message |
getLogger() X-Ref |
return: TLogger message logger |
varDump($var,$depth=10,$highlight=false) X-Ref |
Converts a variable into a string representation. This method achieves the similar functionality as var_dump and print_r but is more robust when handling complex objects such as PRADO controls. param: mixed variable to be dumped param: integer maximum depth that the dumper should go into the variable. Defaults to 10. param: boolean whether to syntax highlight the output. Defaults to false. return: string the string representation of the variable |
localize($text, $parameters=array() X-Ref |
Localize a text to the locale/culture specified in the globalization handler. param: string text to be localized. param: array a set of parameters to substitute. param: string a different catalogue to find the localize text. param: string the input AND output charset. return: string localized text. |
Classe: TReflectionClass - X-Ref
TReflectionClass class.Généré le : Sun Feb 25 21:07:04 2007 | par Balluche grâce à PHPXref 0.7 |