Commit 1a75c33e authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Move check for sitemap configuration setting



When sitemap generation is disabled, we don't need to include all the
relevant libraries and log the message about disabled sitemap
generation.

Change-Id: I1f7e92f58dcb455bbfaab7745ce28e496ee7276b
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 7b4dd6c8
......@@ -2811,6 +2811,10 @@ function cron_site_data_daily() {
* A cronjob to generate a sitemap
*/
function cron_sitemap_daily() {
if (!get_config('generatesitemap')) {
return;
}
require_once(get_config('libroot') . 'searchlib.php');
require_once(get_config('libroot') . 'group.php');
require_once(get_config('libroot') . 'view.php');
......
......@@ -95,11 +95,6 @@ class Sitemap {
* @return bool
*/
public function generate() {
$generatesitemap = get_config('generatesitemap');
if (!$generatesitemap) {
log_info('Sitemap generation has been disabled.');
return false;
}
// check that the sitemaps directory exists and create it if it doesn't
check_dir_exists(get_config('docroot') . 'sitemaps', true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment