This document was last updated prior to version v0.50
but is should give you a good head start
Breakdown of class structure for NOAH Weather.
Includes variables and methods available.
(NOAH.php) NOAH {base class}
|
(db.php) |- db_layer
| |
(weather.php) | +- weather
|
(html.php) +- HTML
|
(output.php) +- output
|
(parse.php) +- parse
(parseMetar.php) parseMetar {standalone class used by weather}
NOAH
var $properties = array(); Array containing the configuration data
var $forecast = array(); Array containing the forecast data
var $currentw = array(); Array containing the current weather data
var $images = array(); Array containing the images data
var $warnings = array(); Array containing the advisory/warning data
var $debug_msgs; Array containing the debug messages
var $version; string containing current version number
var $inside_nuke; boolean value set to true if php-nuke is detected
function NOAH($input = array()) base constrictor
function set_verbosity($new_verbosity) Sets verbosity level which determines how
much "feedback" we are given during code execution
function get_verbosity() Returns the current verbosity level
function error($msg, $file = '', $line = '') Prints error message and terminates execution
function warning($msg, $file = '', $line = '') Prints a warning message and terminates execution
function debug($msg, $file = '', $line = '') Stores a debug msg in a array for later examination
function print_properties() Prints the current configuration data
db_layer
function db_layer($input = array()) base constrictor
function set_db_type($type) Sets the type of database to be used.
Valid $type are mysql,mysql4,postgres,mssql,oracle,
msaccess,mssql-odbc,db2
function get_db_type() Reads the current database type
weather
function weather($input = array()) base constrictor
function getLocation() retrieves weather data for current location;
populates $forecast,$currentw,$images, and $warnings
function setLocation($arg1,$arg2="") sets the location for which weather data will be retrieved.
Accepts a zip, city/state, NOAA Zone, ICAO, or callsign as input.
function getCurrent($arg1) retrieves current weather data. $arg1 is expected to be an ICAO
function getForecast($zone,$state) retrieves forecast data given a NOAA zone and state.
function getImages ($icao) retrieves NOAA images for the given ICAO
function isAfile($url) boolean function used to determine if a file exists.
function getFile($url) returns contents of $url as string data.
function getWarnings($zone) retrieves advisories/warning of all known type given NOAA zone.
function getWarning($zone,$type) retrieves specific advisories/warning given NOAA zone and type
function parseWarning($contents) parses data retrieve by getWarning into usable format
function decode_metar($raw_metar) calls parseMeter to decode weather data given a raw metar.
HTML
var $weather = null;
function HTML($weather, $input = array() base constrictor
function TableOpen($type=0,$params="") outputs HTML data need to open a table for display in a browser
function TableClose($type=0) outputs HTML data need to close a table for display in a browser
function TH($txt,$NumCols=1,$w="") outputs HTML data need to display a table header in a browser
function TR($tr,$a="",$w="",$v="") outputs HTML data need to display a table row in a browser
function TD($td,$w="",$a="",$v="",$c='1') outputs HTML data need to display a table cell in a browser
function DIV($content,$styleC="l",$top="",$styleT="c",$left="",$styleL="r")
outputs HTML data need to display a formatted block in a browser
(see the css.README in the classes directory for more info)
function BLK($BLK = array(),$layout) outputs HTML data need to display a formatted block in a browser
(see the css.README in the classes directory for more info)
output
function ShowLocation() returns html formatted data of location, icao, zone, lat, long
function ShowCurrent ($b=1) returns html formatted data of current weather conditions
$b=0 is a special case used by php-nuke for block data
function ShowMoon () returns html formatted data of moon phase
function ShowImages() returns html formatted data of all current NOAA images
function ShowImage($type) returns html formatted data of specific NOAA image
function ShowWarnings($verbose) returns html formatted data of advisories/warnings
function ShowForcasts($num=7,$verbose=0,$layout=1) returns html formatted data of all forecast data
function ShowForecast($key,$verbose=0,$link=0) returns html formatted data of the specified forecast $key
function ShowVersion($img) returns html formatted data of current version. $img is an integer.
parse
function fix_first($data) returns properly capitalized data base on structure
function NOAAparseImg($key,$data) returns forecast image given a $key, $data pair
function NOAAparseShort($key,$data) returns short forecast given a $key, $data pair
function NOAAparseLo($key,$data) returns low temp data given a $key, $data pair
function NOAAparseHi($key,$data) returns high temp data given a $key, $data pair
function NOAAparseRain($key,$data) returns change of rain given a $key, $data pair