System
[ class tree: System ] [ index: System ] [ all elements ]

Procedural File: prado.php

Source Location: /prado.php



Page Details:

PRADO bootstrap file.

This program is free software; you can redistribute it and/or modify it under the terms of the BSD License.

Copyright(c) 2004 by Qiang Xue. All rights reserved.

To contact the author write to Qiang Xue The latest version of PRADO can be obtained from: http://prado.sourceforge.net/




version:  $Revision: 1.22 $ $Date: 2005/08/19 17:23:24 $
author:  Qiang Xue <qiang.xue@gmail.com>


Includes:

require_once(PRADO_DIR.'/TApplication.php') [line 45]
TApplication class file

require_once(PRADO_DIR.'/classes.php') [line 41]
classes file

require_once(PRADO_DIR.'/utils.php') [line 37]
utility functions file






PRADO_DIR [line 22]

PRADO_DIR = dirname(__FILE__)
the framework installation path


[ Top ]



PRADO_EXT_CLASS [line 27]

PRADO_EXT_CLASS = '.php'
the class file extension


[ Top ]




pradoErrorHandler [line 61]

void pradoErrorHandler( mixed $errno, mixed $errstr, mixed $errfile, mixed $errline)

error handler.

This method is invoked by PHP when an error happens. It displays the error if the application state is in debug; otherwise, it saves the error in log.




[ Top ]



pradoFatalError [line 78]

void pradoFatalError( string $msg)

Fatal error handler.

This method is used in places where exceptions usually cannot be raised (e.g. magic methods). It displays the debug backtrace if the application state is in debug; otherwise, only error message is displayed.




Parameters

string   $msg   error message
[ Top ]



pradoGetApplication [line 218]

TApplication pradoGetApplication( [string $specFile = ''], [string $cacheFile = ''], [string $className = 'TApplication'])

Returns the application singleton.

In the first invocation of the method, it will construct an application instance by either loading from a previously serialized instance from $cacheFile or creating a new one based on the specification file $specFile.

In the following invocations, the parameters can be omitted and the singleton is returned.




return:  the application singleton


Parameters

string   $specFile   path of the application specification file (either absolute or relative to current requesting script)
string   $cacheFile   path of the cache file that stores serialized TApplication instance
string   $className   the application class name, TApplication by default.
[ Top ]



pradoImportClass [line 147]

boolean pradoImportClass( string $className)

Includes a class definition file.

The class definition file is located by searching the used namespaces. If the class definition exists or is imported successfully, the function returns true, otherwise false.




return:  whether the class definition is imported


Parameters

string   $className   class name
[ Top ]



pradoVersion [line 50]

string pradoVersion( )



return:  prado version


[ Top ]



using [line 182]

void using( string $namespace)

Adds an include search path.

A namespace is a dot-connected paths. The first segment of the string refers to a path alias that is defined in the application specification. The rest segments represent the subdirectories in order. For example, 'System.Web.UI' refers to the 'Web/UI' directory under the framework directory.

If the namespace represents a path, it will be inserted at the front of the current include search path.

If the namespace represents a file (without the extension), it will be included (require_once) at the position of calling this function.

Do not call this function before the application singleton is created.




Parameters

string   $namespace   the namespace string
[ Top ]



__autoload [line 133]

void __autoload( string $className)

Includes a class file upon an unknown class This function is automatically called by PHP engine upon an unknown class.

It is required that each PRADO class should be defined in a file whose name is the class name.




Parameters

string   $className   class name
[ Top ]



© 2004-2005 PRADO Software Group. All Rights Reserved.