summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2012-01-15 10:55:02 +0100
committerMichael Hamann <michael@content-space.de>2012-01-15 10:58:36 +0100
commit4725165754f92ab9a0e81ee7c69109b0a2f9f35d (patch)
tree5c84532e6b2cef1e08babfa8f64053fbb36a1756
parentfbb51550eae6c61489f98af3390725e3f690c9c1 (diff)
downloadrpg-4725165754f92ab9a0e81ee7c69109b0a2f9f35d.tar.gz
rpg-4725165754f92ab9a0e81ee7c69109b0a2f9f35d.tar.bz2
Make Sitemapper functions static as they were used as static functions
All calls to the Sitemapper were static function calls, this caused notices because they weren't static, with this commit they are marked as static. Furthermore two FIXME comments were removed as dbglog now checks if debugging is enabled.
-rw-r--r--inc/Sitemapper.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/inc/Sitemapper.php b/inc/Sitemapper.php
index bbe1caf26..4689b04a6 100644
--- a/inc/Sitemapper.php
+++ b/inc/Sitemapper.php
@@ -25,7 +25,7 @@ class Sitemapper {
* @link https://www.google.com/webmasters/sitemaps/docs/en/about.html
* @link http://www.sitemaps.org/
*/
- public function generate(){
+ public static function generate(){
global $conf;
if($conf['sitemap'] < 1 || !is_numeric($conf['sitemap'])) return false;
@@ -39,11 +39,11 @@ class Sitemapper {
if(@filesize($sitemap) &&
@filemtime($sitemap) > (time()-($conf['sitemap']*86400))){ // 60*60*24=86400
- dbglog('Sitemapper::generate(): Sitemap up to date'); // FIXME: only in debug mode
+ dbglog('Sitemapper::generate(): Sitemap up to date');
return false;
}
- dbglog("Sitemapper::generate(): using $sitemap"); // FIXME: Only in debug mode
+ dbglog("Sitemapper::generate(): using $sitemap");
$pages = idx_get_indexer()->getPages();
dbglog('Sitemapper::generate(): creating sitemap using '.count($pages).' pages');
@@ -77,7 +77,7 @@ class Sitemapper {
* @return string The sitemap XML.
* @author Michael Hamann
*/
- private function getXML($items) {
+ private static function getXML($items) {
ob_start();
echo '<?xml version="1.0" encoding="UTF-8"?>'.NL;
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'.NL;
@@ -96,7 +96,7 @@ class Sitemapper {
* @return The path to the sitemap file.
* @author Michael Hamann
*/
- public function getFilePath() {
+ public static function getFilePath() {
global $conf;
$sitemap = $conf['cachedir'].'/sitemap.xml';
@@ -113,7 +113,7 @@ class Sitemapper {
*
* @author Michael Hamann
*/
- public function pingSearchEngines() {
+ public static function pingSearchEngines() {
//ping search engines...
$http = new DokuHTTPClient();
$http->timeout = 8;