Skip to content

Commit

Permalink
add site hosting module
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpugh committed Sep 16, 2024
1 parent 5f4a65b commit 96cea6e
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/Drupal/Modules/site_hosting/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Site Hosting

Create and manage websites.

## History

This was created by DevShop author Jon Pugh. It replaces the "Hosting" module used in Aegir & DevShop in Drupal 7.

## Requirements

- [Site Module](https://drupal.org/project/site)
- [Commands Module](https://drupal.org/project/commands)

## Installation

```shell
composer require drupal/site_hosting
```

## Configuration

TODO

## Maintainers

Current maintainers for Site Hosting:

- Jon Pugh (@jonpugh) - https://www.drupal.org/u/jonpugh

8 changes: 8 additions & 0 deletions src/Drupal/Modules/site_hosting/site_hosting.info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: 'Site Hosting'
type: module
description: 'Create and manage websites.'
package: Operations
core_version_requirement: ^10 || ^11
dependencies:
- commands:commands
- site:site
6 changes: 6 additions & 0 deletions src/Drupal/Modules/site_hosting/site_hosting.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

/**
* @file
* Install, update and uninstall functions for the Site Hosting module.
*/
6 changes: 6 additions & 0 deletions src/Drupal/Modules/site_hosting/site_hosting.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

/**
* @file
* Primary module hooks for Site Hosting module.
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace Drupal\commands\Plugin\Command;

use Drupal\commands\CommandPluginBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\user\Entity\User;

/**
* Plugin implementation of the task_command.
*
* @Command(
* id = "composer_install",
* label = @Translation("Composer Install"),
* description = @Translation("Runs composer install."),
* command = "composer install --ansi"
* )
*/
class ComposerInstall extends CommandPluginBase {

public function command($params = []) {
if (!empty($params['verbose'])) {
return parent::command($params) . ' --verbose';
}
return parent::command($params);
}

/**
* Show a form on the "Run command" form.
* @return void
*/
public function form($form, FormStateInterface $form_state) {
$form['parameters']['verbose'] = [
'#type' => 'checkbox',
'#title' => t('Verbose'),
'#description'=> t('Get verbose information.'),
];

// @TODO: Reset working_directory to detected composer root.
return $form;
}
}
Empty file.

0 comments on commit 96cea6e

Please sign in to comment.