Skip to content

Commit

Permalink
feat: REPL and Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leocavalcante committed Dec 4, 2023
1 parent ec165ea commit f74f790
Show file tree
Hide file tree
Showing 14 changed files with 1,726 additions and 33 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3
-
name: Test
run: ./lib/bashunit ./tests/
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ RUN apk add --no-cache \
&& mv /etc/php/php.ini /etc/php${PHP}/conf.d/99_phpctl.ini \
&& wget https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer -O - -q | php -- --quiet \
&& mv composer.phar /usr/bin/composer \
&& wget https://psysh.org/psysh && chmod +x psysh && mv psysh /usr/local/bin/psysh \
&& rm -rf /var/cache/apk/*
ENTRYPOINT [ "/usr/bin/php" ]
CMD [ "-v" ]
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@ phpctl <command> [arguments]

### Commands

| Command | Description |
| --- | --- |
| `help` or `man` | Shows a help message. |
| `doctor` | Inspects the current `PHP_VERSION` and `PHPCTL_IMAGE`. |
| `install` | Installs `phpctl` (and `pctl`) globally in your system. |
| `build` | Builds the current `Dockerfile` (useful for custom images). |
| `images` | Shows local `phpctl` images. |
| `php` | **Runs PHP commands** (`phpctl php -v` or `pctl php -m`). |
| `composer` | Runs Composer commands (`phpctl composer install` or `pctl composer validate`). |
| Command | Description |
| --- |---------------------------------------------------------------------------------------------|
| `help` or `man` | Shows a help message. |
| `doctor` | Inspects the current `PHP_VERSION` and `PHPCTL_IMAGE`. |
| `install` | Installs `phpctl` (and `pctl`) globally in your system. |
| `build` | Builds the current `Dockerfile` (useful for custom images). |
| `images` | Shows local `phpctl` images. |
| `php` | **Runs PHP commands** (`phpctl php -v` or `pctl php -m`). |
| `composer` | Runs Composer commands (`phpctl composer install` or `pctl composer validate`). |
| `server [port] [directory]` | Runs PHP's built-in web-server (default port is `80` and default directory is current `.`). |
| `sh [commands]` | Starts an interactive Shell session or runs `sh` commands. |
| `at [port] [command]` | Run commands within a bound port (default port is `80`). |
| `sh [commands]` | Starts an interactive Shell session or runs `sh` commands. |
| `at [port] [command]` | Run commands within a bound port (default port is `80`). |
| `repl` | Starts a PHP REPL session (powered by [PsySH](https://psysh.org/)). |

### The `.phpctl` file

Expand Down
Loading

0 comments on commit f74f790

Please sign in to comment.