Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
provision
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
provision
Commits
d0bcac8a
Commit
d0bcac8a
authored
May 29, 2010
by
Neil Drumm
Committed by
Neil Drumm
May 29, 2010
Browse files
Options
Downloads
Patches
Plain Diff
Remove boilerplate code and get db server verify working
parent
16db51a6
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
db/db.drush.inc
+8
-5
8 additions, 5 deletions
db/db.drush.inc
http/apache/apache_service.inc
+16
-12
16 additions, 12 deletions
http/apache/apache_service.inc
provision.drush.inc
+6
-3
6 additions, 3 deletions
provision.drush.inc
provision.environment.inc
+7
-4
7 additions, 4 deletions
provision.environment.inc
with
37 additions
and
24 deletions
db/db.drush.inc
+
8
−
5
View file @
d0bcac8a
...
...
@@ -38,11 +38,14 @@ class provisionService_db extends provisionService {
}
function
verify
()
{
if
(
!
$this
->
can_create_database
())
{
drush_set_error
(
'PROVISION_CREATE_DB_FAILED'
);
if
(
d
(
$this
->
owner
)
->
type
===
'server'
)
{
$this
->
connect
();
if
(
$this
->
can_create_database
())
{
drush_log
(
dt
(
'Provision can create new databases.'
),
'message'
);
}
else
{
drush_log
(
dt
(
'Provision can create new databases.'
),
'message'
);
drush_set_error
(
'PROVISION_CREATE_DB_FAILED'
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
http/apache/apache_service.inc
+
16
−
12
View file @
d0bcac8a
...
...
@@ -46,18 +46,22 @@ class provisionService_http_apache extends provisionService_http {
}
function
verify
()
{
if
(
PROVISION_CONTEXT_PLATFORM
)
{
$this
->
create_platform_config
();
}
elseif
(
PROVISION_CONTEXT_SERVER
)
{
switch
(
d
(
$this
->
owner
)
->
type
)
{
case
'server'
:
provision_service
(
'file'
)
->
create_dir
(
drush_get_option
(
'vhost_path'
),
dt
(
"Virtual host configuration"
),
0700
);
provision_service
(
'file'
)
->
create_dir
(
drush_get_option
(
'platform_conf_path'
),
dt
(
"Platforms configuration"
),
0700
);
provision_service
(
'file'
)
->
create_dir
(
drush_get_option
(
'config_path'
)
.
'/apache.d'
,
dt
(
"Apache configuration"
),
0700
);
$this
->
create_server_config
();
}
elseif
(
PROVISION_CONTEXT_SITE
)
{
break
;
case
'platform'
:
$this
->
create_platform_config
();
break
;
case
'site'
:
$this
->
create_site_config
();
break
;
}
$this
->
parse_configs
();
...
...
This diff is collapsed.
Click to expand it.
provision.drush.inc
+
6
−
3
View file @
d0bcac8a
...
...
@@ -62,7 +62,6 @@ include_once('provision.inc');
function
provision_drush_init
()
{
d
(
drush_get_option
(
'hosting-name'
,
'@self'
),
TRUE
);
print_r
(
d
());
$load
=
sys_getloadavg
();
if
(
provision_load_critical
(
$load
))
{
drush_set_error
(
'PROVISION_OVERLOAD'
,
dt
(
"load on system too heavy (@load), aborting"
,
array
(
'@load'
=>
join
(
" "
,
$load
))));
...
...
@@ -216,15 +215,19 @@ function drush_provision_hostmaster_make($platform) {
drush_backend_invoke
(
'make'
,
array
(
dirname
(
__FILE__
)
.
'/aegir.make'
,
$platform
));
}
function
drush_
http_
provision_named_context_save
()
{
function
drush_provision_named_context_save
()
{
d
()
->
write_alias
();
}
function
drush_
http_
provision_named_context_delete
()
{
function
drush_provision_named_context_delete
()
{
$config
=
new
provisionConfig_drushrc_alias
(
drush_get_option
(
'hosting_name'
));
$config
->
unlink
();
}
function
drush_provision_verify
()
{
d
()
->
verify
();
}
function
_provision_default_restart_cmd
()
{
$command
=
'/usr/sbin/apachectl'
;
// A proper default for most of the world
foreach
(
explode
(
':'
,
$_SERVER
[
'PATH'
])
as
$path
)
{
...
...
This diff is collapsed.
Click to expand it.
provision.environment.inc
+
7
−
4
View file @
d0bcac8a
...
...
@@ -63,7 +63,7 @@ class provisionEnvironment {
protected
$name
=
null
;
protected
$properties
=
array
();
p
rotected
$type
=
null
;
p
ublic
$type
=
null
;
protected
$oid_map
=
array
();
protected
$map
=
array
();
...
...
@@ -235,6 +235,7 @@ class provisionServer extends provisionEnvironment {
$object
=
new
$className
(
$this
->
name
);
$object
->
init
();
$this
->
services
[
$service
]
=
$object
;
$this
->
setProperty
(
$type_option
,
$type
);
}
}
else
{
...
...
@@ -258,11 +259,13 @@ class provisionServer extends provisionEnvironment {
* An array of return values from method implementations.
*/
function
services_invoke
(
$callback
)
{
$return
=
array
();
foreach
(
$this
->
services
as
$service
)
{
$return
=
array_merge
(
$return
,
$service
->
$callback
()
)
;
$service
->
$callback
();
}
return
$return
;
}
function
verify
()
{
$this
->
services_invoke
(
'verify'
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment