Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
provision
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
provision
Commits
715c3a16
Commit
715c3a16
authored
Dec 27, 2014
by
omega8cc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitespace cleanup.
parent
99f60bfb
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
52 additions
and
62 deletions
+52
-62
Provision/Config/Drushrc/Aegir.php
Provision/Config/Drushrc/Aegir.php
+0
-1
Provision/Config/Drushrc/provision_drushrc_aegir.tpl.php
Provision/Config/Drushrc/provision_drushrc_aegir.tpl.php
+1
-1
Provision/Context/server.php
Provision/Context/server.php
+5
-5
Provision/Context/site.php
Provision/Context/site.php
+0
-1
db/Provision/Service/db.php
db/Provision/Service/db.php
+7
-7
example/Provision/Service/example/basic.php
example/Provision/Service/example/basic.php
+1
-1
http/Provision/Config/Apache/Ssl/vhost_ssl.tpl.php
http/Provision/Config/Apache/Ssl/vhost_ssl.tpl.php
+5
-5
http/Provision/Config/Apache/Ssl/vhost_ssl_disabled.tpl.php
http/Provision/Config/Apache/Ssl/vhost_ssl_disabled.tpl.php
+6
-7
http/Provision/Config/Nginx/subdir_disabled.tpl.php
http/Provision/Config/Nginx/subdir_disabled.tpl.php
+1
-1
http/Provision/Service/http/apache.php
http/Provision/Service/http/apache.php
+1
-1
migrate.hostmaster.inc
migrate.hostmaster.inc
+6
-6
platform/backup.provision.inc
platform/backup.provision.inc
+1
-1
platform/drupal/deploy_8.inc
platform/drupal/deploy_8.inc
+0
-1
platform/drupal/install_6.inc
platform/drupal/install_6.inc
+5
-5
platform/drupal/install_7.inc
platform/drupal/install_7.inc
+3
-3
platform/drupal/packages_7.inc
platform/drupal/packages_7.inc
+2
-2
platform/install.provision.inc
platform/install.provision.inc
+1
-3
platform/migrate.provision.inc
platform/migrate.provision.inc
+1
-4
platform/provision_drupal.drush.inc
platform/provision_drupal.drush.inc
+1
-1
platform/verify.provision.inc
platform/verify.provision.inc
+0
-1
provision.context.inc
provision.context.inc
+4
-4
provision.drush.inc
provision.drush.inc
+1
-1
No files found.
Provision/Config/Drushrc/Aegir.php
View file @
715c3a16
...
...
@@ -40,5 +40,4 @@ class Provision_Config_Drushrc_Aegir extends Provision_Config_Drushrc {
}
}
}
}
Provision/Config/Drushrc/provision_drushrc_aegir.tpl.php
View file @
715c3a16
...
...
@@ -14,4 +14,4 @@ print "\$options['exclude'] = ". var_export($drush_exclude, TRUE) . ";\n\n";
print
"# A list of paths that drush should include even when working outside
\n
"
;
print
"# the context of the hostmaster site.
\n
"
;
print
"
\$
options['include'] = "
.
var_export
(
$drush_include
,
TRUE
)
.
";
\n
"
;
?>
\ No newline at end of file
?>
Provision/Context/server.php
View file @
715c3a16
...
...
@@ -85,7 +85,7 @@ class Provision_Context_server extends Provision_Context {
*/
function
spawn_service
(
$service
,
$default
=
null
)
{
$type_option
=
"
{
$service
}
_service_type"
;
$type
=
isset
(
$this
->
options
[
$type_option
])
?
$this
->
options
[
$type_option
]
:
$default
;
if
(
$service
===
'file'
)
{
// Force provision-save local
...
...
@@ -205,7 +205,7 @@ class Provision_Context_server extends Provision_Context {
}
}
}
/**
* If necessary, fetch file from a remote server.
*
...
...
@@ -232,15 +232,15 @@ class Provision_Context_server extends Provision_Context {
if
(
drush_core_call_rsync
(
escapeshellarg
(
$this
->
script_user
.
'@'
.
$this
->
remote_host
.
':/'
)
.
$path
,
$path
,
$options
,
TRUE
,
FALSE
))
{
drush_log
(
dt
(
'@path has been fetched from remote server @remote_host.'
,
array
(
'@path'
=>
$path
,
'@path'
=>
$path
,
'@remote_host'
=>
$this
->
remote_host
))
);
}
else
{
drush_set_error
(
'PROVISION_FILE_SYNC_FAILED'
,
dt
(
'@path could not be fetched from remote server @remote_host.'
.
' Changes might not be available until this has been done. (error: %msg)'
,
array
(
'@path'
=>
$path
,
'@remote_host'
=>
$this
->
remote_host
,
'@path'
=>
$path
,
'@remote_host'
=>
$this
->
remote_host
,
'%msg'
=>
join
(
"
\n
"
,
drush_shell_exec_output
())))
);
}
...
...
Provision/Context/site.php
View file @
715c3a16
...
...
@@ -53,5 +53,4 @@ class Provision_Context_site extends Provision_Context {
$config
->
write
();
}
}
}
db/Provision/Service/db.php
View file @
715c3a16
...
...
@@ -50,7 +50,7 @@ class Provision_Service_db extends Provision_Service {
/**
* Find a viable database name, based on the site's uri.
*/
*/
function
suggest_db_name
()
{
$uri
=
$this
->
context
->
uri
;
...
...
@@ -79,7 +79,7 @@ class Provision_Service_db extends Provision_Service {
$creds
=
$this
->
generate_site_credentials
();
}
extract
(
$creds
);
if
(
drush_get_error
()
||
!
$this
->
can_create_database
())
{
drush_set_error
(
'PROVISION_CREATE_DB_FAILED'
);
drush_log
(
"Database could not be created."
,
'error'
);
...
...
@@ -102,9 +102,9 @@ class Provision_Service_db extends Provision_Service {
else
{
drush_set_error
(
'PROVISION_CREATE_DB_FAILED'
,
dt
(
"Could not create @name database"
,
array
(
"@name"
=>
$db_name
)));
}
return
$status
;
return
$status
;
}
/**
* Remove the database and user account for the supplied credentials
*/
...
...
@@ -120,12 +120,12 @@ class Provision_Service_db extends Provision_Service {
drush_log
(
dt
(
"Failed to drop database @dbname"
,
array
(
'@dbname'
=>
$db_name
)),
'warning'
);
}
}
if
(
$this
->
database_exists
(
$db_name
)
)
{
drush_set_error
(
'PROVISION_DROP_DB_FAILED'
);
return
FALSE
;
}
foreach
(
$this
->
grant_host_list
()
as
$db_grant_host
)
{
drush_log
(
dt
(
"Revoking privileges of %user@%client from %database"
,
array
(
'%user'
=>
$db_user
,
'%client'
=>
$db_grant_host
,
'%database'
=>
$db_name
)));
if
(
!
$this
->
revoke
(
$db_name
,
$db_user
,
$db_grant_host
))
{
...
...
@@ -161,7 +161,7 @@ class Provision_Service_db extends Provision_Service {
function
generate_site_credentials
()
{
$creds
=
array
();
// replace with service type
// replace with service type
$db_type
=
drush_get_option
(
'db_type'
,
function_exists
(
'mysqli_connect'
)
?
'mysqli'
:
'mysql'
);
// As of Drupal 7 there is no more mysqli type
if
(
drush_drupal_major_version
()
>=
7
)
{
...
...
example/Provision/Service/example/basic.php
View file @
715c3a16
...
...
@@ -108,7 +108,7 @@ class Provision_Service_example_basic extends Provision_Service_example {
$data
=
parent
::
config_data
(
$config
,
$class
);
/**
* This value will become available as $example_current_time
* This value will become available as $example_current_time
* in all the config files generated by this service.
*
* You could also choose to only conditionally pass values based on
...
...
http/Provision/Config/Apache/Ssl/vhost_ssl.tpl.php
View file @
715c3a16
...
...
@@ -3,11 +3,11 @@
<VirtualHost
<?php
print
"
{
$ip_address
}
:
{
$http_ssl_port
}
"
;
?>
>
<?php
if
(
$this
->
site_mail
)
:
?>
ServerAdmin
<?php
print
$this
->
site_mail
;
?>
ServerAdmin
<?php
print
$this
->
site_mail
;
?>
<?php
endif
;
?>
DocumentRoot
<?php
print
$this
->
root
;
?>
DocumentRoot
<?php
print
$this
->
root
;
?>
ServerName
<?php
print
$this
->
uri
;
?>
SetEnv db_type
<?php
print
urlencode
(
$db_type
);
?>
...
...
@@ -23,7 +23,7 @@
SetEnv db_port
<?php
print
urlencode
(
$db_port
);
?>
# Enable SSL handling.
SSLEngine on
SSLCertificateFile
<?php
print
$ssl_cert
;
?>
...
...
@@ -90,7 +90,7 @@ if ($this->redirection) {
</VirtualHost>
<?php
endif
;
?>
<?php
<?php
include
(
provision_class_directory
(
'Provision_Config_Apache_Site'
)
.
'/vhost.tpl.php'
);
?>
http/Provision/Config/Apache/Ssl/vhost_ssl_disabled.tpl.php
View file @
715c3a16
...
...
@@ -2,22 +2,22 @@
<VirtualHost
<?php
print
"
{
$ip_address
}
:
{
$http_ssl_port
}
"
;
?>
>
<?php
if
(
$this
->
site_mail
)
:
?>
ServerAdmin
<?php
print
$this
->
site_mail
;
?>
ServerAdmin
<?php
print
$this
->
site_mail
;
?>
<?php
endif
;
?>
DocumentRoot
<?php
print
$this
->
root
;
?>
DocumentRoot
<?php
print
$this
->
root
;
?>
ServerName
<?php
print
$this
->
uri
;
?>
# Enable SSL handling.
SSLEngine on
SSLCertificateFile
<?php
print
$ssl_cert
;
?>
SSLCertificateKeyFile
<?php
print
$ssl_cert_key
;
?>
<?php
<?php
if
(
sizeof
(
$this
->
aliases
))
{
print
"
\n
ServerAlias "
.
implode
(
"
\n
ServerAlias "
,
$this
->
aliases
)
.
"
\n
"
;
}
...
...
@@ -30,7 +30,6 @@
</VirtualHost>
<?php
endif
;
?>
<?php
<?php
include
(
provision_class_directory
(
'Provision_Config_Apache_Site'
)
.
'/vhost_disabled.tpl.php'
);
?>
http/Provision/Config/Nginx/subdir_disabled.tpl.php
View file @
715c3a16
...
...
@@ -10,7 +10,7 @@ location ^~ /<?php print $subdir; ?>/ {
root /var/www/nginx-default;
index index.html index.htm;
<?php
else
:
?>
return
404;
return 404;
<?php
endif
;
?>
### Do not reveal Aegir front-end URL here.
}
http/Provision/Service/http/apache.php
View file @
715c3a16
...
...
@@ -53,7 +53,7 @@ class Provision_Service_http_apache extends Provision_Service_http_public {
/**
* Restart apache to pick up the new config files.
*/
*/
function
parse_configs
()
{
return
$this
->
restart
();
}
...
...
migrate.hostmaster.inc
View file @
715c3a16
...
...
@@ -53,7 +53,7 @@ We are making the following assumptions:
));
provision_backend_invoke
(
$new_platform
,
'provision-verify'
);
drush_set_option
(
'new_platform'
,
$new_platform
);
// exit if an error has occured.
// exit if an error has occured.
if
(
drush_get_error
())
{
return
false
;
}
...
...
@@ -84,12 +84,12 @@ We are making the following assumptions:
provision_backend_invoke
(
$server
,
'provision-verify'
);
drush_set_option
(
'server_name'
,
$server
);
// exit if an error has occured.
// exit if an error has occured.
if
(
drush_get_error
())
{
return
false
;
}
$old_platform
=
'@platform_'
.
preg_replace
(
"/[!\W]/"
,
""
,
basename
(
rtrim
(
$data
[
'publish_path'
],
'/'
)));
drush_invoke_process
(
'@none'
,
"provision-save"
,
array
(
$old_platform
),
array
(
'context_type'
=>
'platform'
,
...
...
@@ -99,7 +99,7 @@ We are making the following assumptions:
));
provision_backend_invoke
(
$old_platform
,
'provision-verify'
);
drush_set_option
(
'old_platform'
,
$old_platform
);
// exit if an error has occured.
// exit if an error has occured.
if
(
drush_get_error
())
{
return
false
;
}
...
...
@@ -114,7 +114,7 @@ We are making the following assumptions:
));
provision_backend_invoke
(
$new_platform
,
'provision-verify'
);
drush_set_option
(
'new_platform'
,
$new_platform
);
// exit if an error has occured.
// exit if an error has occured.
if
(
drush_get_error
())
{
return
false
;
}
...
...
@@ -131,7 +131,7 @@ We are making the following assumptions:
));
provision_backend_invoke
(
$site_name
,
'provision-verify'
);
drush_set_option
(
'site_name'
,
$site_name
);
// exit if an error has occured.
// exit if an error has occured.
if
(
drush_get_error
())
{
return
false
;
}
...
...
platform/backup.provision.inc
View file @
715c3a16
...
...
@@ -20,7 +20,7 @@ function drush_provision_drupal_provision_backup_validate($backup_file = NULL) {
drush_set_error
(
'PROVISION_DRUPAL_SITE_NOT_FOUND'
);
}
// This is the actual drupal provisioning requirements.
// This is the actual drupal provisioning requirements.
if
(
!
is_dir
(
d
()
->
platform
->
server
->
backup_path
))
{
drush_set_error
(
'PROVISION_BACKUP_PATH_NOT_FOUND'
);
}
...
...
platform/drupal/deploy_8.inc
View file @
715c3a16
<?php
// $Id$
$new_url
=
d
()
->
uri
;
/**
...
...
platform/drupal/install_6.inc
View file @
715c3a16
...
...
@@ -80,8 +80,8 @@ function install_send_welcome_mail($url, $account, $profile, $language, $client_
$mail_params
[
'variables'
]
=
array
(
'!username'
=>
$account
->
name
,
'!site'
=>
variable_get
(
'site_name'
,
'Drupal'
),
'!login_url'
=>
$onetime
,
'!uri'
=>
$base_url
,
'!uri_brief'
=>
preg_replace
(
'!^https?://!'
,
''
,
$base_url
),
'!mailto'
=>
$account
->
mail
,
'!date'
=>
format_date
(
time
()),
'!login_uri'
=>
url
(
'user'
,
array
(
'absolute'
=>
TRUE
)),
'!uri'
=>
$base_url
,
'!uri_brief'
=>
preg_replace
(
'!^https?://!'
,
''
,
$base_url
),
'!mailto'
=>
$account
->
mail
,
'!date'
=>
format_date
(
time
()),
'!login_uri'
=>
url
(
'user'
,
array
(
'absolute'
=>
TRUE
)),
'!edit_uri'
=>
url
(
'user/'
.
$account
->
uid
.
'/edit'
,
array
(
'absolute'
=>
TRUE
)));
$mail_success
=
drupal_mail
(
'install'
,
'welcome-admin'
,
$client_email
,
user_preferred_language
(
$account
),
$mail_params
,
$from
,
TRUE
);
...
...
@@ -103,7 +103,7 @@ function install_mail($key, &$message, $params) {
require_once
"./profiles/
$profile
/provision_welcome_mail.inc"
;
$custom
=
TRUE
;
}
elseif
(
file_exists
(
dirname
(
__FILE__
)
.
'/../provision_welcome_mail.inc'
))
{
elseif
(
file_exists
(
dirname
(
__FILE__
)
.
'/../provision_welcome_mail.inc'
))
{
/** use the module provided welcome email
* We can not use drupal_get_path here,
* as we are connected to the provisioned site's database
...
...
@@ -256,7 +256,7 @@ function install_main() {
foreach
(
$modules
as
$module
)
{
_drupal_install_module
(
$module
);
module_enable
(
array
(
$module
));
drush_log
(
dt
(
"Installed @module module."
,
drush_log
(
dt
(
"Installed @module module."
,
array
(
"@module"
=>
$files
[
$module
]
->
info
[
'name'
])));
}
...
...
@@ -327,7 +327,7 @@ function install_main() {
if
(
$task
==
'profile-finished'
)
{
// profile-finished task
// Secondary locale import
// Secondary locale import
if
(
!
empty
(
$install_locale
)
&&
(
$install_locale
!=
'en'
))
{
// Collect files to import for this language. Skip components
// already covered in the initial batch set.
...
...
platform/drupal/install_7.inc
View file @
715c3a16
...
...
@@ -19,8 +19,8 @@ function install_send_welcome_mail($url, $account, $language, $client_email, $on
$from
=
variable_get
(
'site_mail'
,
ini_get
(
'sendmail_from'
));
$mail_params
[
'variables'
]
=
array
(
'!username'
=>
$account
->
name
,
'!site'
=>
variable_get
(
'site_name'
,
'Drupal'
),
'!login_url'
=>
$onetime
,
'!uri'
=>
$base_url
,
'!uri_brief'
=>
preg_replace
(
'!^https?://!'
,
''
,
$base_url
),
'!mailto'
=>
$account
->
mail
,
'!date'
=>
format_date
(
time
()),
'!login_uri'
=>
url
(
'user'
,
array
(
'absolute'
=>
TRUE
)),
'!uri'
=>
$base_url
,
'!uri_brief'
=>
preg_replace
(
'!^https?://!'
,
''
,
$base_url
),
'!mailto'
=>
$account
->
mail
,
'!date'
=>
format_date
(
time
()),
'!login_uri'
=>
url
(
'user'
,
array
(
'absolute'
=>
TRUE
)),
'!edit_uri'
=>
url
(
'user/'
.
$account
->
uid
.
'/edit'
,
array
(
'absolute'
=>
TRUE
)));
$mail_success
=
drupal_mail
(
'install'
,
'welcome-admin'
,
$account
->
mail
,
user_preferred_language
(
$account
),
$mail_params
,
$from
,
TRUE
);
...
...
@@ -44,7 +44,7 @@ function install_mail($key, &$message, $params) {
require_once
"./profiles/
$profile
/provision_welcome_mail.inc"
;
$custom
=
TRUE
;
}
elseif
(
file_exists
(
dirname
(
__FILE__
)
.
'/../provision_welcome_mail.inc'
))
{
elseif
(
file_exists
(
dirname
(
__FILE__
)
.
'/../provision_welcome_mail.inc'
))
{
/** use the module provided welcome email
* We can not use drupal_get_path here,
* as we are connected to the provisioned site's database
...
...
platform/drupal/packages_7.inc
View file @
715c3a16
<?php
/**
* @file Package management code for Drupal 7
* @file Package management code for Drupal 7
*/
...
...
@@ -112,7 +112,7 @@ function _provision_drupal_parse_info_file($filename) {
function
_provision_system_query
(
$type
)
{
$entries
=
array
();
$result
=
db_query
(
"SELECT * FROM
{
system
}
WHERE type=:type"
,
array
(
':type'
=>
$type
));
foreach
(
$result
as
$entry
)
{
foreach
(
$result
as
$entry
)
{
$entries
[]
=
$entry
;
}
return
$entries
;
...
...
platform/install.provision.inc
View file @
715c3a16
...
...
@@ -27,7 +27,7 @@ function drush_provision_drupal_provision_install_validate() {
* Set up the directories and settings.php file that we need.
*/
function
drush_provision_drupal_pre_provision_install
()
{
// This is the actual drupal provisioning requirements.
// This is the actual drupal provisioning requirements.
_provision_drupal_create_directories
();
}
...
...
@@ -40,8 +40,6 @@ function drush_provision_drupal_pre_provision_install_rollback() {
foreach
(
d
()
->
drush_aliases
as
$alias
)
{
drush_invoke_process
(
'@none'
,
'provision-save'
,
array
(
$alias
),
array
(
'delete'
=>
TRUE
));
}
}
...
...
platform/migrate.provision.inc
View file @
715c3a16
...
...
@@ -55,7 +55,7 @@ function drush_provision_drupal_pre_provision_migrate($platform, $new_name = NUL
* Implementation of drush_hook_pre_COMMAND_rollback().
*/
function
drush_provision_drupal_pre_provision_migrate_rollback
(
$platform
,
$new_name
=
NULL
)
{
// Set site_offline to false and regenerate the config
// Set site_offline to false and regenerate the config
.
drush_log
(
dt
(
"Bringing site out of maintenance"
));
d
()
->
site_enabled
=
true
;
_provision_drupal_create_settings_file
();
...
...
@@ -66,7 +66,6 @@ function drush_provision_drupal_pre_provision_migrate_rollback($platform, $new_n
->
fail
(
'Could not remove unused migration site package'
);
d
()
->
service
(
'http'
)
->
create_config
(
'site'
);
d
()
->
service
(
'http'
)
->
parse_configs
();
}
/**
...
...
@@ -77,9 +76,7 @@ function drush_provision_drupal_pre_provision_migrate_rollback($platform, $new_n
function
drush_provision_drupal_provision_migrate
(
$platform
,
$new_name
=
NULL
)
{
$target
=
drush_get_option
(
'target_name'
);
$options
=
array
();
$options
[
'uri'
]
=
d
()
->
uri
;
if
(
!
is_null
(
$new_name
)
&&
(
$new_name
!=
d
()
->
name
))
{
...
...
platform/provision_drupal.drush.inc
View file @
715c3a16
...
...
@@ -402,7 +402,7 @@ function _provision_find_profiles() {
$profile
->
info
=
array
();
if
(
drush_drupal_major_version
()
>=
8
)
{
if
(
drush_drupal_major_version
()
>=
8
)
{
$yaml_file
=
"
$profiles_subdir
/
$name
/
$name
.info.yml"
;
if
(
!
file_exists
(
$yaml_file
))
{
drush_log
(
dt
(
"@name.info.yml not found."
,
array
(
"@name"
=>
$name
)),
'notice'
);
...
...
platform/verify.provision.inc
View file @
715c3a16
...
...
@@ -16,7 +16,6 @@ function drush_provision_drupal_provision_verify_validate() {
drush_errors_on
();
drush_bootstrap
(
DRUSH_BOOTSTRAP_DRUPAL_FULL
);
}
}
...
...
provision.context.inc
View file @
715c3a16
...
...
@@ -53,11 +53,11 @@ function & d($name = NULL, $_root_object = FALSE, $allow_creation = TRUE) {
if
(
is_null
(
$name
))
{
$name
=
$default_instance
;
}
if
(
$_root_object
)
{
$default_instance
=
$name
;
}
$name
=
provision_normalise_context_name
(
$name
);
if
(
isset
(
$instances
[
$name
]))
{
...
...
@@ -77,13 +77,13 @@ function & d($name = NULL, $_root_object = FALSE, $allow_creation = TRUE) {
* Simple access layer for drush_sitealias_get_record.
*
* Everytime sitealiases are fetched a lot of processing happens, but if the
* file doesnt exist yet there's a whole lot of unnecesary stuff happening.
* file doesnt exist yet there's a whole lot of unnecesary stuff happening.
*
* We cache the result locally here.
*/
function
provision_sitealias_get_record
(
$name
)
{
static
$cache
=
array
();
$name
=
provision_normalise_context_name
(
$name
);
if
(
!
isset
(
$cache
[
$name
]))
{
...
...
provision.drush.inc
View file @
715c3a16
...
...
@@ -193,7 +193,7 @@ function provision_drush_command() {
'hidden'
=>
TRUE
,
),
),
'bootstrap'
=>
DRUSH_BOOTSTRAP_DRUSH
'bootstrap'
=>
DRUSH_BOOTSTRAP_DRUSH
);
$items
[
'provision-restore'
]
=
array
(
...
...
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