~ubuntu-branches/ubuntu/quantal/dokuwiki/quantal

« back to all changes in this revision

Viewing changes to inc/Sitemapper.php

  • Committer: Package Import Robot
  • Author(s): Tanguy Ortolo
  • Date: 2012-01-26 23:10:28 UTC
  • mfrom: (1.1.14) (19.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20120126231028-gdcxrxo3j4jqp2de
Tags: 0.0.20120125-1
* New upstream release.
* debian/patches/debianize.diff: updated for the new release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
     * @link   https://www.google.com/webmasters/sitemaps/docs/en/about.html
26
26
     * @link   http://www.sitemaps.org/
27
27
     */
28
 
    public function generate(){
 
28
    public static function generate(){
29
29
        global $conf;
30
30
        if($conf['sitemap'] < 1 || !is_numeric($conf['sitemap'])) return false;
31
31
 
39
39
 
40
40
        if(@filesize($sitemap) &&
41
41
           @filemtime($sitemap) > (time()-($conf['sitemap']*86400))){ // 60*60*24=86400
42
 
            dbglog('Sitemapper::generate(): Sitemap up to date'); // FIXME: only in debug mode
 
42
            dbglog('Sitemapper::generate(): Sitemap up to date');
43
43
            return false;
44
44
        }
45
45
 
46
 
        dbglog("Sitemapper::generate(): using $sitemap"); // FIXME: Only in debug mode
 
46
        dbglog("Sitemapper::generate(): using $sitemap");
47
47
 
48
48
        $pages = idx_get_indexer()->getPages();
49
49
        dbglog('Sitemapper::generate(): creating sitemap using '.count($pages).' pages');
77
77
     * @return string The sitemap XML.
78
78
     * @author Michael Hamann
79
79
     */
80
 
    private function getXML($items) {
 
80
    private static function getXML($items) {
81
81
        ob_start();
82
82
        echo '<?xml version="1.0" encoding="UTF-8"?>'.NL;
83
83
        echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'.NL;
96
96
     * @return The path to the sitemap file.
97
97
     * @author Michael Hamann
98
98
     */
99
 
    public function getFilePath() {
 
99
    public static function getFilePath() {
100
100
        global $conf;
101
101
 
102
102
        $sitemap = $conf['cachedir'].'/sitemap.xml';
113
113
     * 
114
114
     * @author Michael Hamann
115
115
     */
116
 
    public function pingSearchEngines() {
 
116
    public static function pingSearchEngines() {
117
117
        //ping search engines...
118
118
        $http = new DokuHTTPClient();
119
119
        $http->timeout = 8;