hosting_web_server.service.inc

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

Classes

File

web_server/hosting_web_server.service.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Hosting service classes for the Hosting web server module.osting service classes for the Hosting web server module.
  5. */
  6. class hostingService_http extends hostingService {
  7. public $service = 'http';
  8. public $ssl_enabled = FALSE;
  9. }
  10. class hostingService_http_public extends hostingService_http {
  11. protected $has_port = TRUE;
  12. function default_port() {
  13. return 80;
  14. }
  15. function update() {
  16. parent::update();
  17. }
  18. public function context_options($task_type, $ref_type, &$task) {
  19. parent::context_options($task_type, $ref_type, $task);
  20. }
  21. }
  22. class hostingService_http_apache extends hostingService_http_public {
  23. public $type = 'apache';
  24. protected $has_restart_cmd = TRUE;
  25. function default_restart_cmd() {
  26. $command = '/usr/sbin/apache2ctl'; # a proper default for most of the world
  27. foreach (explode(':', $_SERVER['PATH']) as $path) {
  28. $options[] = "$path/apache2ctl";
  29. $options[] = "$path/apachectl";
  30. }
  31. # try to detect the apache restart command
  32. $options[] = '/usr/local/sbin/apachectl'; # freebsd
  33. $options[] = '/usr/sbin/apache2ctl'; # debian + apache2
  34. $options[] = $command;
  35. foreach ($options as $test) {
  36. if (is_executable($test)) {
  37. $command = $test;
  38. break;
  39. }
  40. }
  41. return "sudo $command graceful";
  42. }
  43. }