Class PradoBase
PradoBase class.
PradoBase implements a few fundamental static methods.
To use the static methods, Use Prado as the class name rather than PradoBase. PradoBase is meant to serve as the base class of Prado. The latter might be rewritten for customization.
Direct known subclasses
PradoCopyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0
Located at PradoBase.php
public static
string
|
|
public static
|
#
initErrorHandlers( )
Initializes error handlers. This method set error and exception handlers to be functions defined in this class. |
public static
|
#
autoload( string $className )
Class autoload loader. This method is provided to be invoked within an __autoload() magic method. |
public static
string
|
|
public static
|
#
phpErrorHandler( integer $errno, string $errstr, string $errfile, integer $errline )
PHP error handler. This method should be registered as PHP error handler using set_error_handler. The method throws an exception that contains the error information. |
public static
|
#
exceptionHandler( Exception $exception )
Default exception handler. This method should be registered as default exception handler using 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. |
public static
|
#
setApplication(
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. |
public static
|
|
public static
string
|
|
public static
string
|
#
serialize( mixed $data )
Serializes a data. The original PHP serialize function has a bug that may not serialize properly an object. |
public static
mixed
|
#
unserialize( string $str )
Unserializes a data. The original PHP unserialize function has a bug that may not unserialize properly an object. |
public static
|
#
createComponent( string $type )
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 parameters passed to this method except the first one (the component type) will be supplied as component constructor parameters. |
public static
|
#
using( string $namespace, boolean $checkClassExistence = true )
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). |
public static
string
|
#
getPathOfNamespace( string $namespace, string $ext = '' )
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. |
public static
string
|
|
protected static
|
|
public static
|
|
public static
|
#
fatalError( string $msg )
Fatal error handler. This method displays an error message together with the current call stack. The application will exit after calling this method. |
public static
array
|
#
getUserLanguages( )
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. |
public static
string
|
|
public static
|
#
trace( string $msg, string $category = 'Uncategorized', (string|TControl) $ctl = null )
Writes a log message. This method wraps |
public static
|
#
log( string $msg, integer $level =
Logs a message. Messages logged by this method may be retrieved via |
public static
|
|
public static
string
|
#
varDump( mixed $var, integer $depth = 10, boolean $highlight = false )
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. |
public static
string
|
#
localize( string $text, array $parameters = array(), string $catalogue = null, string $charset = null )
Localize a text to the locale/culture specified in the globalization handler. |
string |
CLASS_FILE_EXT |
'.php' |
#
File extension for Prado class files. |
protected static
array
|
$classExists | array() |
#
list of class exists checks |