From 2afb475e88a4f41984b5e606b927b22f97e9cc4c Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 27 Dec 2005 16:16:38 +0000 Subject: --- .../protected/pages/Configurations/AppConfig.page | 4 +- .../protected/pages/Fundamentals/Applications.page | 41 ++++++++++++++++++--- .../protected/pages/Fundamentals/Services.page | 14 ++++++- .../protected/pages/Fundamentals/applifecycles.gif | Bin 0 -> 34714 bytes .../protected/pages/Fundamentals/applifecycles.vsd | Bin 0 -> 216576 bytes demos/quickstart/themes/Simple/style.css | 3 +- 6 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 demos/quickstart/protected/pages/Fundamentals/applifecycles.gif create mode 100644 demos/quickstart/protected/pages/Fundamentals/applifecycles.vsd (limited to 'demos/quickstart') diff --git a/demos/quickstart/protected/pages/Configurations/AppConfig.page b/demos/quickstart/protected/pages/Configurations/AppConfig.page index b6bf89f5..dc4675f1 100644 --- a/demos/quickstart/protected/pages/Configurations/AppConfig.page +++ b/demos/quickstart/protected/pages/Configurations/AppConfig.page @@ -2,10 +2,10 @@

Application Configurations

-Application configurations are used to specify the global behavior of an application. This consists of specifying the paths, modules, services and parameters that will be used in an application. +Application configurations are used to specify the global behavior of an application. They include specification of path aliases, namespace usages, module and service configurations, and parameters.

-Application configurations are stored in an XML file which is passed as a parameter to the TApplication instance. The format of application configurations is shown in the following, +Configuration for an application is stored in an XML file named application.xml, which should be located under the application base path. Its format is shown in the following,

 <application PropertyName="PropertyValue" ...>
   <paths>
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 @@
 
 

Applications

-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 method run() 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, + +

+

+

+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. +

+ +

Application Deployment

+

+Deploying a PRADO application mainly involves copying directories. For example, to deploy the above minimal application to another server, follow the following steps, +

    +
  1. Copy the content under wwwroot to a Web-accessible directory on the new server.
  2. +
  3. Modify the entry script file index.php so that it includes correctly the prado.php file.
  4. +
  5. Remove all content under assets and runtime directories and make sure both directories are writable by the Web server process.
  6. +
+

+

Application Lifecycles

-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,

+ \ No newline at end of file diff --git a/demos/quickstart/protected/pages/Fundamentals/Services.page b/demos/quickstart/protected/pages/Fundamentals/Services.page index 0ed976c9..0cd7762c 100644 --- a/demos/quickstart/protected/pages/Fundamentals/Services.page +++ b/demos/quickstart/protected/pages/Fundamentals/Services.page @@ -16,7 +16,19 @@ Developers may implement additional services for their applications. To make a s

Page Service

-PRADO implements TPageService to process users' page requests. +PRADO implements TPageService to process users' page requests. Pages are stored under a directory specified by the BasePath property of the page service. The property defaults to pages directory under the application base path. You may change this default by configuring the service in the application configuration. +

+

+Pages may be organized into subdirectories under the BasePath. In each directory, there may be a page configuration file named config.xml, which contains configurations effective only when a page under that directory or a sub-directory is requested. For more details, see the page configuration section. +

+

+Service parameter for the page service refers to the page being requested. A parameter like Fundamentals.Services refers to the Services page under the <BasePath>/Fundamentals directory. If such a parameter is absent in a request, a default page named Home is assumed. Using THttpRequest as the request module (default), the following URLs will request for Home, About and Register pages, respectively, +

+http://hostname/index.php
+http://hostname/index.php?page=About
+http://hostname/index.php?page=Users.Register
+
+where the first example takes advantage of the fact that the page service is the default service and Home is the default page.

\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Fundamentals/applifecycles.gif b/demos/quickstart/protected/pages/Fundamentals/applifecycles.gif new file mode 100644 index 00000000..e4fc306c Binary files /dev/null and b/demos/quickstart/protected/pages/Fundamentals/applifecycles.gif differ diff --git a/demos/quickstart/protected/pages/Fundamentals/applifecycles.vsd b/demos/quickstart/protected/pages/Fundamentals/applifecycles.vsd new file mode 100644 index 00000000..0f0e2bab Binary files /dev/null and b/demos/quickstart/protected/pages/Fundamentals/applifecycles.vsd differ diff --git a/demos/quickstart/themes/Simple/style.css b/demos/quickstart/themes/Simple/style.css index cfad07d7..9b7ae2b2 100644 --- a/demos/quickstart/themes/Simple/style.css +++ b/demos/quickstart/themes/Simple/style.css @@ -8,7 +8,7 @@ body { } h1 { - font-size:14pt; + font-size:13pt; } h2 { @@ -138,4 +138,5 @@ h3 { code { font-family: "Courier New", Courier, mono; + color: #408040; } \ No newline at end of file -- cgit v1.2.3