Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
xmlsitemap
Commits
f731b47d
Commit
f731b47d
authored
May 16, 2011
by
Dave Reid
Browse files
Issue
#1158956
: Added requirements check for the xmlwriter PHP extension.
parent
e4c0cfbd
Changes
1
Show whitespace changes
Inline
Side-by-side
xmlsitemap.install
View file @
f731b47d
...
...
@@ -14,6 +14,23 @@ function xmlsitemap_requirements($phase) {
$requirements
=
array
();
$t
=
get_t
();
// Check that required PHP extensions are enabled.
// Note: Drupal 7 already requires the 'xml' extension.
$required_extensions
=
array
(
'xmlwriter'
);
$missing_extensions
=
array_diff
(
$required_extensions
,
array_filter
(
$required_extensions
,
'extension_loaded'
));
if
(
!
empty
(
$missing_extensions
))
{
$requirements
[
'xmlsitemap_php_extensions'
]
=
array
(
'title'
=>
$t
(
'XML sitemap PHP extensions'
),
'value'
=>
$t
(
'Disabled'
),
'severity'
=>
REQUIREMENT_ERROR
,
'description'
=>
$t
(
"The XML sitemap module requires you to enable the PHP extensions in the following list (see the <a href=
\"
@xmlsitemap_requirements
\"
>module's system requirements page</a> for more information):"
,
array
(
'@xmlsitemap_requirements'
=>
'http://drupal.org/documentation/modules/xmlsitemap/requirements'
,
))
.
theme
(
'item_list'
,
array
(
'items'
=>
$missing_extensions
)),
);
}
if
(
$phase
==
'runtime'
)
{
// If clean URLs are disabled there must not be an actual sitemap.xml in
// the root directory.
if
(
variable_get
(
'clean_url'
,
0
)
&&
file_exists
(
DRUPAL_ROOT
.
'/sitemap.xml'
))
{
...
...
@@ -25,7 +42,6 @@ function xmlsitemap_requirements($phase) {
);
}
if
(
$phase
==
'runtime'
)
{
// Check that the base directory and all its subdirectories are writable.
$requirements
[
'xmlsitemap_directory'
]
=
array
(
'title'
=>
$t
(
'XML sitemap cache directory'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment