/** * initializes the config, create singleton object * * @static * @return cXmlSitemapConfig */ public static function loadConfig() { if (self::$oCurrentSingletonObject == null) { self::$oCurrentSingletonObject = new self(); } return self::$oCurrentSingletonObject; }
* * @category MyHammer * @package LargeXMLSitemap * @subpackage Examples * @license http://www.myhammer.de/opensource/license/gpl.txt GNU General Public License Version 3 * @version 1.0 * @author Jan Christiansen <*****@*****.**> */ require_once '../init/init.main.php'; set_time_limit(0); // init the config cXmlSitemapConfig::loadConfig(); // creates a creator object for fast writing (cant read/edit existing XML Files) $oSitemapCreator = new cXmlSitemapGeneratorWrite(cXmlSitemapConfig::getSitemapFilename('items'), TRUE, cXmlSitemapConfig::getSitemapDirectoryPath()); // delete current sitemap files $oSitemapCreator->deleteCurrent(); // open the first sitemap $oSitemapCreator->open(); // Get shop articles $aItemIds = array(); for ($i = 0; $i < 50000; $i++) { $aItemIds[] = $i; } foreach ($aItemIds as $iItemId) { $oSitemapCreator->addUrl('http://jc.bhn-media.de/shop/item/very/long/url/because/we/need/to/create/a/big/sitemap/without/reaching/the/50000/urls/limit/' . $iItemId, null, cXmlSitemap::changeFreqHourly, 0.8); } // close the creator and the last sitemap $oSitemapCreator->save(); // Add sitemap to index $oSitemapCreator->updateSitemapIndex(cXmlSitemapConfig::getSitemapDirectoryPath() . cXmlSitemapConfig::getSitemapIndexFilename());
* http://www.myhammer.de/opensource/license/gpl.txt * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to opensource@myhammer.de so we can send you a copy immediately. * * @category MyHammer * @package LargeXMLSitemap * @subpackage Benchmarking * @license http://www.myhammer.de/opensource/license/gpl.txt GNU General Public License Version 3 * @version 1.0 * @author Jan Christiansen <*****@*****.**> */ /** * This file runs the benchmark. There is no check if input is valid and the Class exits * Its just called from the actual benchmarks */ require_once '../init/init.main.php'; require_once 'class.xmlSitemapBenchmark.php'; set_time_limit(0); if (count($argv) < 4 || count($argv) > 5) { echo "Usage " . $argv[0] . " <class name> <number of measurements> <number of URLs> [v(erbose)]\n"; die; } cXmlSitemapConfig::loadConfig(); $oBenchmark = new cXmlSitemapBenchmark($argv[1]); $oBenchmark->iNumOfMeasurements = $argv[2]; $oBenchmark->iNumOfUrls = $argv[3]; if (isset($argv[4]) && $argv[4] == 'v') { $oBenchmark->bVerbose = TRUE; } $oBenchmark->main();