Update of /cvsroot/phpweather/phpweather
In directory usw-pr-cvs1:/tmp/cvs-serv25457

Added Files:
        db_null.php 
Removed Files:
        db_none.php 
Log Message:
I've changed the name from 'none' to 'null' as this is really a
null-database. (Just like it's called /dev/null and not /dev/none)


--- NEW FILE ---
<?php
/**
 * This class is the 'null' database-type
 *
 * It pretends to be a database, but really it isn't :-) It just implements all the 
functions one would expect from a database, and then returns true or false or with 
empty strings and arrays as appropriate.
 *
 * @author   Martin Geisler <[EMAIL PROTECTED]>
 * @version  $Id: db_null.php,v 1.1 2001/04/05 19:17:28 gimpster Exp $
 */
class db_null extends db_common {
  
  /**
   * This constructor does nothing besides calling the parent constructor.
   *
   * @param  array  the initial properties of the object
   */
  function db_null($input) {
    $this->db_common($input);
  }

  /**
   * Gets the type of the database.
   *
   * @return  string  The type of the database, 'null' in this case.
   * @access  public
   */
  function get_type() {
    return 'null';
  }

  /**
   * Pretends to establish a connection to the database.
   *
   * Like all the other methods of this database object, this doesn't do anything 
useful.
   *
   * @return  boolean  Always returns true, so that other functions that depends on a 
connection to the database doesn't fail because of this.
   * @access  public
   */
  function connect() {
    return true;
  }


  /**
   * Pretends to insert a METAR into the database.
   *
   * @param   string   The ICAO of the station.
   * @param   string   The raw METAR.
   * @param   integer  A standard UNIX timestamp.
   * @access  public
   * @see     update_metar()
   */
  function insert_metar($station, $metar, $timestamp) {
    ;
  }

  /**
   * Pretends to update an existing METAR in the database.
   *
   * @param   string   The ICAO of the station.
   * @param   string   The raw METAR.
   * @param   integer  A standard UNIX timestamp.
   * @access  public
   * @see     insert_metar()
   */
  function update_metar($station, $metar, $timestamp) {
    ;
  }

  /**
   * Pretends to return a METAR form the database.
   *
   * @param   string  The ICAO of the station.
   * @return  string  Since we don't have a database, we just return an empty string.
   * @access  public
   */
  function get_metar($station) {
    return '';
  }
}

?>

--- db_none.php DELETED ---


_______________________________________________
PHPWeather-checkins mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/phpweather-checkins

Reply via email to