From 2afb475e88a4f41984b5e606b927b22f97e9cc4c Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 27 Dec 2005 16:16:38 +0000 Subject: --- .../protected/pages/Fundamentals/Applications.page | 41 ++++++++++++++++++---- 1 file changed, 35 insertions(+), 6 deletions(-) (limited to 'demos/quickstart/protected/pages/Fundamentals/Applications.page') diff --git a/demos/quickstart/protected/pages/Fundamentals/Applications.page b/demos/quickstart/protected/pages/Fundamentals/Applications.page index 0a3028c5..c64a9ea4 100644 --- a/demos/quickstart/protected/pages/Fundamentals/Applications.page +++ b/demos/quickstart/protected/pages/Fundamentals/Applications.page @@ -2,13 +2,10 @@
-An application is an instance of TApplication
or its derived class. Each PRADO application consists of a single application instance, one or several services, and some modules. For applications providing the page service (true for nearly all applications), they also contain one or several pages.
+An application is an instance of TApplication
or its derived class. It manages modules that provide different functionalities and are loaded when needed. It provides services to end-users. It is the central place to store various parameters used in an application. In a PRADO application, the application instance is the only object that is globally accessible via Prado::getApplication()
function call.
-The application instance is the only object that is accessible globally via Prado::getApplication()
function call. It manages modules that provide different functionalities and are loaded when needed. It holds services that are available to end-users. An application instance may be configured via application configurations.
-
-An application instance is usually created in an entry script in a PRADO application, as shown in the following, +Applications are configured via application configurations. They are usually created entry scripts like the following,
require_once('/path/to/prado.php'); $application = new TApplication; @@ -17,9 +14,41 @@ $application->run(); where the methodrun()
starts the application to handle user requests. +Directory Organization
++A minimal PRADO application contains two files: an entry file and a page template file. They must be organized as follows, +
+
wwwroot
- Web document root or sub-directory.index.php
- entry script of the PRADO application.assets
- directory storing published private files. See assets section.protected
- application base path storing application data and private script files. This directory should be configured inaccessible to Web-inaccessible, or it may be located outside of Web directories.runtime
- application runtime storage path. This directory is used by PRADO to store application runtime information, such as application state, cached data, etc.pages
- base path storing all PRADO pages. See services section.Home.page
- default page returned when users do not explicitly specify the page requested. This is a page template file. The file name without suffix is the page name. The page class is TPage
. If there is also a class file Home.php
, the page class becomes Home
.
+A product PRADO application usually needs more files. It may include an application configuration file named application.xml
under the application base path protected
. The pages may be organized in directories, some of which may contain page configuration files named config.xml
. Fore more details, please see configurations section.
+
+Deploying a PRADO application mainly involves copying directories. For example, to deploy the above minimal application to another server, follow the following steps, +
wwwroot
to a Web-accessible directory on the new server.index.php
so that it includes correctly the prado.php
file.assets
and runtime
directories and make sure both directories are writable by the Web server process.
-TBD
+Like page lifecycles, an application also has lifecycles. Application modules can register for the lifecycle events. When the application reaches a particular lifecycle and raises the corresponding event, the registered module methods are invoked automatically. Modules included in the PRADO release, such as TAuthManager
, are using this way to accomplish their goals.
+
+The application lifecycles can be depicted as follows,
+