コード例 #1
0
     */
    function generateLimit($namespace)
    {
        $title = Title::makeTitle($namespace, str_repeat("𨮁", 63) . "喃");
        $this->limit = array(strlen($this->openFile()), strlen($this->fileEntry($title->getFullUrl(), wfTimestamp(TS_ISO_8601, wfTimestamp()), $this->priority($namespace))), strlen($this->closeFile()));
    }
}
if (in_array('--help', $argv)) {
    echo <<<EOT
Usage: php generateSitemap.php [options]
\t--help\t\t\tshow this message

\t--fspath=<path>\t\tThe file system path to save to, e.g /tmp/sitemap

\t--server=<server>\tThe protocol and server name to use in URLs, e.g.
\t\thttp://en.wikipedia.org. This is sometimes necessary because
\t\tserver name detection may fail in command line scripts.

\t--compress=[yes|no]\tcompress the sitemap files, default yes

EOT;
    die(-1);
}
$optionsWithArgs = array('fspath', 'server', 'compress');
require_once dirname(__FILE__) . '/commandLine.inc';
if (isset($options['server'])) {
    $wgServer = $options['server'];
}
$gs = new GenerateSitemap(@$options['fspath'], @$options['compress'] !== 'no');
$gs->main();