Update Wiki for version 1.1.0

Daniel Winning 2025-04-25 11:27:42 +01:00
parent da5528fab2
commit b351eb779c
4 changed files with 54 additions and 27 deletions

@ -16,20 +16,23 @@ loom spin:up [name] [path] [--options]
### Options ### Options
| Option | Description | Example/Accepted Values | | Option | Description | Example/Accepted Values |
|---------------------|------------------------------------------------|-------------------------| |--------------------|---------------------------------|--------------------------------|
| --php | Choose PHP version | `8.3`, `8.4`, etc. | | --php | Choose PHP version | `8.3`, `8.4`, etc. |
| --disable-xdebug | Disable Xdebug in PHP container | (flag, no value) | | --disable-xdebug | Disable Xdebug in PHP container | (flag, no value) |
| --database | Select database (currently only sqlite) | `sqlite` | | --database | Select database | `mysql`, `sqlite` or `sqlite3` |
| --disable-database | Disable database container | (flag, no value) | | --disable-database | Disable database container | (flag, no value) |
| --disable-server | Exclude Nginx web server | (flag, no value) | | --disable-server | Exclude Nginx web server | (flag, no value) |
| --node | Set Node.js version | `20`, `23`, etc. | | --node | Set Node.js version | `20`, `23`, etc. |
## What it Does ## What it Does
- Reads configuration and builds required project files (Dockerfile, docker-compose). - Reads configuration and builds required project files (Dockerfile, docker-compose).
- Spins up the PHP (and optionally Nginx/database) containers for your project. - Spins up the PHP (and optionally Nginx/database) containers for your project.
- Automatically mounts your project directory. - Automatically mounts your project directory.
- **Creates a `/sqlite` folder in your project root if you have selected SQLite as your database. This folder is used to
store your development SQLite database files, ensuring that your database persists across container rebuilds and is
easily accessible for backups or inspection.**
## Notes ## Notes
@ -37,3 +40,11 @@ loom spin:up [name] [path] [--options]
**To apply changes to config or options, destroy and rebuild your environment.** **To apply changes to config or options, destroy and rebuild your environment.**
- Project name becomes the Docker prefix (e.g., `projectname-php`). - Project name becomes the Docker prefix (e.g., `projectname-php`).
- Requires Docker running. - Requires Docker running.
## Database Folders and Data
- **MySQL:** Database data is stored inside a `data/[projectname]/mysql` folder created by the environment, (outside your
project) allowing MySQL data persistence between container restarts.
- **SQLite:** If you enable the SQLite database option, a `sqlite` folder will automatically be created in the root of
your project (if it doesn't already exist). This folder is used to store your SQLite database files. You should add
this folder to your `.gitignore` if you do not wish to track database state in version control.

@ -1,9 +1,10 @@
# Configuration # Configuration
By default, **Loom Spinner** provides a powerful environment for your PHP projects—no extra configuration required. By default, **Loom Spinner** provides a powerful environment for your PHP projects—no extra configuration required.
However, Loom Spinner is designed to be flexible, so you can easily tailor your environment to suit different project needs. However, Loom Spinner is designed to be flexible, so you can tailor your environment to suit different project needs.
For example, if you're building a CLI tool and don't need a web server, you can simply pass the `--disable-server` option to the `spin:up` command to exclude Nginx. For example, if you're building a CLI tool and don't need a web server, you can pass the `--disable-server` option
to the `spin:up` command to exclude Nginx.
This page explains how to customize your environments using command line options or a project configuration file. This page explains how to customize your environments using command line options or a project configuration file.
@ -18,7 +19,8 @@ This page explains how to customize your environments using command line options
## Default Configuration ## Default Configuration
Every Loom Spinner environment starts with sensible defaults, defined in the [default configuration file](https://forge.winningsoftware.co.uk/LoomLabs/spinner/src/branch/main/config/spinner.yaml) in the repository. Every Loom Spinner environment starts with sensible defaults, defined in the [default configuration file](https://forge.winningsoftware.co.uk/LoomLabs/spinner/src/branch/main/config/spinner.yaml) in the
repository.
--- ---
@ -26,10 +28,8 @@ Every Loom Spinner environment starts with sensible defaults, defined in the [de
You can adjust your environment by: You can adjust your environment by:
1. **Passing options to the CLI** 1. **Passing options to the CLI**: Override settings directly when you run the `spin:up` command.
Override settings directly when you run commands. 2. **Creating a `spinner.yaml` config file**: Place this file in your project root to define environment defaults.
2. **Creating a `spinner.yaml` config file**
Place this file in your project root to define project-wide defaults.
### Configuration Priority ### Configuration Priority
@ -41,7 +41,23 @@ When configuring, Loom Spinner checks for values in this order (highest to lowes
For example: For example:
If your `spinner.yaml` sets `environment.database.enabled: true`, but you run `spin:up` with `--disable-database`, the CLI flag takes precedence. If your `spinner.yaml` sets `environment.database.enabled: true`, but you run `spin:up` with `--disable-database`, the
CLI flag takes precedence.
---
## Example: Setting the MySQL Root Password
You can set the password for the MySQL root user (when the MySQL database is used) in your project configuration file:
```yaml
options:
environment:
database:
rootPassword: mySecretPassword
```
If this option is not provided, the `rootPassword` will be used from the default config.
--- ---
@ -70,14 +86,14 @@ Most configuration options can also be supplied directly at the command line whe
## Available Options ## Available Options
| Option | Config Key | Accepted Values | | Option | Config Key | Accepted Values |
|----------------------|---------------------------------------|-------------------------------------------------------| |----------------------|---------------------------------------|-----------------------------------------------|
| `--php` | `environment.php.version` | Any PHP version with a valid Docker FPM image | | `--php` | `environment.php.version` | Any PHP version with a valid Docker FPM image |
| `--disable-xdebug` | `environment.php.xdebug: false` | CLI: none<br/>YAML: `true`/`false` | | `--disable-xdebug` | `environment.php.xdebug: false` | CLI: none<br/>YAML: `true`/`false` |
| `--database` | - | `sqlite` or `sqlite3` | | `--database` | - | `mysql`, `sqlite` or `sqlite3` |
| `--disable-database` | `environment.database.enabled: false` | CLI: none<br/>YAML: `true`/`false` | | `--disable-database` | `environment.database.enabled: false` | CLI: none<br/>YAML: `true`/`false` |
| `--disable-server` | `environment.server.enabled: false` | CLI: none<br/>YAML: `true`/`false` | | `--disable-server` | `environment.server.enabled: false` | CLI: none<br/>YAML: `true`/`false` |
| `--node` | `environment.node.version` | Any valid Node.js version (e.g., `20`) | | `--node` | `environment.node.version` | Any valid Node.js version (e.g., `20`) |
For a comprehensive example of all options, see the [`config/spinner.yaml`](https://forge.winningsoftware.co.uk/LoomLabs/spinner/src/branch/main/config/spinner.yaml) For a comprehensive example of all options, see the [`config/spinner.yaml`](https://forge.winningsoftware.co.uk/LoomLabs/spinner/src/branch/main/config/spinner.yaml)
in the repository. in the repository.

@ -16,7 +16,7 @@ A typical Loom Spinner environment gives you everything you need to kick off loc
- **A PHP Container** with: - **A PHP Container** with:
- PHP 8.4 - PHP 8.4
- Node 23 - Node 23
- SQLite - MySQL
- XDebug - XDebug
- Opcache - Opcache
- Popular PHP extensions enabled by default - Popular PHP extensions enabled by default

@ -30,7 +30,7 @@ loom spin:up my-project .
- `my-project` is the name you'll use for this environment. - `my-project` is the name you'll use for this environment.
- `.` means "use the current directory as the project root". - `.` means "use the current directory as the project root".
Loom Spinner will set up Docker containers with PHP, Nginx, Node, SQLite, and more, based on your configuration and project needs. Loom Spinner will set up Docker containers with PHP, Nginx, Node, MySQL (or SQLite), and more, based on your configuration and project needs.
## 4. Access Your Project ## 4. Access Your Project