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
35e21e82
Commit
35e21e82
authored
Dec 08, 2009
by
anarcat
Committed by
anarcat
Dec 08, 2009
Browse files
factor directory all directory creation into a single function
parent
4ae1d0ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
platform/provision_drupal.drush.inc
View file @
35e21e82
...
...
@@ -217,24 +217,29 @@ function _provision_drupal_create_settings_file($url = NULL) {
* Also maintains permissions on existing directories.
*/
function
_provision_drupal_create_directories
(
$url
,
$profile
=
NULL
)
{
$
paths
=
array
(
$
readonly
=
array
(
"sites/
$url
"
=>
0755
,
"sites/
$url
/files"
=>
02770
,
"sites/
$url
/files/tmp"
=>
02770
,
"sites/
$url
/files/images"
=>
02770
,
"sites/
$url
/files/pictures"
=>
02770
,
"sites/
$url
/themes"
=>
0755
,
"sites/
$url
/modules"
=>
0755
,
"sites/
$url
/libraries"
=>
0755
,
# http://drupal.org/node/496240
);
$grps
=
array
(
"sites/
$url
/files"
,
"sites/
$url
/files/tmp"
,
"sites/
$url
/files/images"
,
"sites/
$url
/files/pictures"
,
);
// special case: platform. do not create files dir
if
(
$url
==
'all'
)
{
$readwrite
=
array
();
}
else
{
$readonly
[
"sites/
$url
/files"
]
=
02770
;
$readonly
[
"sites/
$url
/files/tmp"
]
=
02770
;
$readonly
[
"sites/
$url
/files/images"
]
=
02770
;
$readonly
[
"sites/
$url
/files/pictures"
]
=
02770
;
$readwrite
=
array
(
"sites/
$url
/files"
,
"sites/
$url
/files/tmp"
,
"sites/
$url
/files/images"
,
"sites/
$url
/files/pictures"
,
);
}
foreach
(
$
paths
as
$path
=>
$perm
)
{
foreach
(
$
readonly
as
$path
=>
$perm
)
{
if
(
!
is_dir
(
$path
))
{
provision_path
(
"mkdir"
,
$path
,
TRUE
,
dt
(
"Created <code>@path</code>"
),
...
...
@@ -247,8 +252,8 @@ function _provision_drupal_create_directories($url, $profile = NULL) {
dt
(
"Could not change permissions <code>@path</code> to @confirm"
)
);
}
foreach
(
$
grps
as
$path
)
{
provision_path
(
"chown_recursive"
,
$path
,
drush_get_option
(
'script_user'
),
foreach
(
$
readwrite
as
$path
)
{
provision_path
(
"chown_recursive"
,
$path
,
drush_get_option
(
'script_user'
),
dt
(
"Changed ownership of <code>@path</code>"
),
dt
(
"Could not change ownership <code>@path</code>"
),
'DRUSH_PERM_ERROR'
);
...
...
platform/verify.provision.inc
View file @
35e21e82
...
...
@@ -44,23 +44,7 @@ function drush_provision_drupal_provision_verify($url = null) {
drush_set_option
(
'sites'
,
array_keys
((
array
)
provision_drupal_find_sites
()),
'drupal'
);
drush_log
(
dt
(
"This platform is running @short_name @version"
,
array
(
'@short_name'
=>
'drupal'
,
'@version'
=>
VERSION
)));
drush_set_option
(
'packages'
,
_scrub_object
(
provision_find_packages
()),
'drupal'
);
$paths
=
array
(
"sites/all/themes"
=>
0755
,
"sites/all/modules"
=>
0755
,
"sites/all/libraries"
=>
0755
,
# http://drupal.org/node/496240
);
foreach
(
$paths
as
$path
=>
$perm
)
{
if
(
!
is_dir
(
$path
))
{
provision_path
(
"mkdir"
,
$path
,
TRUE
,
dt
(
"Created <code>@path</code>"
),
dt
(
"Could not create <code>@path</code>"
),
'DRUSH_PERM_ERROR'
);
}
provision_path
(
"chmod_recursive"
,
$path
,
$perm
,
dt
(
"Changed permissions of <code>@path</code> to @confirm"
),
dt
(
"Could not change permissions of <code>@path</code> to @confirm"
),
'DRUSH_PERM_ERROR'
);
}
_provision_drupal_create_directories
(
'all'
);
}
else
{
drush_set_option
(
'packages'
,
_scrub_object
(
provision_drupal_system_map
()),
'site'
);
...
...
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