Home arrow MySQL arrow Page 2 - Data Management Made Easy Using Nennius: Advanced Data Handling

Advanced Application Configuration - MySQL

Welcome to part three of this tutorial introducing application development for the Nennius engine. In this article, we will enhance the News Manager application from part two.

TABLE OF CONTENTS:
  1. Data Management Made Easy Using Nennius: Advanced Data Handling
  2. Advanced Application Configuration
  3. Expanding Our Application Menu
  4. Creating the User Comments Component
  5. Creating Component Dependencies
  6. Component Notes
  7. Help Files
  8. File Attachments
By: Brian Vaughn
Rating: starstarstarstarstar / 6
August 03, 2005

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Begin by opening the 'application.defaults.php' file that we created in part two. Currently this file contains only those configuration variables required by Nennius. Our first step in exploring the advanced configuration options available to Nennius developers will be to modify this file. The text below shows the additional variables we will be adding to our configuration. We will take a closer look at each variable later, but for now just add the following text to your 'application.defaults.php' file:

# Advanced configuration options - - - - - - - - - - - - - - - - - - - -

       

# relative location of (optional) application branding logo

$GLOBALS['nennius_branding_logo']     = 'graphics/news_manager.gif';

# designate whether to store files in DB (BLOB) or on file system

$GLOBALS['attachment_storage_mode']   = 'FILE_SYSTEM';       # ex. 'DB_BLOB', 'FILE_SYSTEM'

       

# default page user is directed to upon successful login

$GLOBALS['nennius_default_page']      = 'index.php';

# log all failed DB queries (for debugging purposes only)

$GLOBALS['nennius_debug_mode']                = TRUE;

$GLOBALS['nennius_debug_file']                = 'logs/debug.txt';

# log all failed user login attempts (for security purposes)

$GLOBALS['nennius_logging_mode']      = TRUE;

$GLOBALS['nennius_logging_file']      = 'logs/logging.txt';

As you can see above, most of the variables we have added to our configuration file are self-explanatory, but let's take a short look at each just to avoid any possible confusion.

Our first variable, 'nennius_branding_logo', specifies the relative path to the Web application's branding image. Branding images should generally be no more than 200 pixels wide and 40 pixels tall. For our example application, we have developed a simple branding image that displays the name of our Web application in graphical format. (Note: if no branding image is provided, the default Nennius logo will be used.)

Next we told Nennius to store file attachments on the file system instead of in our database; we could have just as easily chosen to store files in the database (using 'DB_BLOB'). Depending on the application, it will often make more sense to use one method of storage over the other. If neither method is specified, Nennius will default to storing files on the file system within a '/webapps/application_name/files/' folder.

The 'nennius_default_page' is fairly straightforward. If our application contains more than one component, we are able to specify the default component for users who are logging in. Upon a successful login, Nennius will re-direct the user to the component page specified here.

Our last two variables deal with logging information. Nennius offers a variety of logging options. We have chosen the two most common for our application: 'nennius_debug_mode' and 'nennius_logging_mode'. By enabling debug mode and specifying a log file ('nennius_debug_file') we are telling Nennius that any time a SQL query fails it should write that query (and the error message returned) to a log file. This is a very handy feature for Web applications, especially during the initial development stages. Logging mode is similar; it records failed login attempts. It is recommended that logging mode be enabled for any Nennius application managing sensitive data.

Note: When creating the 'application.defaults.php' file, make certain that there is no trailing space before or after the PHP brackets. This is a fairly common oversight to make, but it will prevent the authentication class from setting a user's login cookie.



 
 
>>> More MySQL Articles          >>> More By Brian Vaughn
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

MYSQL ARTICLES

- Oracle Unveils MySQL 5.6
- MySQL Vulnerabilities Threaten Databases
- MySQL Cloud Options Expand with Google Cloud...
- MySQL 5.6 Prepped to Handle Demanding Web Use
- ScaleBase Service Virtualizes MySQL Databases
- Oracle Unveils MySQL Conversion Tools
- Akiban Opens Database Software for MySQL Use...
- Oracle Fixes MySQL Bug
- MySQL Databases Vulnerable to Password Hack
- MySQL: Overview of the ALTER TABLE Statement
- MySQL: How to Use the GRANT Statement
- MySQL: Creating, Listing, and Removing Datab...
- MySQL: Create, Show, and Describe Database T...
- MySQL Data and Table Types
- McAfee Releases Audit Plugin for MySQL Users

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: