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
provision
Commits
d0a37e40
Commit
d0a37e40
authored
Oct 28, 2008
by
anarcat
Committed by
anarcat
Oct 28, 2008
Browse files
port latest fixes to the d5 branch forward to HEAD
parent
5645d8ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
platform/provision_drupal.module
View file @
d0a37e40
...
...
@@ -479,9 +479,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
))
{
...
...
@@ -498,6 +508,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
;
...
...
@@ -513,11 +524,16 @@ function provision_drupal_provision_delete($url, $data) {
}
function
provision_drupal_find_sites
()
{
$sitephp
=
file_scan_directory
(
'./sites'
,
'settings\.php$'
,
array
(
'.'
,
'..'
,
'CVS'
,
'.svn'
),
0
,
TRUE
,
'filename'
,
0
);
foreach
(
$sitephp
as
$file
=>
$info
)
{
$path
=
explode
(
"/"
,
$file
);
array_pop
(
$path
);
$sites
[
array_pop
(
$path
)]
=
$file
;
if
(
$dir
=
opendir
(
"./sites"
))
{
while
(
FALSE
!==
(
$subdir
=
readdir
(
$dir
)))
{
$file
=
"./sites/
$subdir
/settings.php"
;
if
(
file_exists
(
"
$file
"
))
{
$sites
[
$subdir
]
=
$file
;
}
}
}
else
{
provision_log
(
"error"
,
t
(
"Cannot find sites directory"
));
$sites
=
FALSE
;
}
return
$sites
;
}
...
...
provision.path.inc
View file @
d0a37e40
...
...
@@ -154,7 +154,7 @@ function provision_path_unlink($path) {
function
provision_path_chmod
(
$path
,
&
$perms
,
&
$reason
)
{
if
(
!
chmod
(
$path
,
$perms
))
{
$reason
=
t
(
'chmod
failed'
);
$reason
=
t
(
'chmod
to @perm failed on @path'
,
array
(
'@perm'
=>
$perms
,
'@path'
=>
$path
)
);
return
false
;
}
clearstatcache
();
// this needs to be called, otherwise we get the old info
...
...
@@ -166,7 +166,7 @@ function provision_path_chmod($path, &$perms, &$reason) {
function
provision_path_chown
(
$path
,
&
$owner
,
&
$reason
)
{
if
(
$owner
=
provision_posix_username
(
$owner
))
{
if
(
!
chown
(
$path
,
$owner
))
{
$reason
=
t
(
"ch
mod failed"
)
;
$reason
=
t
(
"ch
own to @owner failed on @path"
,
array
(
'@owner'
=>
$owner
,
'@path'
=>
$path
))
;
}
}
else
{
...
...
@@ -184,7 +184,7 @@ function provision_path_chgrp($path, &$group, &$reason) {
return
$group
;
}
else
{
$reason
=
t
(
"chgrp
failed"
);
$reason
=
t
(
"chgrp
to @group failed on @path"
,
array
(
'@group'
=>
$group
,
'@path'
=>
$path
)
);
}
}
else
{
...
...
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