<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Cron extends Builder_Controller
{
    function __construct() 
    {
        parent::__construct();
    }
    
    public function math()
    {
        print_r(localeconv());
        var_dump(341/9);
    }
    
    public function index()
    {

        $this->load->helper('sitemap_generator');

        //include "src/SitemapGenerator.php";
        
        $generator = new \Icamys\SitemapGenerator\SitemapGenerator('http://comdono.com');
        
        // will create also compressed (gzipped) sitemap
        $generator->createGZipFile = true;
        
        // determine how many urls should be put into one file
        // according to standard protocol 50000 is maximum value (see http://www.sitemaps.org/protocol.html)
        $generator->maxURLsPerSitemap = 50000;
        
        // sitemap file name
        $generator->sitemapFileName = "sitemap.xml";
        
        // sitemap index file name
        $generator->sitemapIndexFileName = "sitemap-index.xml";
        
        // alternate languages
        $alternates = [
            ['hreflang' => 'pt-br', 'href' => "http://dev.comdono.com/"]
        ];
        
        // adding url `loc`, `lastmodified`, `changefreq`, `priority`, `alternates`
        $generator->addUrl('/teste', new DateTime(), 'always', '0.5', $alternates);
        
        // generating internally a sitemap
        $generator->createSitemap();
        
        // writing early generated sitemap to file
        $generator->writeSitemap();
    }
}