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 <?php
/** /**
* @file * @file
* Expose the web dumbcluster feature to hostmaster. * Expose the web pack feature to hostmaster.
*/ */
/** /**
* Implementation of hook_hosting_feature(). * Implementation of hook_hosting_feature().
*/ */
function hosting_web_dumbcluster_hosting_feature() { function hosting_web_pack_hosting_feature() {
$features['web_dumbcluster'] = array( $features['web_pack'] = array(
'title' => t('Web dumbclusters'), '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.'), '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, 'status' => HOSTING_FEATURE_DISABLED,
'module' => 'hosting_web_dumbcluster', 'module' => 'hosting_web_pack',
'group' => 'experimental', 'group' => 'experimental',
); );
return $features; return $features;
......
name = Web Dumbcluster name = Web Pack
description = Allow hostmaster to configure web dumbclusters, which have masters and slaves. description = Allow hostmaster to configure web "packs", which have masters and slaves.
package = Hosting package = Hosting
dependencies[] = hosting_web_server dependencies[] = hosting_web_server
......
<?php <?php
function hosting_web_dumbcluster_schema() { function hosting_web_pack_schema() {
return array( return array(
'hosting_web_dumbcluster' => array( 'hosting_web_pack' => array(
'fields' => array( 'fields' => array(
'vid' => array( 'vid' => array(
'type' => 'int', 'type' => 'int',
...@@ -33,10 +33,10 @@ function hosting_web_dumbcluster_schema() { ...@@ -33,10 +33,10 @@ function hosting_web_dumbcluster_schema() {
); );
} }
function hosting_web_dumbcluster_install() { function hosting_web_pack_install() {
drupal_install_schema('hosting_web_dumbcluster'); drupal_install_schema('hosting_web_pack');
} }
function hosting_web_dumbcluster_uninstall() { function hosting_web_pack_uninstall() {
drupal_uninstall_schema('hosting_web_dumbcluster'); drupal_uninstall_schema('hosting_web_pack');
} }
<?php
function hosting_web_pack_hosting_service() {
return array(
'pack' => 'http',
);
}
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
module_load_include('service.inc', 'hosting_web_server'); module_load_include('service.inc', 'hosting_web_server');
class hostingService_http_dumbcluster extends hostingService_http { class hostingService_http_pack extends hostingService_http {
public $type = 'dumbcluster'; public $type = 'pack';
function view(&$render) { function view(&$render) {
$render['master_servers'] = array( $render['master_servers'] = array(
...@@ -44,7 +44,7 @@ class hostingService_http_dumbcluster extends hostingService_http { ...@@ -44,7 +44,7 @@ class hostingService_http_dumbcluster extends hostingService_http {
$ssl_enabled = TRUE; $ssl_enabled = TRUE;
$master_servers = array(); $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)) { while ($web_server = db_fetch_object($result)) {
if ($web_server->type == 'master') { if ($web_server->type == 'master') {
$master_servers[] = $web_server->web_server_nid; $master_servers[] = $web_server->web_server_nid;
...@@ -69,7 +69,7 @@ class hostingService_http_dumbcluster extends hostingService_http { ...@@ -69,7 +69,7 @@ class hostingService_http_dumbcluster extends hostingService_http {
'web_server_nid' => $web_server, 'web_server_nid' => $web_server,
'type' => 'master', '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) { foreach (array_filter($this->slave_servers) as $web_server) {
$record = array( $record = array(
...@@ -78,18 +78,18 @@ class hostingService_http_dumbcluster extends hostingService_http { ...@@ -78,18 +78,18 @@ class hostingService_http_dumbcluster extends hostingService_http {
'web_server_nid' => $web_server, 'web_server_nid' => $web_server,
'type' => 'slave', 'type' => 'slave',
); );
drupal_write_record('hosting_web_dumbcluster', $record); drupal_write_record('hosting_web_pack', $record);
} }
} }
function delete() { function delete() {
parent::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() { function delete_revision() {
parent::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) { 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