'drupal', '@version' => VERSION)));
drush_set_option('packages', _scrub_object(provision_find_packages()), 'drupal');
}
else {
drush_set_option('packages', _scrub_object(provision_drupal_system_map()), 'site');
// This is the actual drupal provisioning requirements.
_provision_drupal_create_directories($url);
_provision_drupal_maintain_aliases($url);
// Requires at least the database settings to complete.
_provision_drupal_create_settings_file($url);
}
$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 @path
"),
dt("Could not create @path
"),
'DRUSH_PERM_ERROR');
}
provision_path("chmod_recursive", $path, $perm,
dt("Changed permissions of @path
to @confirm"),
dt("Could not change permissions of @path
to @confirm"),
'DRUSH_PERM_ERROR');
}
}
/**
* Implementation of hook_provision_post_verify
*/
function drush_provision_drupal_post_provision_verify($url = NULL) {
if (PROVISION_CONTEXT_SITE) {
_provision_drupal_rebuild_caches($url);
drush_set_option('aliases', drush_get_option('aliases'), 'site');
drush_set_option('redirection', drush_get_option('redirection'), 'site');
drush_set_option('installed', TRUE, 'site');
}
}
/**
* Inject the relevant .htacces configuration into the global apache configuration
*/
function provision_drupal_provision_apache_dir_config($data = null) {
return <<
Order allow,deny
# Don't show directory listings for URLs which map to a directory.
Options -Indexes
# Follow symbolic links in this directory.
Options +FollowSymLinks
# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php
# Force simple error message for requests for non-existent favicon.ico.
# There is no end quote below, for compatibility with Apache 1.3.
ErrorDocument 404 "The requested file favicon.ico was not found.
# Set the default handler.
DirectoryIndex index.php
# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.
# PHP 4, Apache 1.
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
# PHP 4, Apache 2.
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
# PHP 5, Apache 1 and 2.
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
# Requires mod_expires to be enabled.
# Enable expirations.
ExpiresActive On
# Cache all files for 2 weeks after access (A).
ExpiresDefault A1209600
# Do not cache dynamically generated pages.
ExpiresByType text/html A1
# Various rewrite rules.
RewriteEngine on
# allow files to be accessed without /sites/fqdn/
RewriteRule ^files/(.*)$ /sites/%{HTTP_HOST}/files/$1 [L]
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
# Do not read the platform's .htaccess
AllowOverride none
EOF;
}