Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hostmaster
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
hostmaster
Commits
9059dde9
Commit
9059dde9
authored
Jun 8, 2010
by
Adrian Rossouw
Browse files
Options
Downloads
Patches
Plain Diff
better install and migrate. enforce @server_localhost and @hostmaster aliases.
parent
2074cb98
Branches
dev-services
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
hostmaster.profile
+2
-2
2 additions, 2 deletions
hostmaster.profile
modules/hosting/hosting.install
+15
-0
15 additions, 0 deletions
modules/hosting/hosting.install
modules/hosting/resume.hostmaster.inc
+0
-6
0 additions, 6 deletions
modules/hosting/resume.hostmaster.inc
with
17 additions
and
8 deletions
hostmaster.profile
+
2
−
2
View file @
9059dde9
...
...
@@ -66,7 +66,7 @@ function hostmaster_bootstrap() {
$node
=
new
stdClass
();
$node
->
uid
=
1
;
$node
->
type
=
'server'
;
$node
->
title
=
$_SERVER
[
'HTTP_HOST'
]
;
$node
->
title
=
'localhost'
;
$node
->
status
=
1
;
$node
->
services
=
array
();
...
...
@@ -125,7 +125,7 @@ function hostmaster_bootstrap() {
$node
=
new
stdClass
();
$node
->
uid
=
1
;
$node
->
type
=
'platform'
;
$node
->
title
=
$_SERVER
[
'HTTP_HOST'
]
.
' (Drupal '
.
VERSION
.
')
'
;
$node
->
title
=
'hostmaster
'
;
$node
->
publish_path
=
drush_locate_root
(
drush_get_option
(
array
(
'r'
,
'root'
),
NULL
));
$node
->
web_server
=
variable_get
(
'hosting_default_web_server'
,
3
);
$node
->
status
=
1
;
...
...
This diff is collapsed.
Click to expand it.
modules/hosting/hosting.install
+
15
−
0
View file @
9059dde9
...
...
@@ -219,6 +219,8 @@ function hosting_update_6008() {
$records
=
array
();
$result
=
db_query
(
"SELECT n.nid, title FROM
{
node
}
n LEFT JOIN
{
hosting_site
}
s ON n.nid=s.nid WHERE s.status <> -2 AND n.type='site'"
);
while
(
$object
=
db_fetch_object
(
$result
))
{
$records
[
$object
->
nid
]
=
$object
->
title
;
...
...
@@ -234,6 +236,19 @@ function hosting_update_6008() {
$records
[
$object
->
nid
]
=
'platform_'
.
preg_replace
(
"/[!\W]/"
,
""
,
$object
->
title
);
}
// we want to enforce that the hostmaster site is always referred to as @hostmaster
$own_site
=
db_result
(
db_query
(
"SELECT s.nid FROM
{
hosting_site
}
s LEFT JOIN
{
hosting_package
}
p ON s.profile=p.nid WHERE p.short_name='hostmaster'"
));
$records
[
$own_site
]
=
'hostmaster'
;
// We start with the web server because we assume that the main hostmaster site is installed locally.
$node
=
node_load
(
$own_site
);
$server
=
node_load
(
$node
->
web_server
);
$server
->
title
=
'localhost'
;
node_save
(
$server
);
$records
[
$server
->
nid
]
=
'server_localhost'
;
foreach
(
$records
as
$nid
=>
$name
)
{
db_query
(
"INSERT INTO
{
hosting_context
}
(nid, name) VALUES (%d, '%s')"
,
$nid
,
$name
);
}
...
...
This diff is collapsed.
Click to expand it.
modules/hosting/resume.hostmaster.inc
+
0
−
6
View file @
9059dde9
...
...
@@ -46,12 +46,6 @@ function drush_hosting_hostmaster_resume() {
db_query
(
"UPDATE
{
hosting_context
}
SET name='%s' WHERE nid=%d"
,
ltrim
(
$new_platform
,
'@'
),
$platform_id
);
}
$server_id
=
$platform
->
web_server
;
// fix the new platform alias name
if
(
hosting_context_name
(
$server_id
)
!=
$server_name
)
{
db_query
(
"UPDATE
{
hosting_context
}
SET name='%s' WHERE nid=%d"
,
ltrim
(
$server_name
,
'@'
),
$server_id
);
}
drush_log
(
'fixing platform for site node'
);
$node
->
verified
=
0
;
...
...
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