cvs: pear /Services_Weather/Weather Common.php
| From: | Alexander Wirtz | Date: | Wed, 01 Oct 2003 11:12:35 +0000 |
| Subject: | cvs: pear /Services_Weather/Weather Common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-13207@lists.php.net to get a copy of this message | ||
eru Wed Oct 1 07:12:35 2003 EDT
Modified files:
/pear/Services_Weather/Weather Common.php
Log:
*Removed minor if-bug
*changed documentation
*Added check for input in setUnitsFormat
Index: pear/Services_Weather/Weather/Common.php
diff -u pear/Services_Weather/Weather/Common.php:1.1 pear/Services_Weather/Weather/Common.php:1.2
--- pear/Services_Weather/Weather/Common.php:1.1 Mon Sep 29 09:46:59 2003
+++ pear/Services_Weather/Weather/Common.php Wed Oct 1 07:12:35 2003
@@ -16,7 +16,7 @@
// | Authors: Alexander Wirtz <alex@pc4p.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Common.php,v 1.1 2003/09/29 13:46:59 eru Exp $
+// $Id: Common.php,v 1.2 2003/10/01 11:12:35 eru Exp $
require_once "PEAR/Registry.php";
@@ -30,6 +30,10 @@
/**
* PEAR::Services_Weather_Common
*
+* Parent class for weather-services. Defines common functions for unit
+* conversions, checks for astronomy-class, cache enabling and does other
+* miscellaneous things.
+*
* @author Alexander Wirtz <alex@pc4p.net>
* @package Services
* @version 1.0
@@ -110,7 +114,7 @@
var $_cache;
/**
- * Provides check for caching
+ * Provides check for Cache
*
* @var bool $_cacheEnabled
* @access private
@@ -135,7 +139,7 @@
function Services_Weather_Common()
{
$this->_registry = new PEAR_Registry();
- if($this->_registry->packageExists("Science_Astronomy");
+ if($this->_registry->packageExists("Science_Astronomy")) {
$this->_astroEnabled = TRUE;
}
}
@@ -168,7 +172,7 @@
*/
function setUnitsFormat($unitsFormat)
{
- if (strlen($unitsFormat)) {
+ if (strlen($unitsFormat) && in_array(strtolower($unitsFormat{0}),
array("s", "m"))) {
$this->_unitsFormat = strtolower($unitsFormat{0});
}
}
@@ -195,7 +199,7 @@
// {{{ convertTemperature()
/**
- * Convert temperature between farenheit and celsius
+ * Convert temperature between f and c
*
* @param float $temperature
* @param string $from