From 48c64f6d6fcc3c32669d0ad556dd1777b3077c08 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Wed, 29 Aug 2012 12:32:51 +0000
Subject: [PATCH] 1. Poprawa błędnego słowa kluczowego w module pogoda (extends zamiast implements), 2. Poprawa błędu typu "niezainicjowana zmienna" w klasie DownloadHelper, 3. Poprawa błędu w klasie api_geonames modułu pogoda - brak argumentu funkcji simplexml_load_string()
---
modules/30_pogoda/handler.php | 2 +-
class/DownloadHelper.php | 3 +--
modules/30_pogoda/api_geonames.php | 2 +-
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/class/DownloadHelper.php b/class/DownloadHelper.php
index 45cc866..25f4c71 100644
--- a/class/DownloadHelper.php
+++ b/class/DownloadHelper.php
@@ -10,7 +10,7 @@
protected $cacheInfo = array();
function build_url($components) {
- return $components['scheme'].'://'.($components['user'] ? $components['user'].($components['pass'] ? ':'.$components['pass'] : '').'@' : '').$components['host'].($components['path'] ? $components['path'] : '/').($components['query'] ? '?'.$components['query'] : '');
+ return $components['scheme'].'://'.(isset($components['user']) && !empty($components['user']) ? $components['user'].(isset($components['pass']) && !empty($components['pass']) ? ':'.$components['pass'] : '').'@' : '').$components['host'].($components['path'] ? $components['path'] : '/').($components['query'] ? '?'.$components['query'] : '');
}
function __construct($url) {
@@ -111,7 +111,6 @@
$this->cacheInfo['last_updated'] = time();
$info = $this->getinfo();
- var_dump($info);
if($info['http_code'] == '304') {
// Plik się nie zmienił...
diff --git a/modules/30_pogoda/api_geonames.php b/modules/30_pogoda/api_geonames.php
index 5463ea8..282b76f 100644
--- a/modules/30_pogoda/api_geonames.php
+++ b/modules/30_pogoda/api_geonames.php
@@ -15,7 +15,7 @@
}
libxml_use_internal_errors();
- $data = simplexml_load_string();
+ $data = simplexml_load_string($data);
libxml_clear_errors();
if(!$data) {
diff --git a/modules/30_pogoda/handler.php b/modules/30_pogoda/handler.php
index 6394cd7..6ffc55a 100644
--- a/modules/30_pogoda/handler.php
+++ b/modules/30_pogoda/handler.php
@@ -2,7 +2,7 @@
require_once(dirname(__FILE__).'/api_geonames.php');
require_once(dirname(__FILE__).'/api_yrno.php');
-class bot_pogoda_module extends BotModule {
+class bot_pogoda_module implements BotModule {
function pogoda($msg, $params) {
$arg = trim($msg->args);
--
Gitblit v1.9.1