Commit 1f0c3fc4 authored by anarcat's avatar anarcat

rename dumbcluster to pack

parent b42197b8
<?php
function hosting_web_dumbcluster_hosting_service() {
return array(
'dumbcluster' => 'http',
);
}
<?php
/**
* @file
* Expose the web dumbcluster feature to hostmaster.
* Expose the web pack feature to hostmaster.
*/
/**
* Implementation of hook_hosting_feature().
*/
function hosting_web_dumbcluster_hosting_feature() {
$features['web_dumbcluster'] = array(
'title' => t('Web dumbclusters'),
function hosting_web_pack_hosting_feature() {
$features['web_pack'] = array(
'title' => t('Web pack'),
'description' => t('Provides a service to expose a site across multiple web front ends. This adds to the base cluster class the capability of having "light" servers which do not have files copied around.'),
'status' => HOSTING_FEATURE_DISABLED,
'module' => 'hosting_web_dumbcluster',
'module' => 'hosting_web_pack',
'group' => 'experimental',
);
return $features;
......
name = Web Dumbcluster
description = Allow hostmaster to configure web dumbclusters, which have masters and slaves.
name = Web Pack
description = Allow hostmaster to configure web "packs", which have masters and slaves.
package = Hosting
dependencies[] = hosting_web_server
......
<?php
function hosting_web_dumbcluster_schema() {
function hosting_web_pack_schema() {
return array(
'hosting_web_dumbcluster' => array(
'hosting_web_pack' => array(
'fields' => array(
'vid' => array(
'type' => 'int',
......@@ -33,10 +33,10 @@ function hosting_web_dumbcluster_schema() {
);
}
function hosting_web_dumbcluster_install() {
drupal_install_schema('hosting_web_dumbcluster');
function hosting_web_pack_install() {
drupal_install_schema('hosting_web_pack');
}
function hosting_web_dumbcluster_uninstall() {
drupal_uninstall_schema('hosting_web_dumbcluster');
function hosting_web_pack_uninstall() {
drupal_uninstall_schema('hosting_web_pack');
}
<?php
function hosting_web_pack_hosting_service() {
return array(
'pack' => 'http',
);
}
......@@ -2,8 +2,8 @@
module_load_include('service.inc', 'hosting_web_server');
class hostingService_http_dumbcluster extends hostingService_http {
public $type = 'dumbcluster';
class hostingService_http_pack extends hostingService_http {
public $type = 'pack';
function view(&$render) {
$render['master_servers'] = array(
......@@ -44,7 +44,7 @@ class hostingService_http_dumbcluster extends hostingService_http {
$ssl_enabled = TRUE;
$master_servers = array();
$result = db_query('SELECT web_server_nid, type FROM {hosting_web_dumbcluster} WHERE vid = %d', $this->server->vid);
$result = db_query('SELECT web_server_nid, type FROM {hosting_web_pack} WHERE vid = %d', $this->server->vid);
while ($web_server = db_fetch_object($result)) {
if ($web_server->type == 'master') {
$master_servers[] = $web_server->web_server_nid;
......@@ -69,7 +69,7 @@ class hostingService_http_dumbcluster extends hostingService_http {
'web_server_nid' => $web_server,
'type' => 'master',
);
drupal_write_record('hosting_web_dumbcluster', $record);
drupal_write_record('hosting_web_pack', $record);
}
foreach (array_filter($this->slave_servers) as $web_server) {
$record = array(
......@@ -78,18 +78,18 @@ class hostingService_http_dumbcluster extends hostingService_http {
'web_server_nid' => $web_server,
'type' => 'slave',
);
drupal_write_record('hosting_web_dumbcluster', $record);
drupal_write_record('hosting_web_pack', $record);
}
}
function delete() {
parent::delete();
db_query('DELETE FROM {hosting_web_dumbcluster} WHERE nid = %d', $this->server->nid);
db_query('DELETE FROM {hosting_web_pack} WHERE nid = %d', $this->server->nid);
}
function delete_revision() {
parent::delete_revision();
db_query('DELETE FROM {hosting_web_dumbcluster} WHERE vid = %d', $this->server->vid);
db_query('DELETE FROM {hosting_web_pack} WHERE vid = %d', $this->server->vid);
}
function context_options($task_type, $ref_type, &$task) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment