Tải bản đầy đủ (.pdf) (5 trang)

Secure PHP Development- P59 ppsx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (87.89 KB, 5 trang )

Setting up Application Configuration
Files
Like all other applications we’ve developed in this book, the document publishing
applications also use a standard set of configuration, message, and error files. These
files are discussed in the following sections.
The main configuration file
The primary configuration file for the entire document publishing system is called
ld.conf. Table 8-2 discusses each configuration variable.
TABLE 8-2 LD.CONF VARIABLES
Configuration Variable Purpose
$PEAR_DIR Set to the directory containing the PEAR
package; specifically the DB module needed for
class.DBI.php in our application framework.
$PHPLIB_DIR Set to the PHPLIB directory, which contains the
PHPLIB packages (specifically, the
template.inc package needed for template
manipulation).
$APP_FRAMEWORK_DIR Set to our application framework directory.
$PATH Set to the combined directory path consisting of
$PEAR_DIR, $PHPLIB_DIR, and
$APP_FRAMEWORK_DIR. This path is used with
the
ini_set() method to redefine the
php.ini entry for include_path to include
$PATH ahead of the default path. This allows
PHP to find our application framework, PHPLIB,
and PEAR-related files.
$AUTHENTICATION_URL Set to the central login application URL.
$LOGOUT_URL Set to the central logout application URL.
$HOME_URL Set to the topmost URL of the site. If the URL
redirection application does not find a valid URL


in the e-campaign database to redirect to for a
valid request, it uses this URL as a default.
Continued
Chapter 8: Intranet Simple Document Publisher 261
11 549669 ch08.qxd 4/4/03 9:25 AM Page 261
TABLE 8-2 LD.CONF VARIABLES (Continued)
Configuration Variable Purpose
$APPLICATION_NAME Internal name of the application.
$DEFAULT_LANGUAGE Set to the default (two-character) language
code.
$ROOT_PATH Set to the root path of the application.
$REL_ROOT_PATH Relative path to the root directory.
$REL_APP_PATH Relative application path as seen from the web
browser.
$TEMPLATE_DIR The fully qualified path to the template
directory.
$THEME_TEMPLATE_DIR The fully qualified path to the theme template
directory.
$REL_PHOTO_DIR The Web-relative path to the photo directory
used to store user photos.
$PHOTO_DIR The fully qualified path to the photo directory.
$DEFAULT_PHOTO Name of the default photo file, which is used
when a user does not have a photo in the photo
directory.
$CLASS_DIR The fully qualified path to the class directory.
$REL_TEMPLATE_DIR The Web relative path to the template directory
used.
$CATEGORY_CLASS Name of the Category class file.
$DOC_CLASS Name of the Doc class file.
$RESPONSE_CLASS Name of the Response class file.

$MESSAGE_CLASS Name of the Message class file. This class is
developed for the MOTD application, discussed
in the Chapter 7.
$LD_MNGR Name of the application that shows document
indexes for a given category or all categories.
$LD_DETAILS_MNGR Name of the application that shows document
details.
262 Part II: Developing Intranet Solutions
11 549669 ch08.qxd 4/4/03 9:25 AM Page 262
Configuration Variable Purpose
$LD_RESPONSE_MNGR Name of the application that manages
responses to documents.
$LD_ADMIN_MNGR Name of the application that allows
administrative users to manage categories.
$LD_VISIT_LIST_MNGR Name of the application that allows users to
view document-tracking information.
$LD_DB_URL The fully qualified URL for the database used to
store the documents and categories.
$LD_CATEGORY_TBL Name of the category table in the database.
$LD_DOC_TBL Name of the document table in the database.
$LD_RESPONSE_TBL Name of the response table in the database.
$USER_PREFERENCE_TBL Name of the user preference table in the
database.
$MESSAGE_TBL Name of the MOTD message table in the
database.
$LD_CAT_PUB_TBL Name of the category publishers table in the
database.
$LD_CAT_VIEW_TBL Name of the category viewers table in the
database.
$LD_TRACK_TBL Name of the document tracking data table in

the database.
$MSG_VIEWER_TBL Name of the message viewer list table in the
database.
$AUTH_DB_TBL Name of the user authentication table in the
database.
$STATUS_TEMPLATE Name of the status template file used to display
status messages.
$LD_HOME_TEMPLATE Name of the document index template file.
$LD_DETAILS_TEMPLATE Name of the document details template file.
$LD_RESPONSE_TEMPLATE Name of the document response entry form
template file.
Continued
Chapter 8: Intranet Simple Document Publisher 263
11 549669 ch08.qxd 4/4/03 9:25 AM Page 263
TABLE 8-2 LD.CONF VARIABLES (Continued)
Configuration Variable Purpose
$LD_VIEW_RESPONSE_TEMPLATE Name of the document response view template
file.
$ADD_MOD_DOC_TEMPLATE Name of the add/modify document entry form
template file.
$ADD_MOD_CATEGORY_TEMPLATE Name of the add/modify category entry form
template file.
$ANNOUNCE_LD_ADDED_TEMPLATE Name of the new document announcement
message template file.
$ANNOUNCE_LD_MOD_TEMPLATE Name of the document modification
announcement message template file.
$LD_VISIT_LIST_TEMPLATE Name of the document track listing template
file.
$LD_REORDER_CAT_TEMPLATE Name of the category reordering entry form
template file.

ODD_COLOR Color defined for odd rows when displaying
tabular data such as document track listing.
EVEN_COLOR Color defined for even rows when displaying
tabular data such as document track listing.
$ratings Defines an associative array used to display
response rating information.
USER_DB_URL The fully qualified authentication database URL.
LD_ADMIN_TYPE The administrative user type value.
CAT_PER_LINE The number of categories per row to show in a
navigation table, which is created in the
navigation file.
SEPARATOR The characters that separate each navigation
entry (category) in the navigation, which is
created in the navigation file.
LD_UPDATE_TITLE The MOTD message header used to announce
updated documents via MOTD.
LD_ADD_TITLE The MOTD message header used to announce
new documents via MOTD.
264 Part II: Developing Intranet Solutions
11 549669 ch08.qxd 4/4/03 9:25 AM Page 264
Configuration Variable Purpose
$LD_CATEGORY_NAV_DIR The fully qualified path for the category
navigation file. Ideally, you should set this to a
path that is outside your Web document tree
and the files in this directory should have only
read/write permissions for the Web server user
which runs the PHP scripts.
$LD_CATEGORY_NAV_OUTFILE The category navigation file created by the
simple document publishing system.
$LD_CATEGORY_NAV_TEMPLATE The category navigation template file used to

generate the navigation file pointed by
$LD_CATEGORY_NAV_OUTFILE.
$DEFAULT_THEME The default theme index in the
$THEME_TEMPLATE array.
$USER_DEFAULTS A user’s theme and auto tip default settings.
$TIP_SCRIPT The name of the tip script.
$TIP_URL The Web-relative path for the tip files.
$MAX_AVAILABLE_TIP The maximum number of tips from which to
display the tip.
$THEME_TEMPLATE[n] The list of theme templates
$PRINT_TEMPLATE[n] The list of print templates associative with the
theme templates.
The directory structure used in the ld.conf file supplied in ch8 directory on the
CD-ROM may need to be tailored to your own system’s requirements. Here is what
the current directory structure looks like:
htdocs ($ROOT_PATH same as %DocumentRoot%)
|
+ home (base intranet application discussed in chapter 7)
| |
| + templates
| |
| + themes (theme templates used by all intranet apps) < +
| |
+ photos (user photos used by all intranet apps) |
Chapter 8: Intranet Simple Document Publisher 265
11 549669 ch08.qxd 4/4/03 9:25 AM Page 265

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×