The generating of sitemap.xml is very time consuming. So that I am writing a console command to generate the sitemap.
The console app (CConsoleApplication) share the same config file of the CWebApplication. However, I found I can not find the url rewrite rules (CUrlManager) in console application. Thus, it is impossible to generate url using Control and Action names.
exception 'CException' with message 'CConsoleApplication does not have a method
named "getRequest".' in D:\www\yii\framework\base\CComponent.php:218
Stack trace:
#0 [internal function]: CComponent->__call('getRequest', Array)
#1 D:\www\yii\framework\web\CUrlManager.php(358): CConsoleApplication->getRequest()
#2 D:\www\yii\framework\web\CUrlManager.php(206): CUrlManager->getBaseUrl()
exception 'CException' with message 'CConsoleApplication does not have a method
named "getRequest".' in D:\www\yii\framework\base\CComponent.php:218
Stack trace:
#0 [internal function]: CComponent->__call('getRequest', Array)
#1 D:\www\yii\framework\web\CUrlManager.php(367): CConsoleApplication->getRequest()
#2 D:\www\yii\framework\web\CUrlManager.php(206): CUrlManager->getBaseUrl()