You are here

hosting_web_server.service.inc in Hosting 7.4

Hosting service classes for the Hosting web server module.osting service classes for the Hosting web server module.

File

web_server/hosting_web_server.service.inc
View source
<?php

/**
 * @file
 * Hosting service classes for the Hosting web server module.osting service classes for the Hosting web server module.
 */
class hostingService_http extends hostingService {
  public $service = 'http';
  public $ssl_enabled = FALSE;

}
class hostingService_http_public extends hostingService_http {
  protected $has_port = TRUE;
  function default_port() {
    return 80;
  }
  function update() {
    parent::update();
  }
  public function context_options($task_type, $ref_type, &$task) {
    parent::context_options($task_type, $ref_type, $task);
  }

}
class hostingService_http_apache extends hostingService_http_public {
  public $type = 'apache';
  public $name = 'Apache';
  protected $has_restart_cmd = TRUE;
  function default_restart_cmd() {
    $command = '/usr/sbin/apache2ctl';

    # a proper default for most of the world
    if (isset($_SERVER['PATH'])) {
      foreach (explode(':', $_SERVER['PATH']) as $path) {
        $options[] = "{$path}/apache2ctl";
        $options[] = "{$path}/apachectl";
      }
    }

    # try to detect the apache restart command
    $options[] = '/usr/local/sbin/apachectl';

    # freebsd
    $options[] = '/usr/sbin/apache2ctl';

    # debian + apache2
    $options[] = $command;
    foreach ($options as $test) {
      if (is_executable($test)) {
        $command = $test;
        break;
      }
    }
    return "sudo {$command} graceful";
  }
  function provisionProperties() {
    return array(
      'http_port' => $this
        ->default_port(),
      'restart_command' => $this
        ->default_restart_cmd(),
    );
  }

}

Classes

Namesort descending Description
hostingService_http @file Hosting service classes for the Hosting web server module.osting service classes for the Hosting web server module.
hostingService_http_apache
hostingService_http_public