Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
provision
Commits
de109598
Commit
de109598
authored
Oct 28, 2008
by
anarcat
Committed by
anarcat
Oct 28, 2008
Browse files
rewrinte _provision_find_profiles() to avoid using
file_scan_directory() also log found profiles
parent
39966f5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
platform/provision_drupal.module
View file @
de109598
...
...
@@ -372,9 +372,19 @@ function provision_drupal_provision_verify($url, &$data) {
function
_provision_find_profiles
()
{
include_once
(
'includes/install.inc'
);
$profiles
=
file_scan_directory
(
'./profiles'
,
'\.profile$'
,
array
(
'.'
,
'..'
,
'CVS'
,
'.svn'
),
0
,
TRUE
,
'name'
,
0
);
foreach
(
$profiles
as
$key
=>
$profile
)
{
if
(
!
$dir
=
opendir
(
"./profiles"
))
{
provision_log
(
'error'
,
t
(
"Cannot find profiles directory"
));
return
FALSE
;
}
while
(
FALSE
!==
(
$name
=
readdir
(
$dir
)))
{
$file
=
"./profiles/
$name
/
$name
.profile"
;
if
(
$name
==
'..'
||
$name
==
'.'
||
!
file_exists
(
$file
))
{
continue
;
}
$profile
=
new
stdClass
();
$profile
->
name
=
$name
;
$profile
->
filename
=
$file
;
require_once
(
$profile
->
filename
);
$func
=
$profile
->
name
.
"_profile_details"
;
if
(
function_exists
(
$func
))
{
...
...
@@ -392,6 +402,7 @@ function _provision_find_profiles() {
$profile
->
info
[
'languages'
]
=
array_keys
(
$languages
);
$return
[
$key
]
=
$profile
;
provision_log
(
'notice'
,
t
(
'found install profile %name'
,
array
(
'%name'
=>
$name
)));
}
return
$return
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment