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
strongarm
Commits
7f19c2a3
Commit
7f19c2a3
authored
Feb 04, 2010
by
young hahn
Browse files
Update script for setting strongarm 1.x variables.
parent
d26f91a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
strongarm.install
View file @
7f19c2a3
...
...
@@ -19,7 +19,7 @@ function strongarm_update_6100() {
}
/**
* Update 6
1
00: Install CTools
* Update 6
2
00: Install CTools
*/
function
strongarm_update_6200
()
{
drupal_install_modules
(
array
(
'ctools'
));
...
...
@@ -29,3 +29,22 @@ function strongarm_update_6200() {
}
return
array
(
array
(
'success'
=>
TRUE
,
'query'
=>
'Enabled CTools successfully.'
));
}
/**
* Update 6201: Set all strongarm 1.x variables that are not already set.
*/
function
strongarm_update_6201
()
{
$ret
=
array
();
$modules
=
module_implements
(
'strongarm'
);
foreach
(
$modules
as
$module
)
{
$variables
=
module_invoke
(
$module
,
'strongarm'
);
foreach
(
$variables
as
$variable
=>
$value
)
{
$exists
=
db_result
(
db_query
(
"SELECT name FROM
{
variable
}
WHERE name = '%s'"
,
$variable
));
if
(
!
$exists
&&
!
(
is_object
(
$value
)
&&
isset
(
$value
->
api_version
)))
{
variable_set
(
$variable
,
$value
);
$ret
[]
=
array
(
'success'
=>
TRUE
,
'query'
=>
"Set 1.x strongarmed variable
{
$variable
}
in the database."
);
}
}
}
return
$ret
;
}
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