Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
48e41d31
Commit
48e41d31
authored
15 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#509392
follow-up by adrian: Clean-up for .info files for install profiles patch.
parent
3ccd4375
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
includes/install.inc
+42
-16
42 additions, 16 deletions
includes/install.inc
install.php
+4
-2
4 additions, 2 deletions
install.php
modules/simpletest/tests/module.test
+2
-1
2 additions, 1 deletion
modules/simpletest/tests/module.test
with
48 additions
and
19 deletions
includes/install.inc
+
42
−
16
View file @
48e41d31
...
...
@@ -977,23 +977,49 @@ function drupal_check_module($module) {
/**
* Retrieve info about an install profile from its .info file.
*
* Information stored in the profile.info file:
* - name: The real name of the install profile for display purposes.
* - description: A brief description of the profile.
* - dependencies: An array of shortnames of other modules this install profile requires.
* - tasks: An associative array of tasks and the page title of each task that need to be
* completed for installation.
*
* Example of .info file:
* @verbatim
* name = Drupal (minimal)
* description = Create a Drupal site with only required modules enabled.
* dependencies[] = block
* dependencies[] = dblog
* @endverbatim
*
* @param profile
* Name of profile.
* @param locale
* Name of locale used (if any).
* @return
* The info array.
*/
function
install_profile_info
(
$profile
,
$locale
=
'en'
)
{
$cache
=&
drupal_static
(
'install_profile_info'
,
array
(),
TRUE
);
// Set defaults for module info.
$defaults
=
array
(
'dependencies'
=>
array
(),
'tasks'
=>
array
(),
'description'
=>
''
,
'version'
=>
NULL
,
'php'
=>
DRUPAL_MINIMUM_PHP
,
);
$info
=
drupal_parse_info_file
(
sprintf
(
'profiles/%s/%s.info'
,
$profile
,
$profile
))
+
$defaults
;
$info
[
'dependencies'
]
=
array_unique
(
array_merge
(
drupal_required_modules
(),
$info
[
'dependencies'
],
(
$locale
!=
'en'
&&
!
empty
(
$locale
)
?
array
(
'locale'
)
:
array
()))
);
return
$info
;
$cache
=
&
drupal_static
(
__FUNCTION__
,
array
());
if
(
!
isset
(
$cache
[
$profile
]))
{
// Set defaults for module info.
$defaults
=
array
(
'dependencies'
=>
array
(),
'tasks'
=>
array
(),
'description'
=>
''
,
'version'
=>
NULL
,
'php'
=>
DRUPAL_MINIMUM_PHP
,
);
$info
=
drupal_parse_info_file
(
"profiles/
$profile
/
$profile
.info"
)
+
$defaults
;
$info
[
'dependencies'
]
=
array_unique
(
array_merge
(
drupal_required_modules
(),
$info
[
'dependencies'
],
(
$locale
!=
'en'
&&
!
empty
(
$locale
)
?
array
(
'locale'
)
:
array
()))
);
$cache
[
$profile
]
=
$info
;
}
return
$cache
[
$profile
];
}
This diff is collapsed.
Click to expand it.
install.php
+
4
−
2
View file @
48e41d31
...
...
@@ -972,8 +972,10 @@ function install_task_list($active = NULL) {
// Add tasks defined by the profile.
if
(
$profile
)
{
$info
=
install_profile_info
(
$profile
);
if
(
array_key_exists
(
'tasks'
,
$info
))
{
$tasks
+=
$info
[
'tasks'
];
if
(
isset
(
$info
[
'tasks'
]))
{
foreach
(
$info
[
'tasks'
]
as
$task
=>
$title
)
{
$tasks
[
$task
]
=
st
(
$title
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
modules/simpletest/tests/module.test
+
2
−
1
View file @
48e41d31
...
...
@@ -23,7 +23,8 @@ class ModuleUnitTest extends DrupalWebTestCase {
*/
function
testModuleList
()
{
// Build a list of modules, sorted alphabetically.
$module_list
=
drupal_get_profile_modules
(
'default'
,
'en'
);
$profile_info
=
install_profile_info
(
'default'
,
'en'
);
$module_list
=
$profile_info
[
'dependencies'
];
sort
(
$module_list
);
// Compare this list to the one returned by module_list(). We expect them
// to match, since all default profile modules have a weight equal to 0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment