Update of /cvsroot/phpweather/phpweather
In directory sc8-pr-cvs1:/tmp/cvs-serv19084
Modified Files:
base_object.php
Log Message:
This verbosity-thing isn't really used... There's no real reason to
make an extra member variable just to hold this, when we have it as
$this->properties['verbosity'].
Index: base_object.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/base_object.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- base_object.php 15 May 2002 22:23:26 -0000 1.13
+++ base_object.php 5 Mar 2003 19:56:57 -0000 1.14
@@ -26,29 +26,10 @@
*
* @var string
*/
- var $version;
+ var $version = '#VERSION#';
/**
- * The verbosity level of PHP Weather.
- *
- * This variable controls the amount of output you'll see when PHP
- * Weather is running.
- *
- * If the first bit is set, then errors will be reported and
- * terminate the script. If the second bit it set warnings will be
- * reported, and if the third bit is set, then debug-information
- * will also be printed.
- *
- * It works like error_reporting() does in PHP, so take a look at
- * that.
- *
- * @var integer
- */
- var $verbosity = 0;
-
-
- /**
* Sets up the properties by overriding the defaults with the actual input.
*
* First it includes the file 'defaults-dist.php'. Next it includes
@@ -71,12 +52,6 @@
while (list($key, $value) = each($input)) {
$this->properties[$key] = $value;
}
- /* We also set the verbosity. */
- $this->set_verbosity($this->properties['verbosity']);
-
- /* And finally, we set the version. */
- $this->version = '#VERSION#';
-
}
/**
@@ -115,7 +90,7 @@
* @param string The line where the error occurred.
*/
function error($msg, $file = '', $line = '') {
- if ($this->verbosity & 1) {
+ if ($this->properties['verbosity'] & 1) {
if (!empty($line)) {
echo "<p><b>Fatal error:</b> $msg.\n<br>Line <b>$line</b> in file <b>$file</b>.</p>\n";
} else {
@@ -129,10 +104,10 @@
/**
* Issues a warning.
*
- * If the second bit is set in $this->verbosity, this function will
- * print the message, prefixed with the word 'Warning:' in bold. If
- * you supply it with the optional arguments $file and $line, these
- * will also be printed.
+ * If the second bit is set in $this->properties['verbosity'], this
+ * function will print the message, prefixed with the word
+ * 'Warning:' in bold. If you supply it with the optional arguments
+ * $file and $line, these will also be printed.
*
* Execution of the script continues.
*
@@ -141,7 +116,7 @@
* @param string The line where the error occurred.
*/
function warning($msg, $file = '', $line = '') {
- if ($this->verbosity & 2) {
+ if ($this->properties['verbosity'] & 2) {
if (!empty($line)) {
die("<p><b>Warning:</b> $msg.\n<br>Line <b>$line</b> in file <b>$file</b>.</p>\n");
} else {
@@ -155,15 +130,15 @@
* Prints a message for debugging.
*
* The message is only printed if the third bit is set in
- * $this->verbosity. The word 'Debug:' in bold will be prefixed the
- * message.
+ * $this->properties['verbosity']. The word 'Debug:' in bold will be
+ * prefixed the message.
*
* @param string The debug-message.
* @param string The name of the file where the message comes from.
* @param string The line where the message comes from.
*/
function debug($msg, $file = '', $line = '') {
- if ($this->verbosity & 4) {
+ if ($this->properties['verbosity'] & 4) {
if (!empty($line)) {
echo "<p><b>Debug:</b> $msg. Line <b>$line</b> in file <b>$file</b>.</p>\n";
} else {
|