-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheasy_xmlsitemap.install
73 lines (64 loc) · 1.71 KB
/
easy_xmlsitemap.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
/**
* @file
* Easy XML Sitemap install
*/
/**
* Implements hook_requirements().
*/
function easy_xmlsitemap_requirements($phase) {
// Ensure translations don't break during installation.
$t = get_t();
$requirements = array();
if ($phase == 'install') {
if (file_exists('./sitemap.xml')) {
$requirements['easy_xmlsitemap'] = array(
'severity' => REQUIREMENT_ERROR,
'description' => $t('The "Easy XML sitemap" module cannot display generated file "sitemap.xml",'
. ' because file with this name already exists in website root directory.'
. ' Please remove or rename an existing file, then try again.'),
);
}
}
return $requirements;
}
/**
* Add and init new empty array for excluded languages to config file.
*/
function easy_xmlsitemap_update_1000() {
$config = config('easy_xmlsitemap.settings');
$config->set('excluded_langs', array());
$config->save();
}
/**
* Remove obsolete variable from config.
*/
function easy_xmlsitemap_update_1001() {
$config = config('easy_xmlsitemap.settings');
$config->clear('last_build_date');
$config->save();
}
/**
* Add and initialize new variable
*/
function easy_xmlsitemap_update_1002() {
$config = config('easy_xmlsitemap.settings');
$config->set('force_https', 0);
$config->save();
}
/**
* Add and initialize new variable
*/
function easy_xmlsitemap_update_1003() {
$config = config('easy_xmlsitemap.settings');
$config->set('seo_meta_integration', 0);
$config->save();
}
/**
* Add and initialize new variable
*/
function easy_xmlsitemap_update_1004() {
$config = config('easy_xmlsitemap.settings');
$config->set('excluded_types', []);
$config->save();
}