MySQL
  Home arrow MySQL arrow Page 2 - Data Management Made Easy Using Nenniu...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MYSQL

Data Management Made Easy Using Nennius: Advanced Data Handling
By: Brian Vaughn
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 6
    2005-08-03

    Table of Contents:
  • Data Management Made Easy Using Nennius: Advanced Data Handling
  • Advanced Application Configuration
  • Expanding Our Application Menu
  • Creating the User Comments Component
  • Creating Component Dependencies
  • Component Notes
  • Help Files
  • File Attachments

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Data Management Made Easy Using Nennius: Advanced Data Handling - Advanced Application Configuration


    (Page 2 of 8 )

    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


       · This is the third and final article in this series, and I thank all of you who have...
     

       

    MYSQL ARTICLES

    - MySQL Server Tuning Tips and Tricks
    - MySQL Query Optimizations and Schema Design
    - MySQL Benchmarking Tools and Utilities
    - MySQL Benchmarking Concepts and Strategies
    - Take Some Load off MySQL with MemCached
    - MySQL Table Prefix Changer Tool in PHP
    - Using the SIGNAL Statement for Error Handling
    - Error Handling Examples
    - Error Handling
    - Completing a Search Engine with MySQL and PH...
    - Paginating Result Sets for a Search Engine B...
    - Building a Search Engine with MySQL and PHP 5
    - Using Boolean Operators for Full Text and Bo...
    - PHP, MySQL and the PEAR Database
    - Working with PHP and MySQL





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT