2025-04-08 23:00:21 +01:00
|
|
|
# Loom | Spinner
|
|
|
|
|
2025-04-13 12:59:44 +01:00
|
|
|
An environment management application for PHP developers.
|
|
|
|
|
2025-04-13 22:17:49 +01:00
|
|
|
# Dev Notes
|
2025-04-13 12:59:44 +01:00
|
|
|
|
|
|
|
**Argument priority:**
|
|
|
|
|
|
|
|
- Those passed explicitly in the CLI commands
|
|
|
|
- Any set within `{projectDirectory}/spinner.yaml`
|
|
|
|
- Fall back to `/config/spinner.yaml`
|
|
|
|
|
2025-04-13 22:17:49 +01:00
|
|
|
# Commands
|
2025-04-13 12:59:44 +01:00
|
|
|
|
2025-04-13 22:17:49 +01:00
|
|
|
## Command: `spin:up`
|
2025-04-13 12:59:44 +01:00
|
|
|
|
2025-04-13 22:17:49 +01:00
|
|
|
Creates a new PHP development environment and mounts your project files.
|
2025-04-13 12:59:44 +01:00
|
|
|
|
2025-04-13 22:17:49 +01:00
|
|
|
### Arguments
|
2025-04-13 12:59:44 +01:00
|
|
|
|
2025-04-13 22:17:49 +01:00
|
|
|
> #### Argument: name
|
|
|
|
>
|
|
|
|
> **Required?** ✅
|
|
|
|
>
|
2025-04-14 00:13:30 +01:00
|
|
|
> The name of your Docker containers. Your containers will spin up with the name {name}-{service} i.e.
|
2025-04-13 22:17:49 +01:00
|
|
|
>
|
|
|
|
> `spinner spin:up name=test path=/path`
|
|
|
|
>
|
2025-04-14 00:13:30 +01:00
|
|
|
> Results in containers named `test-php` and `test-nginx`
|
2025-04-13 12:59:44 +01:00
|
|
|
|
2025-04-13 22:17:49 +01:00
|
|
|
> #### Argument: path
|
|
|
|
>
|
|
|
|
> **Required?** ✅
|
|
|
|
>
|
|
|
|
> The **absolute path** on your system to the project you want to create containers for.
|
2025-04-13 20:13:19 +01:00
|
|
|
|
2025-04-13 22:17:49 +01:00
|
|
|
### Options
|
2025-04-13 20:13:19 +01:00
|
|
|
|
2025-04-13 22:17:49 +01:00
|
|
|
> #### Option: --php
|
|
|
|
>
|
|
|
|
> **Required?** ❌
|
|
|
|
>
|
|
|
|
> Defines the PHP version that your container will use. You can omit this flag and set the PHP version inside your
|
|
|
|
> projects `spinner.yaml` file. Otherwise, will use the default value found in `config/spinner.yaml`
|
2025-04-13 20:13:19 +01:00
|
|
|
|
2025-04-13 22:17:49 +01:00
|
|
|
> #### Option: --node
|
|
|
|
>
|
|
|
|
> **Required?** ❌
|
|
|
|
>
|
|
|
|
> Set which version of Node to install in your container. Is ignored if the `--disable-node` flag is
|
2025-04-14 15:25:40 +01:00
|
|
|
> passed, or if Node is disabled in your projects `spinner.yaml` file. Equivalent to setting
|
|
|
|
> `options.environment.node.version: x` in your projects Spinner config.
|
2025-04-13 22:17:49 +01:00
|
|
|
|
2025-04-14 15:25:40 +01:00
|
|
|
> #### Option: --database
|
2025-04-13 22:17:49 +01:00
|
|
|
>
|
|
|
|
> **Required?** ❌
|
|
|
|
>
|
2025-04-14 15:25:40 +01:00
|
|
|
> Set which database driver to use with your environment. The default (and currently only) database driver is `sqlite3`.
|
|
|
|
> Accepted values are currently `sqlite` and `sqlite3`. If using the default, SQLite is installed inside your PHP
|
|
|
|
> container and a mapping created to the `/sqlite` directory in your project. This argument is ignored if
|
|
|
|
> `--disabled-database` is set.
|
|
|
|
|
|
|
|
> #### Option: --disable-database
|
|
|
|
>
|
|
|
|
> **Required?** ❌
|
|
|
|
>
|
|
|
|
> Does not install a database with your environment. Equivalent to setting `options.environment.database.enabled: false`
|
2025-04-13 22:17:49 +01:00
|
|
|
> in your Spinner config.
|
|
|
|
|
2025-04-14 15:25:40 +01:00
|
|
|
> #### Option: --disable-node
|
|
|
|
>
|
|
|
|
> **Required?** ❌
|
|
|
|
>
|
|
|
|
> Disables Node for your environment, so it isn't included in your PHP container. Equivalent to setting
|
|
|
|
> `options.environment.node.enabled: false` in your Spinner config.
|
|
|
|
|
2025-04-13 22:17:49 +01:00
|
|
|
> #### Option: --disable-server
|
|
|
|
>
|
|
|
|
> **Required?** ❌
|
|
|
|
>
|
2025-04-14 15:25:40 +01:00
|
|
|
> Does not install a webserver (so no Nginx). Useful if you just need a PHP container to run unit tests or something.
|
2025-04-13 23:33:55 +01:00
|
|
|
|
|
|
|
> #### Option: --disable-xdebug
|
|
|
|
>
|
|
|
|
> **Required?** ❌
|
|
|
|
>
|
2025-04-14 15:25:40 +01:00
|
|
|
> Do not install XDebug in your environment. Equivalent to setting `options.environment.php.xdebug = false` in your
|
|
|
|
> projects Spinner config.
|
2025-04-13 23:33:55 +01:00
|
|
|
|
|
|
|
## XDebug Setup
|
|
|
|
|
|
|
|
These instructions are for PHPStorm. I don't know about working with other IDE's, although they
|
|
|
|
should be fairly universal.
|
|
|
|
|
|
|
|
### Server Settings
|
|
|
|
|
2025-04-13 23:40:25 +01:00
|
|
|
- `File` -> `Settings`
|
2025-04-13 23:33:55 +01:00
|
|
|
- `PHP` -> `Servers` -> `+`
|
|
|
|
- Give your "server" a name and use the values shown below.
|
|
|
|
|
|
|
|
| Setting | Value |
|
|
|
|
|-------------------------|----------------------------------------------------------------------------------------------------------------|
|
|
|
|
| Host | 127.0.0.1 |
|
|
|
|
| Port | **Local** port **PHP** container is running on. i.e. if your docker container shows 52033:9003, use **52033**. |
|
|
|
|
| Debugger | Xdebug |
|
|
|
|
| Use path mappings? | ✅ |
|
|
|
|
| File/Directory | Select **your project root** |
|
|
|
|
| Absolute path on server | /var/www/html |
|
|
|
|
|
|
|
|
### Remote Debugger
|
|
|
|
|
|
|
|
- `Run` -> `Edit Configurations`
|
|
|
|
- `+` -> `PHP Remote Debug`
|
|
|
|
- Give it a name
|
|
|
|
- Use the server you created before
|
2025-04-13 23:40:25 +01:00
|
|
|
- Use **SPINNER** as IDE key
|
|
|
|
|
|
|
|
Make sure you start listening when you want to debug by clicking the little bug icon in the
|
|
|
|
top right (by default) in PHPStorm.
|