What is this about ? ******************** These are some php functions designed to make writing web applications a little easier. They are based upon PEAR and Smarty. ReadConfig.php will read configuration values from a file and store them in the session array. Provides the functions: * ReadConfig - get config values into $_SESSION Config ReadConfig(array configNames, string ConfigFileName) * ReadConfigValue - get one config value from an existing config string ReadConfigValue(string ValueName, ConfRoot root [, NotExistOK] ) * ConfigReadVarList - get list of names config values from existing config array ConfigReadVarList(string varnames, Config root, string sessName) FirstTimeConfig.php will locate a configuration file and read in configuration values. The configuration file is searched for in the directories: . .. include_path /etc and is of the form: ApplicationName.conf Provides the function: * FirstTimeConfig - find a configuration file and extract values Config FirstTimeConfig(string AppName [, array ConfigValueNames]) Sets the global $ConfigAppName that is used elsewhere. LogMsg.php Will record and/or display a message, there are options for where it goes: file, web page (stdout), apache log (stderr). A calling line/file number can be produced (ie of the calling stack), can quit the program after logging. Provides the function: * LogMsg - Process an (error) message void LogMsg(options, string FormatString, ...) Eg: LogMsg('-a', '-Q', "Cannot open file %s", $FileName); SmartyDisp.php Provides functions that make it easier to work with Smarty, these do simple but commonly done things. This integrates with the configuration and error message systems above: * SmartyStart - Smarty initialisation void SmartyStart(array initialisation) * SmartyDisplayTemplate - Display Smarty template void SmartyDisplayTemplate(string templateName) * SmartyShowHere - show where we are for debug/trace with template void SmartyShowHere(string where, array valuesToShow) * SessionToSmarty - Set Smarty variables from $_SESSION void SessionToSmarty(array varsToSet, string errorLocation) * SmartyVarsFromConfig - Set Smarty variables from config file void SmartyDisplayError(options, string, string format, ...) * SmartyDisplayError - Log an error with traceback and display error page void SmartyDisplayForm(HTML_QuickForm2 formObject, string templateName, bool groupErrors) * SmartyDisplayForm - Display a form in a smarty template void SmartyCheckGetArgs(array checkList, string errorLocation) * SmartyCheckGetArgs - Assert that $_GET contains certain values void SmartyVarsFromConfig(string varnames, Config root, string conf) The function SmartyStdVars() will be called before a template is displayed, if it exists. To see how these work look at the man documentation, eg: man FirstTimeConfig.php man ReadConfig.php man LogMsg.php man SmartyDisp.php Some of this will only work with PHP 5 or later. Some of the RPM dependencies are against modules in Dag's archive: http://dag.wieers.com/rpm/ Global Variables **************** This is free software (GPLv2) - so it gets better when more people contribute. Copyright 2009, 2010, 2011: Parliament Hill Computers Ltd, all rights reserved. Author: ADDW See the file License for licensing info. SCCS: @(#)README 1.7 05/18/11 15:09:14