Skip to content

Commit 789f765

Browse files
authored
Merge pull request #312 from iMattPro/updates
Minor updates
2 parents 635d70d + c676b34 commit 789f765

28 files changed

Lines changed: 103 additions & 8 deletions

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# QuickInstall Changelog
22

3+
## Version 1.8.0-dev
4+
5+
- [Feature] Added a new local “Dashboard UI” (browser-based) workflow for the QuickInstall CLI.
6+
- [Feature] Added new QI update available notifications in the CLI and Dashboard UI.
7+
- [Feature] Added a new `doctor` command to diagnose host requirements.
8+
- [Change] Improved workspace safety and Windows compatibility.
9+
310
## Version 1.7.0
411

512
- [Feature] QuickInstall CLI – A brand new Docker-based command-line-interface tool for creating local phpBB test boards.

‎README.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ QuickInstall is a tool we built to support the community of phpBB extension deve
3030
- 📁`sources/`
3131
- 📁`settings/`
3232

33-
> If you are upgrading from QuickInstall 1.6.16 (or older) you will need to copy the new 📁`customisations/` folder.
34-
3533
> If you are upgrading from QuickInstall 1.1.8 (or older) you MUST review and re-save your old Profile settings.
3634
3735
## 💻 Requirements

‎src/QuickInstall/Sandbox/Application.php‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use RuntimeException;
1515
use Throwable;
1616

17+
/** CLI command dispatcher and presentation layer. */
1718
class Application
1819
{
1920
private Project $project;
@@ -40,6 +41,8 @@ public function run(array $argv): int
4041
$operationLock = null;
4142
try
4243
{
44+
// CLI and Dashboard mutations share one lock so their multi-file work
45+
// cannot interleave. Read-only commands deliberately remain concurrent.
4346
if ($this->mutatesWorkspace($command))
4447
{
4548
$operationLock = $this->project->lockOperations();

‎src/QuickInstall/Sandbox/BoardRefreshService.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
namespace QuickInstall\Sandbox;
1212

13+
/** Regenerates runtime files and recreates a board only when it is running. */
1314
class BoardRefreshService
1415
{
1516
private Project $project;

‎src/QuickInstall/Sandbox/BoardRunner.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use InvalidArgumentException;
1414
use RuntimeException;
1515

16+
/** Executes Docker lifecycle, install, debug, and seed operations for a board. */
1617
class BoardRunner
1718
{
1819
private Project $project;
@@ -26,6 +27,7 @@ public function __construct(Project $project, ?Output $output = null, ?ProcessRu
2627
$this->processRunner = $processRunner ?: new ProcessRunner($this->output);
2728
}
2829

30+
/** Starts containers, completes first install, applies options, and waits for HTTP. */
2931
public function start(string $name): void
3032
{
3133
$board = $this->project->board($name);
@@ -51,6 +53,7 @@ public function stop(string $name): void
5153
$this->run(['docker', 'compose', '-f', $this->project->composePath($name), 'stop']);
5254
}
5355

56+
/** Removes Docker resources before deleting all persisted board state. */
5457
public function destroy(string $name): void
5558
{
5659
$this->project->board($name);
@@ -83,6 +86,7 @@ private function removeContainers(string $name, bool $removeImage): void
8386
}
8487
}
8588

89+
/** Returns missing, stopped, partial, running, or error. */
8690
public function status(string $name): string
8791
{
8892
$compose = $this->project->composePath($name);
@@ -159,6 +163,7 @@ protected function seedIfNeeded(string $name, string $preset): void
159163
return;
160164
}
161165

166+
// The host marker makes automatic population idempotent across restarts.
162167
$marker = $this->seedMarker($name, $preset);
163168
if (file_exists($marker))
164169
{

‎src/QuickInstall/Sandbox/BoardService.php‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use RuntimeException;
1515
use Throwable;
1616

17+
/** Owns board definitions and coordinates source, runtime, and Docker services. */
1718
class BoardService
1819
{
1920
private Project $project;
@@ -25,6 +26,10 @@ public function __construct(Project $project, ?Output $output = null)
2526
$this->output = $output;
2627
}
2728

29+
/**
30+
* Creates a board definition and runtime scaffold without starting Docker.
31+
* Existing state is restored if a replacement fails.
32+
*/
2833
public function create(string $name, string $version = 'latest', string $db = 'mariadb', int $port = 8080, string $populate = 'none', bool $debug = false, bool $replace = false): array
2934
{
3035
$this->project->init();
@@ -66,6 +71,8 @@ public function create(string $name, string $version = 'latest', string $db = 'm
6671
throw new InvalidArgumentException("Port $port is already in use on this host.");
6772
}
6873

74+
// Resolve and fetch first; a failed download must not disturb a board
75+
// that is being replaced.
6976
$source = $this->createSourceProvider()->ensure($version);
7077
$php = $source['php'] ?? $selection['php'] ?? null;
7178
if ($php === null || $php === '')
@@ -91,6 +98,7 @@ public function create(string $name, string $version = 'latest', string $db = 'm
9198
$backups = [];
9299
if ($existingName !== null)
93100
{
101+
// Rename existing state aside so any later failure can restore it.
94102
$this->createBoardRunner()->prepareReplacement($name);
95103
$backups = $this->backupBoardState($name);
96104
}

‎src/QuickInstall/Sandbox/BufferedOutput.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
namespace QuickInstall\Sandbox;
1212

13+
/** Captures subprocess output for Dashboard responses and tests. */
1314
class BufferedOutput implements Output
1415
{
1516
private string $output = '';

‎src/QuickInstall/Sandbox/CommandLine.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
namespace QuickInstall\Sandbox;
1212

13+
/** Parses positional arguments, long options, and boolean flags. */
1314
class CommandLine
1415
{
1516
private array $args = [];

‎src/QuickInstall/Sandbox/CustomisationMountService.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use InvalidArgumentException;
1414
use RuntimeException;
1515

16+
/** Coordinates single or recursive extension/style mounts and board refreshes. */
1617
class CustomisationMountService
1718
{
1819
private Project $project;
@@ -24,6 +25,7 @@ public function __construct(Project $project, ?Output $output = null)
2425
$this->output = $output;
2526
}
2627

28+
/** Returns mounted items and per-item errors; recursive mounts are best effort. */
2729
public function mount(object $manager, string $board, string $source, bool $copy = false, bool $recursive = false, bool $allowExternal = false): array
2830
{
2931
if ($recursive)

‎src/QuickInstall/Sandbox/DockerComposeWriter.php‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
use RuntimeException;
1414

15+
/** Generates the complete Docker runtime scaffold for one board. */
1516
class DockerComposeWriter
1617
{
1718
private Project $project;
@@ -21,6 +22,7 @@ public function __construct(Project $project)
2122
$this->project = $project;
2223
}
2324

25+
/** Writes compose, image, entrypoint, and installer files for one board. */
2426
public function write(string $name, array $config): array
2527
{
2628
$runtimeDir = $this->project->workspacePath('runtime/' . $name);
@@ -53,6 +55,7 @@ public function write(string $name, array $config): array
5355

5456
private function writeFile(string $path, string $contents): void
5557
{
58+
// Containers execute these files as Linux files even when generated on Windows.
5659
$contents = str_replace(["\r\n", "\r"], "\n", $contents);
5760
if (file_put_contents($path, $contents, LOCK_EX) !== strlen($contents))
5861
{
@@ -129,6 +132,7 @@ private function compose(string $name, array $config): string
129132
PHP_VERSION: "{$config['php']}"
130133
working_dir: /var/www/html
131134
ports:
135+
# Boards are intentionally unavailable to other network devices.
132136
- "127.0.0.1:{$config['port']}:80"
133137
volumes:
134138
{$this->bindVolume($sourcePath, '/opt/phpbb-source', true)}{$this->bindVolume($boardPath, '/var/www/html')}{$extensionVolumes}{$styleVolumes}{$this->bindVolume('./install-config.yml', '/opt/quickinstall/install-config.yml', true)}{$this->bindVolume('./entrypoint.sh', '/opt/quickinstall/entrypoint.sh', true)}

0 commit comments

Comments
 (0)